Ensembles
Heterogeneous Leveraging Bagging Classifier

HeteroLeveragingBaggingClassifier

Similar to LeveragingBaggingClassifier, but instead of multiple copies of the same model, it can work with different base models.

Parameters

  • base_models(list[Model]) → The list of classifier models.

  • n_classes(int) → The number of classes for the classifier.

  • w(float, Default:6) → Indicates the average number of events. This is the lambda parameter of the Poisson distribution used to compute the re-sampling weight.

  • bagging_method(str, Default:bag) → The bagging method to use. Can be one of the following:

    • bag - Leveraging Bagging using ADWIN.
    • me - Assigns if sample is misclassified, otherwise.
    • half - Use resampling without replacement for half of the instances.
    • wt - Resample without taking out all instances.
    • subag - Resampling without replacement.
  • seed(int | None, Default:None) → Random number generator seed for reproducibility.

Example Usage

We can create an instance and deploy LBC model like this.

import turboml as tb
model = tb.HeteroLeveragingBaggingClassifier(n_classes=2, base_models = [tb.HoeffdingTreeClassifier(n_classes=2), tb.AMFClassifier(n_classes=2)])