Skip to main content

Stacking

Stacking (Stacked Generalization) is a meta-algorithm introduced by David H. Wolpert [1] that involves training a learning algorithm to combine the predictions of several other learning algorithms.

Parameters

The parameters available for Stacking are related to the base and stack learner.

import org.apache.spark.ml.classification.{StackingClassifier, RandomForestClassifier, DecisionTreeClassifier}

new StackingClassifier()
.setBaseLearners(Array(new DecisionTreeClassifier(), new RandomForestClassifier())) //Base learners used by the meta-estimator.
.setStackMethod("proba") //Methods called for each base learner, only for classification.
.setStacker(new DecisionTreeClassifier()) //Learner that will combine the predictions of base learners.
.setParallelism(4) //Number of base learners trained simultaneously.

References

  • [1] David H. Wolpert (1992) Stacked Generalization