8000 remove code to be removed in 0.19 · scikit-learn/scikit-learn@59e3f7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 59e3f7d

Browse files
author
Joan Massich
committed
remove code to be removed in 0.19
1 parent 776bba1 commit 59e3f7d

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

sklearn/multioutput.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -247,43 +247,6 @@ def partial_fit(self, X, y, sample_weight=None):
247247
super(MultiOutputRegressor, self).partial_fit(
248248
X, y, sample_weight=sample_weight)
249249

250-
def score(self, X, y, sample_weight=None):
251-
"""Returns the coefficient of determination R^2 of the prediction.
252-
253-
The coefficient R^2 is defined as (1 - u/v), where u is the residual
254-
sum of squares ((y_true - y_pred) ** 2).sum() and v is the regression
255-
sum of squares ((y_true - y_true.mean()) ** 2).sum().
256-
Best possible score is 1.0 and it can be negative (because the
257-
model can be arbitrarily worse). A constant model that always
258-
predicts the expected value of y, disregarding the input features,
259-
would get a R^2 score of 0.0.
260-
261-
Notes
262-
-----
263-
R^2 is calculated by weighting all the targets equally using
264-
`multioutput='uniform_average'`.
265-
266-
Parameters
267-
----------
268-
X : array-like, shape (n_samples, n_features)
269-
Test samples.
270-
271-
y : array-like, shape (n_samples) or (n_samples, n_outputs)
272-
True values for X.
273-
274-
sample_weight : array-like, shape [n_samples], optional
275-
Sample weights.
276-
277-
Returns
278-
-------
279-
score : float
280-
R^2 of self.predict(X) wrt. y.
281-
"""
282-
# XXX remove in 0.19 when r2_score default for multioutput changes
283-
from .metrics import r2_score
284-
return r2_score(y, self.predict(X), sample_weight=sample_weight,
285-
multioutput='uniform_average')
286-
287250

288251
class MultiOutputClassifier(MultiOutputEstimator, ClassifierMixin):
289252
"""Multi target classification

0 commit comments

Comments
 (0)
0