Package quickml.supervised.classifier.decisionTree.tree

Examples of quickml.supervised.classifier.decisionTree.tree.Leaf


        return classifications;
    }

    @Override
    public double getProbability(AttributesMap attributes, Serializable classification) {
        Leaf leaf = node.getLeaf(attributes);
        return leaf.getProbability(classification);
    }
View Full Code Here


        return leaf.getProbability(classification);
    }

    @Override
    public PredictionMap predict(AttributesMap attributes) {
        Leaf leaf = node.getLeaf(attributes);
        Map<Serializable, Double> probsByClassification = Maps.newHashMap();
        for (Serializable classification : leaf.getClassifications()) {
            probsByClassification.put(classification, leaf.getProbability(classification));
        }
        return new PredictionMap(probsByClassification);
    }
View Full Code Here

        node.dump(appendable);
    }

    @Override
    public Serializable getClassificationByMaxProb(AttributesMap attributes) {
        Leaf leaf = node.getLeaf(attributes);
        return leaf.getBestClassification();
    }
View Full Code Here

    @Override
    public Serializable getClassificationByMaxProb(AttributesMap attributes) {
        Map<Serializable, AtomicDouble> probTotals = Maps.newHashMap();
        for (Tree tree : trees) {
            Leaf leaf =tree.node.getLeaf(attributes);
            for (Serializable classification : leaf.getClassifications()) {
                AtomicDouble ttlProb = probTotals.get(classification);
                if (ttlProb == null) {
                    ttlProb = new AtomicDouble(0);
                    probTotals.put(classification, ttlProb);
                }
                ttlProb.addAndGet(leaf.getProbability(classification));
            }
        }
        Serializable bestClassification = null;
        double bestClassificationTtlProb = 0;
        for (Map.Entry<Serializable, AtomicDouble> classificationProb : probTotals.entrySet()) {
View Full Code Here

TOP

Related Classes of quickml.supervised.classifier.decisionTree.tree.Leaf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.