The Python class "MultipleClassifiersCombiner" is a wrapper for the
Weka Java class "weka.classifiers.MultipleClassifiersCombiner".
However, like the error message states, Weka's AdaBoost is not derived
from that class. Instead, it is derived, more or less, from
"SingleClassifierEnhancer".
So, if you want to boost RandomForest using AdaBoost, rather than
combining them, then your code for evaluating/building could look like
this:
import weka.core.jvm as jvm
from weka.core.classes import Random
from weka.core.converters import Loader
from weka.classifiers import Classifier, SingleClassifierEnhancer, Evaluation
# data to use
data_ready = ... # from somewhere
# Adaboost + Random Forest.
print("AdaBoost + RandomForest.")
print("--> Cross-validation")
forest = Classifier(classname="weka.classifiers.trees.RandomForest",
options=["-I", "100", "-K", "0", "-S", "1"])
adaboost = SingleClassifierEnhancer(classname="weka.classifiers.meta.AdaBoostM1",
options=["-P", "100", "-S", "1", "-I", "10"])
adaboost.classifier = forest # set the classifier to boost
# if you want 10-fold cross-validation
evl = Evaluation(data_ready)
evl.crossvalidate_model(adaboost, data_ready, 10, Random(1))
print(evl.summary())
# if you want to just build AdaBoost/RandomForest
print("--> Adaboost model")
adaboost.build_classifier(data_ready)
print(adaboost)
HTH
Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/