本文整理汇总了Java中weka.classifiers.trees.REPTree类的典型用法代码示例。如果您正苦于以下问题:Java REPTree类的具体用法?Java REPTree怎么用?Java REPTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
REPTree类属于weka.classifiers.trees包,在下文中一共展示了REPTree类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClassifier
import weka.classifiers.trees.REPTree; //导入依赖的package包/类
/**
* Returns a new classifier based on the given algorithm.
*/
protected weka.classifiers.Classifier getClassifier(
EClassificationAlgorithm algorithm) {
switch (algorithm) {
case DECISION_TREE_REP:
return new REPTree();
case SUPPORT_VECTOR_MACHINE_SMO:
return new SMO();
case COST_SENSITIVE_CLASSIFIER:
return new CostSensitiveClassifier();
case DECISION_TREE_J48:
return new J48();
default:
throw new AssertionError(
"Cannot create a classifier without a specified algorithm.");
}
}
示例2: trainNoCrossStackingModel
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);
}