module prediction.base_predictor
Base Online Predictor.
This module encapsulates functionality for online predictive modelling. The abstract BasePredictor class should be used as super class for all online predictive models.
Copyright (C) 2022 Johannes Haug.
class BasePredictor
Abstract base class for online predictive models.
Attributes:
reset_after_drift
(bool): A boolean indicating if the predictor will be reset after a drift was detected.has_been_trained
(bool): A boolean indicating if the predictor has been trained at least once.
method BasePredictor.__init__
__init__(reset_after_drift: bool)
Inits the predictor.
Args:
reset_after_drift
: A boolean indicating if the predictor will be reset after a drift was detected.
method BasePredictor.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]]]
)
Updates the predictor.
Args:
X
: Array/matrix of observations.y
: Array of corresponding labels.
method BasePredictor.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 BasePredictor.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 BasePredictor.reset
reset()
Resets the predictor.
This file was automatically generated via lazydocs.