本文整理汇总了Java中weka.classifiers.functions.SMO.setBuildLogisticModels方法的典型用法代码示例。如果您正苦于以下问题:Java SMO.setBuildLogisticModels方法的具体用法?Java SMO.setBuildLogisticModels怎么用?Java SMO.setBuildLogisticModels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类weka.classifiers.functions.SMO
的用法示例。
在下文中一共展示了SMO.setBuildLogisticModels方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDeepML
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
public void testDeepML() {
System.out.println("Test Stacked Boltzmann Machines with an off-the-shelf multi-label classifier");
DeepML dbn = new DeepML();
MCC h = new MCC();
SMO smo = new SMO();
smo.setBuildLogisticModels(true);
h.setClassifier(smo);
dbn.setClassifier(h);
dbn.setE(100);
dbn.setH(30);
Result r = EvaluationTests.cvEvaluateClassifier(dbn);
System.out.println("DeepML + MCC" + r.info.get("Accuracy"));
String s = r.info.get("Accuracy");
assertTrue("DeepML+MCC Accuracy Correct", s.startsWith("0.53")); // Good enough
}
示例2: testMCC
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
public void testMCC() {
// Test MCC (with SMO -- -M)
System.out.println("Test MCC");
MCC h = new MCC();
SMO smo = new SMO();
smo.setBuildLogisticModels(true);
h.setClassifier(smo);
Result r = EvaluationTests.cvEvaluateClassifier(h);
assertTrue("MCC Accuracy Correct", r.info.get("Accuracy").equals("0.561 +/- 0.035") );
}
示例3: testPMCC
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
public void testPMCC() {
// Test MCC (with SMO -- -M)
System.out.println("Test PMCC");
PMCC h = new PMCC();
h.setM(10);
h.setChainIterations(50);
h.setInferenceInterations(20);
SMO smo = new SMO();
smo.setBuildLogisticModels(true);
h.setClassifier(smo);
Result r = EvaluationTests.cvEvaluateClassifier(h);
assertTrue("PMCC Accuracy Correct", r.info.get("Accuracy").equals("0.587 +/- 0.035") );
}
示例4: testPCC
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
public void testPCC() {
// Test PCC (with SMO -- -M)
System.out.println("Test PCC");
PCC h = new PCC();
SMO smo = new SMO();
smo.setBuildLogisticModels(true);
h.setClassifier(smo);
Result r = EvaluationTests.cvEvaluateClassifier(h);
assertTrue("PCC Accuracy Correct", r.info.get("Accuracy").equals("0.565 +/- 0.032") );
}
示例5: testCT
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
public void testCT() {
// Test CT (with SMO -- -M)
System.out.println("Test CT");
CT h = new CT();
SMO smo = new SMO();
smo.setBuildLogisticModels(true);
h.setClassifier(smo);
h.setInferenceInterations(10);
h.setChainIterations(10);
Result r = EvaluationTests.cvEvaluateClassifier(h);
//System.out.println("CT ACC: "+r.info.get("Accuracy"));
assertTrue("CT Accuracy Correct", r.info.get("Accuracy").equals("0.56 +/- 0.034") );
}
示例6: testCDT
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
public void testCDT() {
// Test CDT (with SMO -- -M)
System.out.println("Test CDT");
CDT h = new CDT();
SMO smo = new SMO();
smo.setBuildLogisticModels(true);
h.setClassifier(smo);
Result r = EvaluationTests.cvEvaluateClassifier(h);
//System.out.println("CDT ACC: "+r.info.get("Accuracy"));
assertTrue("CDT Accuracy Correct", r.info.get("Accuracy").equals("0.519 +/- 0.039") );
}
示例7: buildClassifier
import weka.classifiers.functions.SMO; //导入方法依赖的package包/类
private Classifier buildClassifier(Instances trainingInstancesSet) throws Exception {
MultiFilter graphemesFilter = this.initializeFiltersForGraphemes(trainingInstancesSet);
FilteredClassifier filteredClassifier = new FilteredClassifier();
filteredClassifier.setFilter(graphemesFilter);
// SVM
//
SMO svm = new SMO();
svm.setBuildLogisticModels(true);
// // PolyKernel polyKernel = new PolyKernel();
// // polyKernel.setExponent(2);
// svm.setKernel(polyKernel);
filteredClassifier.setClassifier(svm);
// Naive Bayes
//
// filteredClassifier.setClassifier(new NaiveBayes());
// Select 50 most informative attributes, after this - SVM
//
// AttributeSelectedClassifier attributeSelectionClassifier = new
// AttributeSelectedClassifier();
// attributeSelectionClassifier.setEvaluator(new
// InfoGainAttributeEval());
// Ranker ranker = new Ranker();
// ranker.setNumToSelect(50);
// attributeSelectionClassifier.setSearch(ranker);
// attributeSelectionClassifier.setClassifier(filteredClassifier);
// attributeSelectionClassifier.setClassifier(svm);
// filteredClassifier.setClassifier(attributeSelectionClassifier);
filteredClassifier.buildClassifier(trainingInstancesSet);
return filteredClassifier;
}