001 package org.wdssii.decisiontree; 002 003 import java.io.Serializable; 004 005 /** 006 * Capable of classifying new data points into categories. 007 * 008 * @see org.wdssii.decisiontree.AxialDecisionTree 009 * @see org.wdssii.decisiontree.QuinlanC45AxialDecisionTreeCreator 010 * 011 * Usage: 012 * <pre> 013 float[] data = new float[numAttr]; 014 // populate array 015 .... 016 int category = tree.classify(data); 017 * </pre> 018 * 019 * @author lakshman 020 * 021 */ 022 public interface DecisionTree extends Serializable { 023 024 /** 025 * classify input data 026 * 027 * @param attributes 028 * of sample to classify 029 * @return category (0,1,2...,N-1) Will return -1 if decision tree is unable 030 * to classify data 031 */ 032 public int classify(float[] data); 033 034 /** @return a Java code version of the decision tree. */ 035 public String toJava(); 036 037 // /** @return an XML document version of the decision tree. */ 038 // public Document toXML(); 039 040 }