Skip to content

River2SKLClassifier

Compatibility layer from River to scikit-learn for classification.

Parameters

Methods

fit

Fits to an entire dataset contained in memory.

Parameters

  • X
  • y

Returns

self

get_metadata_routing

Get metadata routing of this object.

Please check :ref:User Guide <metadata_routing> on how the routing mechanism works.

Returns

MetadataRequest

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
  • classes — defaults to None

Returns

self

predict

Predicts the target of an entire dataset contained in memory.

Parameters

  • X

Returns

Predicted target values for each row of X.

predict_proba

Predicts the target probability of an entire dataset contained in memory.

Parameters

  • X

Returns

Predicted target values for each row of X.

score

Return the mean accuracy on the given test data and labels.

In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.

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

set_partial_fit_request

Request metadata passed to the partial_fit method.

Note that this method is only relevant if enable_metadata_routing=True (see :func:sklearn.set_config). Please see :ref:User Guide <metadata_routing> on how the routing mechanism works. The options for each parameter are: - True: metadata is requested, and passed to partial_fit if provided. The request is ignored if metadata is not provided. - False: metadata is not requested and the meta-estimator will not pass it to partial_fit. - None: metadata is not requested, and the meta-estimator will raise an error if the user provides it. - str: metadata should be passed to the meta-estimator with this given alias instead of the original name. The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others. .. versionadded:: 1.3 .. note:: This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a :class:pipeline.Pipeline. Otherwise it has no effect.

Parameters

  • classesUnion[bool, NoneType, str] — defaults to $UNCHANGED$

Returns

River2SKLClassifier: object

set_score_request

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see :func:sklearn.set_config). Please see :ref:User Guide <metadata_routing> on how the routing mechanism works. The options for each parameter are: - True: metadata is requested, and passed to score if provided. The request is ignored if metadata is not provided. - False: metadata is not requested and the meta-estimator will not pass it to score. - None: metadata is not requested, and the meta-estimator will raise an error if the user provides it. - str: metadata should be passed to the meta-estimator with this given alias instead of the original name. The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others. .. versionadded:: 1.3 .. note:: This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a :class:pipeline.Pipeline. Otherwise it has no effect.

Parameters

  • sample_weightUnion[bool, NoneType, str] — defaults to $UNCHANGED$

Returns

River2SKLClassifier: object