Tree Models
Explore decision trees and extra trees in JavaScript and TypeScript with @kanaries/ml for interpretable tabular classification and regression.
View as MarkdownModule overview
The Tree module provides interpretable tree-based models for tabular classification and regression. These algorithms are useful when you want rule-like behavior, easy debugging, and models whose decisions can be traced through human-readable splits.
This module is a strong fit when:
- explainability matters alongside predictive quality
- tabular data contains non-linear feature interactions
- you want to compare standard tree behavior with more randomized extra tree variants
JavaScript implementation
@kanaries/ml provides tree models in JavaScript and TypeScript so teams can keep interpretable prediction logic close to product code, browser demos, and Node.js APIs. This is especially useful when engineers or stakeholders need to inspect why a model made a decision, not just what it predicted.
If someone searches for "decision tree in JavaScript" or "extra tree classifier in TypeScript", this module is the right entry point.
Interactive tree model playground
Change the dataset, depth, split constraint, and impurity criterion to see how a JavaScript decision tree partitions feature space. Click the chart to add an observation and refit Tree.DecisionTreeClassifier immediately.
Learn DecisionTreeClassifier by changing it
Tune the tree and watch each split carve a new rectangle into feature space. Click the plot to add your own observation and refit instantly.
Tree.DecisionTreeClassifierQuick navigation
Detailed module guide
How to choose an algorithm
- Use decision tree variants when interpretability and clear decision paths matter most.
- Use extra tree variants when you want a more randomized tree baseline.
- Control depth and split settings carefully because tree models can overfit quickly on smaller datasets.
JavaScript deployment notes
- Tree models are especially practical in product code because their behavior is straightforward to inspect.
- Use them as strong tabular baselines before moving to boosted ensembles or kernel methods.
- Keep model constraints simple and explicit so debugging remains easy.
Poisson, Gamma, and Tweedie Regression
Model counts and positive skewed targets with PoissonRegressor, GammaRegressor, and TweedieRegressor in browser or Node.js.
Decision Tree Classifier
Learn what Decision Tree Classifier does, when to use it, and how to run DecisionTreeClassifier in JavaScript or TypeScript with @kanaries/ml for browser and Node.js applications.