def score(self, x, yTrue):
        """
        Returns the coefficient of determination R\ :sup:`2` of the prediction.

        The coefficient R\ :sup:`2` is defined as ``(1 - u / v)``, where ``u`` is
        the regression sum of squares ``((yTrue - yPredicted) ** 2).sum()`` and ``v``
        is the residual sum of squares ``((yTrue - yTrue.mean()) ** 2).sum()``.
        Best possible score is ``1.0``, lower values are worse.

        Returns:
            (float) the R\ :sup:`2` value

        Examples::

            from pyfora.algorithms import RegressionTreeBuilder

            builder = RegressionTreeBuilder(2)
            x = pandas.DataFrame({'x0': [-1,0,1], 'x1': [0,1,1]})
            y = pandas.DataFrame({'y': [0,1,1]})
            regressionTree = builder.fit(x, y)

            # predict `regressionTree` on `x` itself
            regressionTree.score(x, y)

        """
        sz = len(x)
        assert sz == len(yTrue)

        if isinstance(yTrue, PurePandas.PurePythonDataFrame):
            yTrue = yTrue.iloc[:, 0]

        yPredicted = self.predict(x)

        u = sum(
            (yTrue[ix] - yPredicted[ix]) ** 2.0 for ix in xrange(sz)
            )
        mean = sum(yTrue) / sz
        v = sum(
            (yTrue[ix] - mean) ** 2.0 for ix in xrange(sz)
            )

        return 1.0 - u / v
dataset/ETHPy150Open ufora/ufora/packages/python/pyfora/algorithms/regressionTrees/RegressionTree.py/RegressionTree.score/original