TEBSTSplitter¶
Truncated E-BST.
Variation of E-BST that rounds the incoming feature values before passing them to the binary search tree (BST). By doing so, the attribute observer might reduce its processing time and memory usage since small variations in the input values will end up being mapped to the same BST node.
Parameters¶
-
digits (int) – defaults to
3
The number of decimal places used to round the input feature values.
Attributes¶
-
is_numeric
Determine whether or not the splitter works with numerical features.
-
is_target_class
Check on which kind of learning task the splitter is designed to work. If
True
, the splitter works with classification trees, otherwise it is designed for regression trees.
Methods¶
best_evaluated_split_suggestion
Get the best split suggestion given a criterion and the target's statistics.
Parameters
- criterion (river.tree._split_criterion.base_split_criterion.SplitCriterion)
- pre_split_dist (Union[List, Dict])
- att_idx (Hashable)
- binary_only (bool) – defaults to
True
Returns
SplitSuggestion: Suggestion of the best attribute split.
clone
Return a fresh estimator with the same parameters.
The clone has the same parameters but has not been updated with any data. This works by looking at the parameters from the class signature. Each parameter is either - recursively cloned if it's a River classes. - deep-copied via copy.deepcopy
if not. If the calling object is stochastic (i.e. it accepts a seed parameter) and has not been seeded, then the clone will not be idempotent. Indeed, this method's purpose if simply to return a new instance with the same input parameters.
cond_proba
Not implemented in regression splitters.
Parameters
- att_val
- target_val (Union[bool, str, int])
remove_bad_splits
Remove bad splits.
Based on FIMT-DD's [^1] procedure to remove bad split candidates from the E-BST. This mechanism is triggered every time a split attempt fails. The rationale is to remove points whose split merit is much worse than the best candidate overall (for which the growth decision already failed). Let \(m_1\) be the merit of the best split point and \(m_2\) be the merit of the second best split candidate. The ratio \(r = m_2/m_1\) along with the Hoeffding bound (\(\epsilon\)) are used to decide upon creating a split. A split occurs when \(r < 1 - \epsilon\). A split candidate, with merit \(m_i\), is considered badr if \(m_i / m_1 < r - 2\epsilon\). The rationale is the following: if the merit ratio for this point is smaller than the lower bound of \(r\), then the true merit of that split relative to the best one is small. Hence, this candidate can be safely removed. To avoid excessive and costly manipulations of the E-BST to update the stored statistics, only the nodes whose children are all bad split points are pruned, as defined in [^1].
Parameters
- criterion
- last_check_ratio (float)
- last_check_vr (float)
- last_check_e (float)
- pre_split_dist (Union[List, Dict])
update
Update statistics of this observer given an attribute value, its target value and the weight of the instance observed.
Parameters
- att_val
- target_val (Union[bool, str, int, numbers.Number])
- sample_weight (float)