[4] | 1 | /* |
---|
| 2 | * This program is free software; you can redistribute it and/or modify |
---|
| 3 | * it under the terms of the GNU General Public License as published by |
---|
| 4 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 5 | * (at your option) any later version. |
---|
| 6 | * |
---|
| 7 | * This program is distributed in the hope that it will be useful, |
---|
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 9 | * 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 | * Copyright 2002-2006 University of Waikato |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | package weka.classifiers.meta; |
---|
| 22 | |
---|
| 23 | import weka.classifiers.AbstractClassifierTest; |
---|
| 24 | import weka.classifiers.Classifier; |
---|
| 25 | import weka.core.CheckOptionHandler; |
---|
| 26 | |
---|
| 27 | import junit.framework.Test; |
---|
| 28 | import junit.framework.TestSuite; |
---|
| 29 | |
---|
| 30 | /** |
---|
| 31 | * Tests AttributeSelectedClassifier. Run from the command line with:<p> |
---|
| 32 | * java weka.classifiers.meta.AttributeSelectedClassifierTest |
---|
| 33 | * |
---|
| 34 | * @author <a href="mailto:eibe@cs.waikato.ac.nz">Eibe Frank</a> |
---|
| 35 | * @author FracPete (fracpete at waikato dot ac dot nz) |
---|
| 36 | * @version $Revision: 1.2 $ |
---|
| 37 | */ |
---|
| 38 | public class AttributeSelectedClassifierTest |
---|
| 39 | extends AbstractClassifierTest { |
---|
| 40 | |
---|
| 41 | public AttributeSelectedClassifierTest(String name) { |
---|
| 42 | super(name); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | /** Creates a default AttributeSelectedClassifier */ |
---|
| 46 | public Classifier getClassifier() { |
---|
| 47 | return new AttributeSelectedClassifier(); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | /** |
---|
| 51 | * Configures the CheckOptionHandler uses for testing the optionhandling. |
---|
| 52 | * Sets the classifier return from the getClassifier() method. |
---|
| 53 | * |
---|
| 54 | * @return the fully configured CheckOptionHandler |
---|
| 55 | * @see #getClassifier() |
---|
| 56 | */ |
---|
| 57 | protected CheckOptionHandler getOptionTester() { |
---|
| 58 | CheckOptionHandler result; |
---|
| 59 | |
---|
| 60 | result = super.getOptionTester(); |
---|
| 61 | result.setUserOptions(new String[]{ |
---|
| 62 | "-E", |
---|
| 63 | "weka.attributeSelection.CfsSubsetEval", |
---|
| 64 | "-S", |
---|
| 65 | "weka.attributeSelection.BestFirst"}); |
---|
| 66 | |
---|
| 67 | return result; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | public static Test suite() { |
---|
| 71 | return new TestSuite(AttributeSelectedClassifierTest.class); |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | public static void main(String[] args){ |
---|
| 75 | junit.textui.TestRunner.run(suite()); |
---|
| 76 | } |
---|
| 77 | } |
---|