Skip to content

River2SKLRegressor

Compatibility layer from River to scikit-learn for regression.

Parameters

Methods

fit

Fits to an entire dataset contained in memory.

Parameters

  • X
  • y

Returns

self

get_params

Get parameters for this estimator.

Parameters

  • deep — defaults to True

Returns

dict

partial_fit

Fits incrementally on a portion of a dataset.

Parameters

  • X
  • y

Returns

self

predict

Predicts the target of an entire dataset contained in memory.

Parameters

  • X

Returns

np.ndarray: Predicted target values for each row of X.

score

Return the coefficient of determination of the prediction.

The coefficient of determination :math:R^2 is defined as :math:(1 - \frac{u}{v}), where :math:u is the residual sum of squares ((y_true - y_pred)** 2).sum() and :math:v is the total sum of squares ((y_true - y_true.mean()) ** 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a :math:R^2 score of 0.0.

Parameters

  • X
  • y
  • sample_weight — defaults to None

Returns

float

set_params

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as :class:~sklearn.pipeline.Pipeline). The latter have parameters of the form <component>__<parameter> so that it's possible to update each component of a nested object.

Parameters

  • params

Returns

estimator instance