Package weka.attributeSelection
Class ScatterSearchV1
java.lang.Object
weka.attributeSelection.ASSearch
weka.attributeSelection.ScatterSearchV1
- All Implemented Interfaces:
Serializable
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
Class for performing the Sequential Scatter Search.
Scatter Search :
Performs an Scatter Search through the space of attribute subsets. Start with a population of many significants and diverses subset stops when the result is higher than a given treshold or there's not more improvement
For more information see:
Felix Garcia Lopez (2004). Solving feature subset selection problem by a Parallel Scatter Search. Elsevier.
-Z <num> Specify the number of subsets to generate in the initial population..
-T <threshold> Specify the treshold used for considering when a subset is significant.
-R <0 = greedy combination | 1 = reduced greedy combination > Specify the kind of combiantion for using it in the combination method.
-S <seed> Set the random number seed. (default = 1)
-D Verbose output for monitoring the search.BibTeX:
@book{Lopez2004, author = {Felix Garcia Lopez}, month = {October}, publisher = {Elsevier}, title = {Solving feature subset selection problem by a Parallel Scatter Search}, year = {2004}, language = {English} }from the Book: Solving feature subset selection problem by a Parallel Scatter Search, Felix Garcia Lopez.
- Version:
- $Revision: 6277 $
- Author:
- Adrian Pino (apinoa@facinf.uho.edu.cu)
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]
attributeList
(BitSet group) converts a BitSet into a list of attribute indexesbubbleSubsetSort
(List<ScatterSearchV1.Subset> subsetList) Sort a List of subsets according to their meritsdouble
Calculate the treshold of a dataSet given an evaluatorReturns the tip text for this propertyvoid
Combine all the posible pair solutions existing in the Populationvoid
CreatePopulation
(int popSize) Create the initial PopulationReturns the tip text for this propertyfilterSubset
(List<ScatterSearchV1.Subset> subsetList, int preferredSize) Filter a given Lis of Subsets removing the equals subsetsint
generateRandomNumber
(int limit) void
GenerateReferenceSet
(List<ScatterSearchV1.Subset> ReferenceSet, int bestSolutions, int divSolutions) Generate the a ReferenceSet containing the n best solutions and the m most diverse solutions of the initial Population.getAllBits
(List<ScatterSearchV1.Subset> subsets) Save in Bitset all the gens that are in many others subsets.getBestgen
(ScatterSearchV1.Subset subset, BitSet gens) Evaluate each gen of a BitSet inserted in a Subset and get the most significant for that SubsetGet the combinationboolean
getDebug()
Get whether output is to be verboseint
getIndexofBiggest
(List<Integer> simDif) get the index in a List where this have the biggest numberString[]
Gets the current settings of ScatterSearchV1.int
Get the population sizeReturns the revision string.int
getSeed()
get the value of the random number generator's seedReturns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.double
Get the tresholdReturns a string describing this search methodvoid
Improve the solutions previously combined by adding the attributes that improve that solutionvoid
InitPopulation
(int popSize) Creating space for introducing the populationintersectSubsets
(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2) Intersects two subsetsjoinSubsets
(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2) Join two subsetsReturns an enumeration describing the available options.Returns the tip text for this propertyprintSubset
(ScatterSearchV1.Subset subset) Rank all the attributes individually acording to their meritsint[]
search
(ASEvaluation ASEval, Instances data) Searches the attribute subset space using Scatter Search.Returns the tip text for this propertyvoid
Set the kind of combinationvoid
setDebug
(boolean d) Set whether verbose output should be generated.void
setOptions
(String[] options) Parses a given list of options.void
setPopulationSize
(int size) Set the population sizevoid
setSeed
(int s) set the seed for random number generationvoid
setThreshold
(double threshold) Set the tresholdsimetricDif
(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2, int mode) int
SimetricDiference
(ScatterSearchV1.Subset subset, BitSet bitset) Calculate the Simetric Diference of two subsetsReturns the tip text for this propertytoString()
returns a description of the search.void
UpdateReferenceSet
(int numBestSolutions, int numDivsSolutions) Update the ReferenceSet putting the new obtained Solutions thereMethods inherited from class weka.attributeSelection.ASSearch
forName, makeCopies
-
Field Details
-
TAGS_SELECTION
-
-
Constructor Details
-
ScatterSearchV1
public ScatterSearchV1()
-
-
Method Details
-
globalInfo
Returns a string describing this search method- Returns:
- a description of the search suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Returns:
- the technical information about this class
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classASSearch
- Returns:
- the revision
-
thresholdTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setThreshold
public void setThreshold(double threshold) Set the treshold- Parameters:
threshold
- for identifyng significant subsets
-
getThreshold
public double getThreshold()Get the treshold- Returns:
- the treshold that subsets most overcome to be considered as significants
-
populationSizeTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setPopulationSize
public void setPopulationSize(int size) Set the population size- Parameters:
size
- the number of subset in the initial population
-
getPopulationSize
public int getPopulationSize()Get the population size- Returns:
- the number of subsets to generate in the initial population
-
combinationTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setCombination
Set the kind of combination- Parameters:
c
- the kind of combination of the search
-
getCombination
Get the combination- Returns:
- the kind of combination used in the Combination method
-
seedTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setSeed
public void setSeed(int s) set the seed for random number generation- Parameters:
s
- seed value
-
getSeed
public int getSeed()get the value of the random number generator's seed- Returns:
- the seed for random number generation
-
debugTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setDebug
public void setDebug(boolean d) Set whether verbose output should be generated.- Parameters:
d
- true if output is to be verbose.
-
getDebug
public boolean getDebug()Get whether output is to be verbose- Returns:
- true if output will be verbose
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-Z
Specify the number of subsets to generate in the initial population.-T
Specify the treshold used for considering when a subset is significant.-R
Specify the kind of combiantion.-S
Set the random number seed. (default = 1) -D
Verbose output for monitoring the search (default = false)- Specified by:
setOptions
in interfaceOptionHandler
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of ScatterSearchV1.- Specified by:
getOptions
in interfaceOptionHandler
- Returns:
- an array of strings suitable for passing to setOptions()
-
toString
returns a description of the search. -
search
Searches the attribute subset space using Scatter Search. -
GenerateReferenceSet
public void GenerateReferenceSet(List<ScatterSearchV1.Subset> ReferenceSet, int bestSolutions, int divSolutions) Generate the a ReferenceSet containing the n best solutions and the m most diverse solutions of the initial Population.- Parameters:
ReferenceSet
- the ReferenceSet for storing these solutionsbestSolutions
- the number of the most pure solutions.divSolutions
- the number of the most diverses solutions acording to the bestSolutions.
-
UpdateReferenceSet
public void UpdateReferenceSet(int numBestSolutions, int numDivsSolutions) Update the ReferenceSet putting the new obtained Solutions there- Parameters:
numBestSolutions
- the number of the most pure solutions.numDivsSolutions
- the number of the most diverses solutions acording to the bestSolutions.
-
ImproveSolutions
Improve the solutions previously combined by adding the attributes that improve that solution- Throws:
Exception
- if there is some trouble evaluating the candidate solutions
-
CombineParents
Combine all the posible pair solutions existing in the Population- Throws:
Exception
- if there is some trouble evaluating the new childs
-
CreatePopulation
Create the initial Population- Parameters:
popSize
- the size of the initial population- Throws:
Exception
- if there is a trouble evaluating any solution
-
RankEachAttribute
Rank all the attributes individually acording to their merits- Returns:
- an ordered List of Subsets with just one attribute
- Throws:
Exception
- if the evaluation can not be completed
-
getBestgen
public ScatterSearchV1.Subset getBestgen(ScatterSearchV1.Subset subset, BitSet gens) throws Exception Evaluate each gen of a BitSet inserted in a Subset and get the most significant for that Subset- Returns:
- a new Subset with the union of subset and the best gen of gens. in case that there's not improvement with each gen return null
- Throws:
Exception
- if the evaluation of can not be completed
-
bubbleSubsetSort
Sort a List of subsets according to their merits- Parameters:
subsetList
- the subsetList to be ordered- Returns:
- a List with ordered subsets
-
getIndexofBiggest
get the index in a List where this have the biggest number- Parameters:
simDif
- the Lists of numbers for getting from them the index of the bigger- Returns:
- an index that represents where the bigest number is.
-
getAllBits
Save in Bitset all the gens that are in many others subsets.- Parameters:
subsets
- the Lists of subsets for getting from them all their gens- Returns:
- a Bitset with all the gens contained in many others subsets.
-
InitPopulation
public void InitPopulation(int popSize) Creating space for introducing the population- Parameters:
popSize
- the number of subset in the initial population
-
joinSubsets
public ScatterSearchV1.Subset joinSubsets(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2) throws Exception Join two subsets- Parameters:
subset1
- one of the subsetssubset2
- the other subset- Returns:
- a new Subset that is te result of the Join
- Throws:
Exception
- if the evaluation of the subsets can not be completed
-
intersectSubsets
public ScatterSearchV1.Subset intersectSubsets(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2) throws Exception Intersects two subsets- Parameters:
subset1
- one of the subsetssubset2
- the other subset- Returns:
- a new Subset that is te result of the intersection
- Throws:
Exception
- if the evaluation of the subsets can not be completed
-
simetricDif
public ScatterSearchV1.Subset simetricDif(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2, int mode) throws Exception - Throws:
Exception
-
generateRandomNumber
public int generateRandomNumber(int limit) -
calculateTreshhold
Calculate the treshold of a dataSet given an evaluator- Returns:
- the treshhold of the dataSet
- Throws:
Exception
- if the calculation can not be completed
-
SimetricDiference
Calculate the Simetric Diference of two subsets- Returns:
- the Simetric Diference
- Throws:
Exception
- if the calculation can not be completed
-
filterSubset
public List<ScatterSearchV1.Subset> filterSubset(List<ScatterSearchV1.Subset> subsetList, int preferredSize) Filter a given Lis of Subsets removing the equals subsets- Parameters:
subsetList
- to filterpreferredSize
- the preferred size of the new List (if it is -1, then the filter is make it for all subsets, else then the filter method stops when the given preferred size is reached or all the subset have been filtered).- Returns:
- a new List filtered
- Throws:
Exception
- if the calculation can not be completed
-
printSubset
-
attributeList
converts a BitSet into a list of attribute indexes- Parameters:
group
- the BitSet to convert- Returns:
- an array of attribute indexes
-