@kanaries/ml
API Reference/Ensemble

ExtraTreesRegressor

Train extremely randomized regression trees in JavaScript or TypeScript with ExtraTreesRegressor from @kanaries/ml for browser and Node.js.

View as Markdown

Algorithm overview

ExtraTreesRegressor averages many highly randomized regression trees. Random thresholds diversify members, and averaging turns their piecewise predictions into a lower-variance ensemble.

JavaScript implementation

Ensemble.ExtraTreesRegressor uses the shared forest runtime in @kanaries/ml, works in browsers and Node.js, supports seeded training, and exposes averaged feature importances.

Interactive Extra Trees regression playground

Adjust the number of randomized trees, reroll the sample, or add a point. The displayed prediction is fitted live with Ensemble.ExtraTreesRegressor in your browser.

Live browser model

ExtraTreesRegressor playground

Adjust the data and model, then click the chart to add a training observation.

Fitted with @kanaries/ml
-3-2-10123-1.9-0.90.01.01.9feature xtarget y
prediction training holdout your points
Train RMSE0.137
Holdout RMSE0.373
Holdout R²0.307
Custom points0

Quick start example

import { Ensemble } from '@kanaries/ml';
const model = new Ensemble.ExtraTreesRegressor({ nEstimators: 100, max_features: 'all', randomState: 42 });
model.fit([[0], [1], [2], [3], [4]], [0, 1, 4, 9, 16]);
console.log(model.predict([[2.5]]), model.featureImportances);

Detailed API reference

Options include nEstimators?, bootstrap?, randomState?, max_features?, and ExtraTreeRegressor depth/split options. Methods are fit(X, y) and predict(X); featureImportances is available after fitting.