Skip to content

extratrees: Learning decision tree ensembles#45

Merged
jonnor merged 17 commits intomasterfrom
extratrees
May 2, 2026
Merged

extratrees: Learning decision tree ensembles#45
jonnor merged 17 commits intomasterfrom
extratrees

Conversation

@jonnor
Copy link
Copy Markdown
Contributor

@jonnor jonnor commented Jul 8, 2025

Here is an initial proof of concept that appears to be working on a few datasets. For 6k samples dataset and 5 trees, training times in order of 15-60 seconds on ESP32-S3. The subsampling factor influences this a lot.
The code needs a proper review and probably some cleaning, and then more testing. Doing some basic profiling would also be useful.

The constructor needs a keyword argument variant, to make code more sane. Right now there are like 11 positional args...

@jonnor
Copy link
Copy Markdown
Contributor Author

jonnor commented Jul 13, 2025

Other things that need fixing

  • Remove 256 large stack allocations for left/right
  • Add a way to monitor the training process. Probably on a per-tree level. Need a train_step type C function. Maybe a generator on Python side, as a convenience function
  • Fix hardcoded stack_size
  • Actually use randomized threshold selection. Right now there is logic more akin to RandomTrees, but with hardcoded 50 unique values (seemingly computed without random sampling). Goes through all samples - probably a major speedup if/when fixed.
  • Missing check on n_samples wrt max_samples in train
  • References to sample indices should be uint16_t, not int16_t
  • Types for general integers should be int, not int16_t
  • Test that the random number generator works reasonably

@jonnor jonnor merged commit 5ff322f into master May 2, 2026
18 checks passed
@jonnor jonnor deleted the extratrees branch May 2, 2026 13:27
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.

1 participant