~ubuntu-branches/ubuntu/raring/weka/raring

« back to all changes in this revision

Viewing changes to weka/attributeSelection/LinearForwardSelection.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner, Soeren Sonnenburg, Torsten Werner
  • Date: 2008-08-10 21:27:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080810212705-tr8etpnkdx2ziktp
Tags: 3.5.8-1
[ Soeren Sonnenburg ]
* Bump Standards Version to 3.8.0.
* Remove references to non-free Java in debian/copyright.

[ Torsten Werner ]
* new upstream release
* Switch to openjdk-6.
* Move package to main.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
/*
18
18
 *    LinearForwardSelection.java
19
 
 *    Copyright (C) 2007 Martin Gütlein
 
19
 *    Copyright (C) 2007 Martin Guetlein
20
20
 *
21
21
 */
 
22
 
22
23
package weka.attributeSelection;
23
24
 
24
25
import weka.core.Instances;
25
26
import weka.core.Option;
26
27
import weka.core.OptionHandler;
27
28
import weka.core.Range;
 
29
import weka.core.RevisionUtils;
28
30
import weka.core.SelectedTag;
29
31
import weka.core.Tag;
30
32
import weka.core.Utils;
39
41
 
40
42
/**
41
43
  <!-- globalinfo-start -->
42
 
 * LinearForwardSelection:<br/>
43
 
 * Class for performing a linear forward selection (Extension of
44
 
 * BestFirstSearch)
45
 
 * </p>
 
44
  * LinearForwardSelection:<br/>
 
45
  * <br/>
 
46
  * Extension of BestFirst. Takes a restricted number of k attributes into account. Fixed-set selects a fixed number k of attributes, whereas k is increased in each step when fixed-width is selected. The search uses either the initial ordering to select the top k attributes, or performs a ranking (with the same evalutator the search uses later on). The search direction can be forward, or floating forward selection (with opitional backward search steps).<br/>
 
47
  * <br/>
 
48
  * For more information see:<br/>
 
49
  * <br/>
 
50
  * Martin Guetlein (2006). Large Scale Attribute Selection Using Wrappers. Freiburg, Germany.
 
51
  * <p/>
46
52
  <!-- globalinfo-end -->
47
53
 *
48
54
  <!-- options-start -->
49
 
 * Valid options are:
50
 
 * <p/>
51
 
 *
52
 
 * <pre> -P &lt;start set&gt;
53
 
 *  Specify a starting set of attributes.
54
 
 *  Eg. 1,3,5-7.</pre>
55
 
 *
56
 
 * <pre> -D &lt;0 = forward selection | 1 = floating forward selection&gt;
57
 
 * Forward selection method of the search. (default = 0).</pre>
58
 
 *
59
 
 * <pre> -N &lt;num&gt;
60
 
 * Number of non improving nodes to consider before terminating search. (default = 5).</pre>
61
 
 *
62
 
 * <pre> -I
63
 
 * Perform initial ranking to select top-ranked attributes. </pre>
64
 
 *
65
 
 * <pre> -K &lt;num&gt;
66
 
 * Number of top-ranked attributes that are taken into account.</pre>
67
 
 *
68
 
 * <pre> -T &lt;0 = fixed-set | 1 = fixed-width&gt;
69
 
 * Type of Linear Forward Selection (default = 0).</pre>
70
 
 *
71
 
 * <pre> -S &lt;num&gt;
72
 
 * Size of lookup cache for evaluated subsets. Expressed as a multiple of the
73
 
 * number of attributes in the data set. (default = 1).</pre>
74
 
 *
75
 
 * <pre> -Z
76
 
 * verbose on/off. </pre>
77
 
 *
78
 
 <!-- options-end -->
 
55
  * Valid options are: <p/>
 
56
  * 
 
57
  * <pre> -P &lt;start set&gt;
 
58
  *  Specify a starting set of attributes.
 
59
  *  Eg. 1,3,5-7.</pre>
 
60
  * 
 
61
  * <pre> -D &lt;0 = forward selection | 1 = floating forward selection&gt;
 
62
  *  Forward selection method. (default = 0).</pre>
 
63
  * 
 
64
  * <pre> -N &lt;num&gt;
 
65
  *  Number of non-improving nodes to
 
66
  *  consider before terminating search.</pre>
 
67
  * 
 
68
  * <pre> -I
 
69
  *  Perform initial ranking to select the
 
70
  *  top-ranked attributes.</pre>
 
71
  * 
 
72
  * <pre> -K &lt;num&gt;
 
73
  *  Number of top-ranked attributes that are 
 
74
  *  taken into account by the search.</pre>
 
75
  * 
 
76
  * <pre> -T &lt;0 = fixed-set | 1 = fixed-width&gt;
 
77
  *  Type of Linear Forward Selection (default = 0).</pre>
 
78
  * 
 
79
  * <pre> -S &lt;num&gt;
 
80
  *  Size of lookup cache for evaluated subsets.
 
81
  *  Expressed as a multiple of the number of
 
82
  *  attributes in the data set. (default = 1)</pre>
 
83
  * 
 
84
  * <pre> -Z
 
85
  *  verbose on/off</pre>
 
86
  * 
 
87
  <!-- options-end -->
79
88
 *
80
89
 * @author Martin Guetlein (martin.guetlein@gmail.com)
81
 
 * @version $Revision: 1.1 $
 
90
 * @version $Revision: 1.4 $
82
91
 */
83
92
public class LinearForwardSelection 
84
93
  extends ASSearch 
187
196
    result.setValue(Field.AUTHOR, "Martin Guetlein");
188
197
    result.setValue(Field.YEAR, "2006");
189
198
    result.setValue(Field.TITLE, "Large Scale Attribute Selection Using Wrappers");
190
 
    result.setValue(Field.SCHOOL, "Albert-Ludwigs-Universitat");
 
199
    result.setValue(Field.SCHOOL, "Albert-Ludwigs-Universitaet");
191
200
    result.setValue(Field.ADDRESS, "Freiburg, Germany");
192
201
    
193
202
    return result;
740
749
      m_classIndex = data.classIndex();
741
750
    }
742
751
 
743
 
    ((SubsetEvaluator) ASEval).buildEvaluator(data);
 
752
    ((ASEvaluation) ASEval).buildEvaluator(data);
744
753
 
745
754
    m_numAttribs = data.numAttributes();
746
755
 
842
851
 
843
852
    return list;
844
853
  }
 
854
  
 
855
  /**
 
856
   * Returns the revision string.
 
857
   * 
 
858
   * @return            the revision
 
859
   */
 
860
  public String getRevision() {
 
861
    return RevisionUtils.extract("$Revision: 1.4 $");
 
862
  }
845
863
}
 
864