Base class for probability estimators.
Estimators model the probability distribution of a single variable and support incremental (
add_value) as well as batch (fit) updates.Classes
Abstract base class for all probability estimators.
Estimators are used to model the probability distribution of a variable.
Constructor
__init__( self, )
Methods
add_values
(self, values: np.ndarray, weights: Optional[np.ndarray]=None) -> None
add_values
(self, values: np.ndarray, weights: Optional[np.ndarray]=None) -> None
Add multiple values to the estimator.
Parameters
values
np.ndarray of shape (n_values,)
Array of values to add.
weights
np.ndarray of shape (n_values,)
Weight for each value. Defaults to uniform weights of 1.0.
Returns
None
fit
(self, values: np.ndarray, weights: Optional[np.ndarray]=None) -> 'ProbabilityEstimator'
fit
(self, values: np.ndarray, weights: Optional[np.ndarray]=None) -> 'ProbabilityEstimator'
Fit the estimator to data (batch mode).
Parameters
values
np.ndarray of shape (n_values,)
Array of values to fit on.
weights
np.ndarray of shape (n_values,)
Weight for each value. Defaults to uniform weights of 1.0.
Returns
self
ProbabilityEstimator
The fitted estimator, for method chaining.