You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All three touch the shared forest base and tree split logic. One design pass avoids three colliding PRs:
Sample weights must flow through bootstrap sampling and split-criterion weighting.
Forest-level importances should reuse DecisionTreeClassifier::compute_feature_importances (src/tree/decision_tree_classifier.rs) and add the missing regressor-tree variant.
I made an implementation that added "sample_weights" on the regressors, mainly to actually test whether it works.
You can find it here.
Basically, it changes the public API as follows.
fit stays as it was.
fit_with_weigths is added.
Private API changed in some places to incorporate sample weights.
The implementation introduces minimal overhead in the case of "no weights" (i.e. no weights are created in this case).
I think the other case works correctly, as verified by a number of test cases.
No new serializable parameters are introduced to serde is not an issue.
Please tell me what I need to change, if anything.
Once this is agreed, I can do a similar implementation with the same API for the classifiers, and add the ExtraTreesClassifier similar to ExtraTreesRegressor.
Activity
slievens commentedon Sep 26, 2026
I made an implementation that added "sample_weights" on the regressors, mainly to actually test whether it works.
You can find it here.
Basically, it changes the public API as follows.
fitstays as it was.fit_with_weigthsis added.Private API changed in some places to incorporate sample weights.
The implementation introduces minimal overhead in the case of "no weights" (i.e. no weights are created in this case).
I think the other case works correctly, as verified by a number of test cases.
No new serializable parameters are introduced to serde is not an issue.
Please tell me what I need to change, if anything.
Once this is agreed, I can do a similar implementation with the same API for the classifiers, and add the
ExtraTreesClassifiersimilar toExtraTreesRegressor.Mec-iS commentedon Sep 26, 2026
ok. adding a public method is not a breaking change.
Open PR with what you want to add I will check it
slievens commentedon Sep 26, 2026
PR #467 created.