storage.tree_storage#
This module contains the TreeStorage and the MeanVarRegressor leaf classifier.
Functions
|
|
|
Traverses a decision tree given a data point, and a starting node. |
Classes
A simple regressor model intended to be used as a leaf model in Decision Tree Regressors. |
|
|
A Tree Storage that trains incremental decision trees for each feature. |
- class storage.tree_storage.MeanVarRegressor[source]#
Bases:
RegressorA simple regressor model intended to be used as a leaf model in Decision Tree Regressors.
The Regressor keeps track of the mean and standard deviation of the incoming numerical labels and samples prediction values from a normal distribution according to the current mean and standard deviation.
- class storage.tree_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.