001 /** 002 * 003 */ 004 package org.wdssii.decisiontree; 005 006 /** 007 * 008 * The learning algorithm for a decision tree. Create an instance of this class 009 * and call the learn() method 010 * 011 * @author lakshman 012 * 013 */ 014 public interface DecisionTreeCreator { 015 016 @SuppressWarnings("serial") 017 public static class TreeCreationException extends RuntimeException { 018 TreeCreationException(String cause) { 019 super(cause); 020 } 021 } 022 023 /** 024 * @param inputData 025 * an array where each row corresponds to a single instance (to 026 * be classified) and the columns hold the attributes of that 027 * instance 028 * @param targetClass 029 * an array where each row corresponds to a single instance, 030 * specifically the actual classification of that instance. The 031 * class needs to be a number 0,1,2,...,N-1 where N is the number 032 * of classes. Some of these classes may have no examples. 033 * @return decisiontree 034 */ 035 DecisionTree learn(float[][] inputData, int[] targetClass) 036 throws TreeCreationException, IllegalArgumentException; 037 038 }