List of usage examples for weka.classifiers.trees HoeffdingTree distributionForInstance
@Override public double[] distributionForInstance(Instance inst) throws Exception
From source file:fcul.viegas.ml.learners.NetworkStreamLearningClassifierMapFunction.java
public InstanceStreamDTO map(InstanceStreamDTO instance) throws Exception { weka.core.Instance inst = instance.getInstance(); inst.setDataset(this.coreInstances); inst.setClassValue(inst.classValue()); inst = classifier.constructMappedInstance(inst); HoeffdingTree tree = (HoeffdingTree) classifier.getClassifier(); double[] classe = tree.distributionForInstance(inst); instance.setInstance(null);// w w w . j a v a 2 s . c o m //System.out.println("\t classe[0]: " + classe[0] + " classe[1]: " + classe[1]); if (classe[0] > classe[1]) { instance.setAssignedClassValueFromLearner(0.0d); } else { instance.setAssignedClassValueFromLearner(1.0d); } return instance; }