storage#
- class storage.BatchStorage(store_targets=True)[source]#
Bases:
BaseStorageA Batch Storage storing all seen samples.
- class storage.GeometricReservoirStorage(size, constant_probability=None, store_targets=False)[source]#
Bases:
ReservoirStorageGeometric Reservoir Storage
- class storage.IntervalStorage(size, store_targets=True)[source]#
Bases:
BaseStorageAn Interval Storage storing last k samples.
- class storage.ReservoirStorage(size, store_targets=False)[source]#
Bases:
BaseStorage,ABCReservoir Storage - base class
- size int
Size of the reservoir.
- store_targets bool
Flag if the target values are also stored.
- class storage.SequenceStorage(store_targets=True)[source]#
Bases:
IntervalStorageAn Interval Storage storing the last sample.
- class storage.TreeStorage(cat_feature_names, num_feature_names, max_depth=5, leaf_reservoir_length=10, grace_period=200, seed=None)[source]#
Bases:
BaseStorageA Tree Storage that trains incremental decision trees for each feature.
- performances#
Dictionary of performance metrics per incremental decision tree for each feature stored.
- Type:
dict[Any, Union[R2, Accuracy]]
- data_reservoirs#
Dictionary of data reservoirs for each feature and leaf nodes.
- __call__(feature_name)[source]#
Given a feature name, returns the associated data reservoirs.
- Parameters:
feature_name (str) – The feature name for which to return the data reservoirs.
- Returns:
Tuple of data reservoir and flag if it is stored as a numerical feature or categorical.
- Return type:
- Raises:
ValueError – If feature_name is not stored as a categorical feature nor a numerical feature.
- class storage.UniformReservoirStorage(size=1000, store_targets=False)[source]#
Bases:
ReservoirStorageUniform Reservoir Storage
Summarizes a data stream by keeping track of a fixed length reservoir of observations. Each past observation of the stream has an equal probability of being in the reservoir at the current time. For more information we refer to https://en.wikipedia.org/wiki/Reservoir_sampling.
- stored_samples int
Number of samples observed in the stream.
- update(x, y=None)[source]#
Updates the reservoir with the current sample if necessary.
The update mechanism follows the optimal algorithm as stated here: https://en.wikipedia.org/wiki/Reservoir_sampling#Optimal:_Algorithm_L.
- Parameters:
x (dict) – Current observation’s features.
y (Any, optional) – Current observation’s label. Defaults to None.
Modules
This module contains base storage objects |
|
This module contains the batch storage. |
|
This module contains the GeometricReservoirStorage. |
|
This module contains the IntervalStorage |
|
This module contains the base ReservoirStorage. |
|
This module contains the TreeStorage and the MeanVarRegressor leaf classifier. |
|
This module contains the UniformReservoirStorage. |