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: * ModelSelection.java
19: * Copyright (C) 1999 University of Waikato, Hamilton, New Zealand
20: *
21: */
22:
23: package weka.classifiers.trees.j48;
24:
25: import weka.core.Instances;
26:
27: import java.io.Serializable;
28:
29: /**
30: * Abstract class for model selection criteria.
31: *
32: * @author Eibe Frank (eibe@cs.waikato.ac.nz)
33: * @version $Revision: 1.7 $
34: */
35: public abstract class ModelSelection implements Serializable {
36:
37: /** for serialization */
38: private static final long serialVersionUID = -4850147125096133642L;
39:
40: /**
41: * Selects a model for the given dataset.
42: *
43: * @exception Exception if model can't be selected
44: */
45: public abstract ClassifierSplitModel selectModel(Instances data)
46: throws Exception;
47:
48: /**
49: * Selects a model for the given train data using the given test data
50: *
51: * @exception Exception if model can't be selected
52: */
53: public ClassifierSplitModel selectModel(Instances train,
54: Instances test) throws Exception {
55:
56: throw new Exception("Model selection method not implemented");
57: }
58: }
|