@@ -247,43 +247,6 @@ def partial_fit(self, X, y, sample_weight=None):
247
247
super (MultiOutputRegressor , self ).partial_fit (
248
248
X , y , sample_weight = sample_weight )
249
249
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
-
287
250
288
251
class MultiOutputClassifier (MultiOutputEstimator , ClassifierMixin ):
289
252
"""Multi target classification
0 commit comments