import weka.classifiers.trees.REPTree; //导入依赖的package包/类
public static Classifier trainNoCrossStackingModel(Instances dataSet) throws Exception {
Classifier meta =
// new NaiveBayes();
// new RandomTree();
new REPTree();
// new J48();
// new REPTree();
// meta.setOptions(new String[]{"-S", "58653980"});
// Classifier[] bases = {
// loadModel("article_1.5M"),
// loadModel("buddhism_1.4M"),
// loadModel("encyclopedia_1.4M"),
// loadModel("law_1.4M"),
// loadModel("news_1.3M"),
// loadModel("novel_1.4M"),
// loadModel("talk_1"),
// loadModel("wiki_1.5M"),
// };
// Classifier[] bases = {
// loadModel("article_fold_1_of_3"),
// loadModel("article_fold_2_of_3"),
// // loadModel("article_fold_3_of_3"),
// loadModel("buddhism_fold_1_of_2"),
// loadModel("buddhism_fold_2_of_2"),
// loadModel("encyclopedia_fold_1_of_3"),
// loadModel("encyclopedia_fold_2_of_3"),
// // loadModel("encyclopedia_fold_3_of_3"),
// loadModel("law_fold_1_of_2"),
// loadModel("law_fold_2_of_2"),
// loadModel("news_fold_1_of_5"),
// loadModel("news_fold_2_of_5"),
// // loadModel("news_fold_3_of_5"),
// // loadModel("news_fold_4_of_5"),
// // loadModel("news_fold_5_of_5"),
// loadModel("novel_fold_1_of_4"),
// loadModel("novel_fold_2_of_4"),
// // loadModel("novel_fold_3_of_4"),
// // loadModel("novel_fold_4_of_4"),
// loadModel("talk_fold_1_of_1"),
// loadModel("wiki_fold_1_of_2"),
// loadModel("wiki_fold_2_of_2"),};
Classifier[] bases = {
loadModel("article"),
loadModel("buddhism"),
loadModel("encyclopedia"),
loadModel("law"),
loadModel("news"),
loadModel("novel"),
loadModel("talk"),
loadModel("wiki")
};
return trainNoCrossStackingModel(meta, bases, dataSet);
}
请发表评论