module prediction.river.river_classifier

River Predictive Model Wrapper.

This module contains a wrapper class for river predictive models.

Copyright (C) 2022 Johannes Haug.


class RiverClassifier

Wrapper for river predictive models.

Attributes:

  • model (ClassifierMixin): The river predictor object.
  • feature_names (List[str]): A list of all feature names.

method RiverClassifier.__init__

__init__(
    model: river.base.classifier.Classifier,
    feature_names: List[str],
    reset_after_drift: bool = False
)

Inits the wrapper.

Args:

  • model: The river predictor object.
  • feature_names: A list of all feature names.
  • reset_after_drift: A boolean indicating if the predictor will be reset after a drift was detected.

method RiverClassifier.partial_fit

partial_fit(
    X: Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]],
    y: Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]],
    sample_weight: Optional[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]] = None
)

Updates the predictor.

Args:

  • X: Array/matrix of observations.
  • y: Array of corresponding labels.
  • sample_weight: Weights per sample. Not used by float at the moment, i.e., all observations in x receive equal weight in a pipeline run.

method RiverClassifier.predict

predict(
    X: Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]
) → Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]

Predicts the target values.

Args:

  • X: Array/matrix of observations.

Returns:

  • ArrayLike: Predicted labels for all observations.

method RiverClassifier.predict_proba

predict_proba(
    X: Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]
) → Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]

Predicts the probability of target values.

Args:

  • X: Array/matrix of observations.

Returns:

  • ArrayLike: Predicted probability per class label for all observations.

method RiverClassifier.reset

reset()

Resets the predictor.


This file was automatically generated via lazydocs.