Package weka.attributeSelection

# Class LFSMethods

java.lang.Object
weka.attributeSelection.LFSMethods

All Implemented Interfaces:
  `RevisionHandler`

public class LFSMethods extends Object implements RevisionHandler

Version:
  $Revision: 1.3 $
Author:
  Martin Guetlein (martin.guetlein@gmail.com)

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`LFSMethods.Link2`
Class for a node in a linked list.
`class`
`LFSMethods.LinkedList2`
Class for handling a linked list.

## Constructor Summary

Constructors
Constructor
Description
`LFSMethods()`
empty constructor methods are not static because of access to inner class Link2 and LinkedList2

## Method Summary

Modifier and Type
Method
Description
`BitSet`
`floatingForwardSearch(int cacheSize, BitSet startGroup, int[] ranking, int k, boolean incrementK, int maxStale, Instances data, SubsetEvaluator evaluator, boolean verbose)`
Performs linear floating forward selection ( the stopping criteria cannot be changed to a specific size value )
`BitSet`
`forwardSearch(int cacheSize, BitSet startGroup, int[] ranking, int k, boolean incrementK, int maxStale, int forceResultSize, Instances data, SubsetEvaluator evaluator, boolean verbose)`
Performs linear forward selection
`BitSet`
`getBestGroup()`
`BitSet`
`getBestGroupOfSize(int size)`
`double`
`getBestMerit()`
`int`
`getNumEvalsCached()`
`int`
`getNumEvalsTotal()`
`String`
`getRevision()`
Returns the revision string.
`int[]`
`rankAttributes(Instances data, SubsetEvaluator evaluator, boolean verbose)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LFSMethods

public LFSMethods()
empty constructor methods are not static because of access to inner class Link2 and LinkedList2

## Method Details

### getBestGroup

public BitSet getBestGroup()

Returns:
  best group found by forwardSearch/floatingForwardSearch

### getBestMerit

public double getBestMerit()

Returns:
  merit of best group found by forwardSearch/floatingForwardSearch

### getBestGroupOfSize

public BitSet getBestGroupOfSize(int size)

Returns:
  best group of size found by forwardSearch

### getNumEvalsCached

public int getNumEvalsCached()

Returns:
  number of cached / not performed evaluations

### getNumEvalsTotal

public int getNumEvalsTotal()

Returns:
  number totally performed evaluations

### rankAttributes

public int[] rankAttributes(Instances data, SubsetEvaluator evaluator, boolean verbose) throws Exception

Returns:
  ranking (integer array) of attributes in data with evaluator (sorting is NOT stable!)
Throws:
  `Exception`

### forwardSearch

public BitSet forwardSearch(int cacheSize, BitSet startGroup, int[] ranking, int k, boolean incrementK, int maxStale, int forceResultSize, Instances data, SubsetEvaluator evaluator, boolean verbose) throws Exception
Performs linear forward selection

Parameters:
  `cacheSize` - chacheSize (times number of instances) to store already evaluated sets
  `startGroup` - start group for search (can be null)
  `ranking` - ranking of attributes (as produced by rankAttributes), no ranking would be [0,1,2,3,4..]
  `k` - number of top k attributes that are taken into account
  `incrementK` - true -> fixed-set, false -> fixed-width
  `maxStale` - number of times the search proceeds even though no improvement was found (1 = hill-climbing)
  `forceResultSize` - stopping criteria changed from no-improvement (forceResultSize=-1) to subset-size
  `data` -
  `evaluator` -
  `verbose` -
Returns:
  BitSet, that cotains the best-group found
Throws:
  `Exception`

### floatingForwardSearch

public BitSet floatingForwardSearch(int cacheSize, BitSet startGroup, int[] ranking, int k, boolean incrementK, int maxStale, Instances data, SubsetEvaluator evaluator, boolean verbose) throws Exception
Performs linear floating forward selection ( the stopping criteria cannot be changed to a specific size value )

Parameters:
  `cacheSize` - chacheSize (times number of instances) to store already evaluated sets
  `startGroup` - start group for search (can be null)
  `ranking` - ranking of attributes (as produced by rankAttributes), no ranking would be [0,1,2,3,4..]
  `k` - number of top k attributes that are taken into account
  `incrementK` - true -> fixed-set, false -> fixed-width
  `maxStale` - number of times the search proceeds even though no improvement was found (1 = hill-climbing)
  `data` -
  `evaluator` -
  `verbose` -
Returns:
  BitSet, that cotains the best-group found
Throws:
  `Exception`

### getRevision

public String getRevision()
Returns the revision string.

Specified by:
  `getRevision` in interface `RevisionHandler`
Returns:
  the revision