Skip to content

Epic: Ensemble completeness — ExtraTrees classifier, sample weights, forest feature importance #451

Open

Description

@Mec-iS

Tracking issue for ensemble work that shares one design surface (base_forest_*, tree internals). Do not start code before an RFC is agreed here.

Member issues

Why grouped

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.
  • Classifier parity work (feature request: extra-trees classifier and regressor #183) should land after weights/importances so the new class uses them from day one.

Constraints (repo conventions)

  • Pure Rust, no macros; zero-copy data access via iterator(...) / view traits.
  • Numeric logic on numbers/ traits only.
  • Serde: parameter defaults must match Default::default() (see Serde JSON defaults don't match Default::default() #175 lessons).
  • Doctests + mod tests {} per module.

RFC requirements

Post a short RFC comment before any PR: API sketch, trait bounds, serde story, no_std impact for v0.7.

Acceptance criteria

  • RFC agreed by a maintainer
  • Members implemented or explicitly descoped
  • CHANGELOG updated

Activity

  1. added this to the v0.7+ milestone on Aug 25, 2026
  2. added
    epicTracking issue grouping related large work
    rfc-neededRequires an agreed API/design sketch before code
    on Aug 25, 2026
  3. slievens commented on Sep 26, 2026

    @slievens
    Contributor

    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.

  4. Mec-iS commented on Sep 26, 2026

    @Mec-iS
    CollaboratorAuthor

    ok. adding a public method is not a breaking change.

    Open PR with what you want to add I will check it

  5. slievens commented on Sep 26, 2026

    @slievens
    Contributor

    PR #467 created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicTracking issue grouping related large workrfc-neededRequires an agreed API/design sketch before code

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions