@kanaries/ml

AdaBoostRegressor

API reference for AdaBoostRegressor

Ensemble.AdaBoostRegressor

constructor(props?: { estimator?: DecisionTreeRegressor; n_estimators?: number; learning_rate?: number })

Parameters

nametypedefaultdescription
estimatorDecisionTreeRegressordepth 3 treeBase learner used in boosting
n_estimatorsnumber50Number of boosting rounds
learning_ratenumber1.0Shrinks the contribution of each regressor

Algorithm

AdaBoostRegressor combines weak regressors sequentially. Each new estimator focuses on samples that previous models predicted poorly.

Methods

  • fit(trainX: number[][], trainY: number[]): void
  • predict(testX: number[][]): number[]

Example

const regr = new AdaBoostRegressor({ n_estimators: 100 });
regr.fit(X, y);
const pred = regr.predict([[0, 0, 0, 0]]);