private Node getLeaf (Node node, FeatureVector fv) { if (node.getLeftChild() == null && node.getRightChild() == null) return node; else if (fv.value(node.getGainRatio().getMaxValuedIndex()) <= node.getGainRatio().getMaxValuedThreshold()) return getLeaf(node.getLeftChild(), fv); else return getLeaf(node.getRightChild(), fv); }
private Node getLeaf (Node node, FeatureVector fv) { if (node.getLeftChild() == null && node.getRightChild() == null) return node; else if (fv.value(node.getGainRatio().getMaxValuedIndex()) <= node.getGainRatio().getMaxValuedThreshold()) return getLeaf(node.getLeftChild(), fv); else return getLeaf(node.getRightChild(), fv); }
private Node getLeaf (Node node, FeatureVector fv) { if (node.getLeftChild() == null && node.getRightChild() == null) return node; else if (fv.value(node.getGainRatio().getMaxValuedIndex()) <= node.getGainRatio().getMaxValuedThreshold()) return getLeaf(node.getLeftChild(), fv); else return getLeaf(node.getRightChild(), fv); }
public Classification classify (Instance instance) { FeatureVector fv = (FeatureVector) instance.getData (); assert (instancePipe == null || fv.getAlphabet () == this.instancePipe.getDataAlphabet ()); Node leaf = getLeaf(m_root, fv); return new Classification (instance, this, leaf.getGainRatio().getBaseLabelDistribution()); }
public Classification classify (Instance instance) { FeatureVector fv = (FeatureVector) instance.getData (); assert (instancePipe == null || fv.getAlphabet () == this.instancePipe.getDataAlphabet ()); Node leaf = getLeaf(m_root, fv); return new Classification (instance, this, leaf.getGainRatio().getBaseLabelDistribution()); }
public Classification classify (Instance instance) { FeatureVector fv = (FeatureVector) instance.getData (); assert (instancePipe == null || fv.getAlphabet () == this.instancePipe.getDataAlphabet ()); Node leaf = getLeaf(m_root, fv); return new Classification (instance, this, leaf.getGainRatio().getBaseLabelDistribution()); }