01: /*
02: * This program is free software; you can redistribute it and/or modify
03: * it under the terms of the GNU General Public License as published by
04: * the Free Software Foundation; either version 2 of the License, or
05: * (at your option) any later version.
06: *
07: * This program is distributed in the hope that it will be useful,
08: * but WITHOUT ANY WARRANTY; without even the implied warranty of
09: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10: * GNU General Public License for more details.
11: *
12: * You should have received a copy of the GNU General Public License
13: * along with this program; if not, write to the Free Software
14: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15: */
16:
17: /*
18: * SplitEvaluate.java
19: * Copyright (C) 2000 University of Waikato, Hamilton, New Zealand
20: *
21: */
22:
23: package weka.classifiers.trees.m5;
24:
25: import java.io.*;
26: import java.util.*;
27: import weka.core.*;
28:
29: /**
30: * Interface for objects that determine a split point on an attribute
31: *
32: * @author Mark Hall (mhall@cs.waikato.ac.nz)
33: * @version $Revision: 1.2 $
34: */
35: public interface SplitEvaluate {
36:
37: /**
38: * makes a copy of the SplitEvaluate object
39: * @return a copy of the object
40: */
41: SplitEvaluate copy() throws Exception;
42:
43: /**
44: * Finds the best splitting point for an attribute in the instances
45: * @param attr the splitting attribute
46: * @param inst the instances
47: * @exception Exception if something goes wrong
48: */
49: void attrSplit(int attr, Instances inst) throws Exception;
50:
51: /**
52: * Returns the impurity of this split
53: *
54: * @return the impurity of this split
55: */
56: double maxImpurity();
57:
58: /**
59: * Returns the position of the split in the sorted values. -1 indicates that
60: * a split could not be found.
61: *
62: * @return an <code>int</code> value
63: */
64: int position();
65:
66: /**
67: * Returns the attribute used in this split
68: *
69: * @return the attribute used in this split
70: */
71: int splitAttr();
72:
73: /**
74: * Returns the split value
75: *
76: * @return the split value
77: */
78: double splitValue();
79:
80: }
|