Code example for Logger

Methods: fine, finest

0
     * required. 
     */ 
    public Classification classify ( Instance inst )
    { 
        Node node = __root;
        log.finest ("classify(): classifying instance " + inst.toString());
 
        while ( ! node.isLeaf () )
        {             
            log.finest ("classify(): visitng node " + node.toString());
            Attribute attr = inst.getAttribute (node.getKey());    
            log.finest ("classify(): examining attribute " + attr.toString());        
            Node child = node.getChild (attr.getValue());
 
            // No path defined for this instance, use default 
            // classification for this subtree. 
            if ( child == null )
            { 
                log.finest ("No path defined for this instance. Using intermediate Naive Bayes classifier.");
                break; 
            } 
            else 
            { 
                // Remove the attribute from the instance as we advance down the tree. 
                log.finest ("classify(): removing attribute from instance " + node.getKey());
                inst.removeAttribute (node.getKey());
                node = child;
            } 
        } 
         
        Classification classification = node.getNaiveBayesClassifier().classify (inst);
        log.fine (String.format ("classify(): classified instance %s as %s", 
                                 inst.toString(), classification.toString()));
        return classification;
    } 
}