Skip to content

v0.7 Release - #504

Merged
Mec-iS merged 27 commits into
mainfrom
v0.7-release
Oct 24, 2026
Merged

Mec-iS merged 27 commits into
mainfrom
v0.7-release

Conversation

@Mec-iS

@Mec-iS Mec-iS commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

What

Integration PR for the v0.7 release candidate. It merges the outstanding v0.7-labelled PRs into one owned branch so the conflicts between them are resolved once, in one place:

PR Change Author
#480 lazy normalization for Lasso and Elastic Net @jolars
#492 MSE criterion in base tree regressor @slievens
#497 feature importances for regression trees/forests @slievens
#502 generic BaseTree/BaseForest over criterion and leaf output @slievens

Also includes: ndarray requirement bumped to 0.17.2, and all unreleased changes consolidated under a [v0.7] section in CHANGELOG.md (the current release candidate), with an empty [Unreleased] above it.

Already merged to main separately: #503 (docs), #490 (cargo-deny/audit CI), #472 (ndarray conditional std).

Conflict resolutions

Verification

  • cargo test --all-features --release: 674 passed, 0 failed (+ doctests and integration suites green)
  • cargo fmt --all -- --check and cargo clippy --all-features -- -Drust-2018-idioms -Drust-2024-compatibility -Dwarnings pass (pre-commit)

After merge

#480, #492, #497 and #502 will be closed as superseded by this PR; their commits keep the original authorship via rebase merge.

jolars and others added 27 commits October 12, 2026 09:46
This is the first step in making base tree "regressor" be used by all the
tree classifiers. Next step is to make the implementation generic over the
used Criterion with callers deciding it.

Add a Criterion trait with MSE and Gini implementations in
src/tree/criterion.rs. Use MeanStats in BaseTreeRegressor in place of
explicit sum/mass bookkeeping.

- Store node stats in NodeVisitor; remove true/false_child_output
- Keep scratch stats in SplitWorkspace to avoid new allocations
- Rank splits by proxy improvement; store the real impurity
  improvement in split_score
- Pass the sample count to find_best_cutoff and check
  min_samples_split at the caller
Make sure no leaf has a split_core.
Add tests to check this.

Also check that no "proxy" values are leftover by verifying that
the sum of all split_scores adds up to the total impurity decrease.
- Compute the MSE improvement as (S_T·M_F − S_F·M_T)² / (M_T·M_F·M_P).
  This prevents cancellation for targets with a large offset.
- Remove rows with mass 0 in grow(). Zero-weight rows no longer count
  toward min_samples_leaf/min_samples_split and do not move thresholds.
- Remove the MASS_EPS clamp from difference().
- In split(), add the false side directly instead of parent − true.
- Add tests for target-offset invariance and zero-weight rows.
Add compute_feature_importances (mean decrease in impurity, as in
scikit-learn) to DecisionTreeRegressor, RandomForestRegressor and
ExtraTreesRegressor. The forests normalize the importances of each
tree, take the mean and normalize again.

The fitted models store new fields (root_mass, num_features), so
models serialized with an earlier version do not deserialize.
BaseTree only finds the leaf. DecisionTreeRegressor and
BaseForestRegressor convert the leaf output to TY.
The forest passes a Criterion to its trees. The predict methods
are restricted to Output = f64. The RF and ET regressors use MSECriterion.
BaseForest only gives access to its trees and samples. The mean of
the tree predictions is in predict_mean and predict_mean_oob.
BaseTree and BaseForest do not store the criterion. Only the type of
the leaf value is kept in the tree. Make the types generic over this
output type and move the Criterion type parameter to the fit functions.

Move output_approximate_eq from Criterion to a new LeafOutput trait
on the output type.
@Mec-iS
Mec-iS merged commit cd217dd into main Oct 24, 2026
11 of 18 checks passed
@Mec-iS

Mec-iS commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

These changes are merged into the v0.7 release candidate on main (commit cd217dd). The candidate is undergoing benchmark tests in smartcore-benches run 40066233708; a measurement report will follow.

@jolars

jolars commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Nice! Thanks for considering and adopting lazymatrix! Please let me know if you find any issues or have any feature requests for new functionality in lazymatrix.

@Mec-iS

Mec-iS commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Mec-iS The v0.7 candidate benchmark report is published: #506 — regression-tree fit instructions +4–6% (gate: 4%), everything else flat. The issue lists the suggested corrections and the revert fallback.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants