Repository navigation
Extra trees classifier - #523
Conversation
- RandomForestRegressor, RandomForestClassifier and ExtraTreesRegressor: seed is now Option<u64> (search parameters: Vec<Option<u64>>). Default is None: the seed is chosen at fit time, as in the decision trees. - Each forest uses one RNG for bootstrap sampling and for the tree seeds, instead of seed + tree_idx. - Add with_seed to DecisionTreeRegressorParameters and DecisionTreeClassifierParameters. BREAKING CHANGE: the seed field type changes, and results change for the default and for a given seed.
- base_forest: forests with seeds 42 and 43 share no trees; seed None is deterministic without std_rand (equal to Some(0)) and differs between fits with std_rand. - serde round trip of the seed parameter for RandomForestClassifier and ExtraTreesRegressor. - with_seed on the decision tree parameters sets Some(seed). - Update the seed doc comments.
- Give tree and forest tests an explicit seed (Some(42) or with_seed(..)) so that they stay deterministic when std_rand is on. - Add search_parameters_with_seed test for RandomForestClassifier. - Remove comments that only repeat what the code does.
Draw seeds for trees upfront.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #523 +/- ##
===========================================
+ Coverage 43.97% 86.89% +42.91%
===========================================
Files 85 99 +14
Lines 7281 9819 +2538
===========================================
+ Hits 3202 8532 +5330
+ Misses 4079 1287 -2792 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks @slievens, this is a clean addition. It reuses Blocking
Suggested changes
Nits
Questions
Once the base branch is fixed and 2 and 3 are addressed, I am happy to approve. 4–6 can be follow-up issues. |
- partialeq adapated - extra test for bootstrap=true and sample weights added - make one test not depend on exact message
|
Points (2), (3) and (5) fixed in latest commit. |
Title: feat(ensemble): add ExtraTreesClassifier
Fixes #522
Checklist
Current behaviour
smartcore has ExtraTreesRegressor but no Extra Trees classifier.
New expected behaviour
ensemble::extra_trees_classifier::ExtraTreesClassifier is a new classifier. It uses BaseForest and BaseTree, the same code as the regressor and RandomForestClassifier.