Ensemble Learning
Explore ensemble learning algorithms in JavaScript and TypeScript with @kanaries/ml, including Isolation Forest, AdaBoost, random forests, and bagging models.
Module overview
The Ensemble module combines multiple weak learners to create stronger models for anomaly detection, classification, and regression. These algorithms are useful when single-model baselines are close to useful but need more robustness or more expressive decision behavior.
This module is a strong fit when:
- you need anomaly detection on tabular product or telemetry data
- a simple classifier or regressor underfits important patterns
- you want stronger performance without moving all the way to heavier model families
JavaScript implementation
@kanaries/ml provides ensemble models in JavaScript and TypeScript so teams can run boosted learners and anomaly detection inside browser products and Node.js services. This is particularly helpful when feature generation, threshold logic, and downstream product actions already live in JS and should stay close to the model runtime.
If someone searches for "Isolation Forest in JavaScript" or "AdaBoost in TypeScript", this module is the right entry point.
Quick navigation
- Isolation Forest: anomaly detection for mostly-normal datasets with rare outliers
- RandomForestClassifier: majority-vote tree ensembles for classification
- RandomForestRegressor: averaged tree ensembles for regression
- BaggingClassifier: bootstrap classifier ensembles with default or custom estimators
- AdaBoost Regressor: boosted regression for non-linear tabular prediction
- AdaBoost Classifier: boosted classification for harder decision boundaries
- GradientBoostingRegressor: squared-error gradient boosting for tabular regression
- GradientBoostingClassifier: log-loss gradient boosting for binary and multiclass classification
- XGBoostRegressor: exact-greedy, regularized XGBoost regression
- XGBoostClassifier: exact-greedy, regularized XGBoost classification (binary and multiclass)
Detailed module guide
How to choose an algorithm
- Use Isolation Forest when labels are unavailable and the main goal is outlier detection.
- Use RandomForestClassifier or RandomForestRegressor when tree variance is high and nonlinear patterns matter.
- Use BaggingClassifier when you want bootstrap aggregation around decision trees or a custom classifier.
- Use AdaBoost Classifier when a simple classifier misses hard examples.
- Use AdaBoost Regressor when a single regressor is too weak for the target pattern.
- Use GradientBoostingClassifier or GradientBoostingRegressor when you want stage-wise boosting with fine control over shrinkage and depth.
- Use XGBoostClassifier or XGBoostRegressor when you want regularized, exact-greedy boosting close to the
xgboostlibrary.
JavaScript deployment notes
- Treat thresholds, estimator counts, and learning rates as product-level tuning decisions.
- Ensemble models often provide a good middle ground between simple baselines and more operationally complex systems.
- In JS applications, keep feature extraction and prediction close together so model output can flow directly into business logic.
Extra Tree Regressor
Learn what Extra Tree Regressor does, when to use it, and how to run ExtraTreeRegressor in JavaScript or TypeScript with @kanaries/ml for browser and Node.js applications.
Isolation Forest
Learn what Isolation Forest does, when to use it, and how to run IsolationForest in JavaScript or TypeScript with @kanaries/ml for browser and Node.js applications.