public class ScatterSearchV1 extends ASSearch implements OptionHandler, TechnicalInformationHandler
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.
Modifier and Type | Class and Description |
---|---|
class |
ScatterSearchV1.Subset |
Modifier and Type | Field and Description |
---|---|
static Tag[] |
TAGS_SELECTION |
Constructor and Description |
---|
ScatterSearchV1() |
Modifier and Type | Method and Description |
---|---|
int[] |
attributeList(java.util.BitSet group)
converts a BitSet into a list of attribute indexes
|
java.util.List<ScatterSearchV1.Subset> |
bubbleSubsetSort(java.util.List<ScatterSearchV1.Subset> subsetList)
Sort a List of subsets according to their merits
|
double |
calculateTreshhold()
Calculate the treshold of a dataSet given an evaluator
|
java.lang.String |
combinationTipText()
Returns the tip text for this property
|
void |
CombineParents()
Combine all the posible pair solutions existing in the Population
|
void |
CreatePopulation(int popSize)
Create the initial Population
|
java.lang.String |
debugTipText()
Returns the tip text for this property
|
java.util.List<ScatterSearchV1.Subset> |
filterSubset(java.util.List<ScatterSearchV1.Subset> subsetList,
int preferredSize)
Filter a given Lis of Subsets removing the equals subsets
|
int |
generateRandomNumber(int limit) |
void |
GenerateReferenceSet(java.util.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.
|
java.util.BitSet |
getAllBits(java.util.List<ScatterSearchV1.Subset> subsets)
Save in Bitset all the gens that are in many others subsets.
|
ScatterSearchV1.Subset |
getBestgen(ScatterSearchV1.Subset subset,
java.util.BitSet gens)
Evaluate each gen of a BitSet inserted in a Subset and get the most significant for that Subset
|
SelectedTag |
getCombination()
Get the combination
|
boolean |
getDebug()
Get whether output is to be verbose
|
int |
getIndexofBiggest(java.util.List<java.lang.Integer> simDif)
get the index in a List where this have the biggest number
|
java.lang.String[] |
getOptions()
Gets the current settings of ScatterSearchV1.
|
int |
getPopulationSize()
Get the population size
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSeed()
get the value of the random number generator's seed
|
TechnicalInformation |
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.
|
double |
getThreshold()
Get the treshold
|
java.lang.String |
globalInfo()
Returns a string describing this search method
|
void |
ImproveSolutions()
Improve the solutions previously combined by adding the attributes that improve that solution
|
void |
InitPopulation(int popSize)
Creating space for introducing the population
|
ScatterSearchV1.Subset |
intersectSubsets(ScatterSearchV1.Subset subset1,
ScatterSearchV1.Subset subset2)
Intersects two subsets
|
ScatterSearchV1.Subset |
joinSubsets(ScatterSearchV1.Subset subset1,
ScatterSearchV1.Subset subset2)
Join two subsets
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
java.lang.String |
populationSizeTipText()
Returns the tip text for this property
|
java.lang.String |
printSubset(ScatterSearchV1.Subset subset) |
java.util.List<ScatterSearchV1.Subset> |
RankEachAttribute()
Rank all the attributes individually acording to their merits
|
int[] |
search(ASEvaluation ASEval,
Instances data)
Searches the attribute subset space using Scatter Search.
|
java.lang.String |
seedTipText()
Returns the tip text for this property
|
void |
setCombination(SelectedTag c)
Set the kind of combination
|
void |
setDebug(boolean d)
Set whether verbose output should be generated.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setPopulationSize(int size)
Set the population size
|
void |
setSeed(int s)
set the seed for random number generation
|
void |
setThreshold(double threshold)
Set the treshold
|
ScatterSearchV1.Subset |
simetricDif(ScatterSearchV1.Subset subset1,
ScatterSearchV1.Subset subset2,
int mode) |
int |
SimetricDiference(ScatterSearchV1.Subset subset,
java.util.BitSet bitset)
Calculate the Simetric Diference of two subsets
|
java.lang.String |
thresholdTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
returns a description of the search.
|
void |
UpdateReferenceSet(int numBestSolutions,
int numDivsSolutions)
Update the ReferenceSet putting the new obtained Solutions there
|
forName, makeCopies
public static final Tag[] TAGS_SELECTION
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASSearch
public java.lang.String thresholdTipText()
public void setThreshold(double threshold)
threshold
- for identifyng significant subsetspublic double getThreshold()
public java.lang.String populationSizeTipText()
public void setPopulationSize(int size)
size
- the number of subset in the initial populationpublic int getPopulationSize()
public java.lang.String combinationTipText()
public void setCombination(SelectedTag c)
c
- the kind of combination of the searchpublic SelectedTag getCombination()
public java.lang.String seedTipText()
public void setSeed(int s)
s
- seed valuepublic int getSeed()
public java.lang.String debugTipText()
public void setDebug(boolean d)
d
- true if output is to be verbose.public boolean getDebug()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-Z
Specify the number of subsets to generate in the initial population.
-T
-R
-S
Specify the treshold used for considering when a subset is significant.
Specify the kind of combiantion.
Set the random number seed.
(default = 1)
-D
Verbose output for monitoring the search
(default = false)
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String toString()
toString
in class java.lang.Object
public int[] search(ASEvaluation ASEval, Instances data) throws java.lang.Exception
public void GenerateReferenceSet(java.util.List<ScatterSearchV1.Subset> ReferenceSet, int bestSolutions, int divSolutions)
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.public void UpdateReferenceSet(int numBestSolutions, int numDivsSolutions)
numBestSolutions
- the number of the most pure solutions.numDivsSolutions
- the number of the most diverses solutions acording to the bestSolutions.public void ImproveSolutions() throws java.lang.Exception
java.lang.Exception
- if there is some trouble evaluating the candidate solutionspublic void CombineParents() throws java.lang.Exception
java.lang.Exception
- if there is some trouble evaluating the new childspublic void CreatePopulation(int popSize) throws java.lang.Exception
popSize
- the size of the initial populationjava.lang.Exception
- if there is a trouble evaluating any solutionpublic java.util.List<ScatterSearchV1.Subset> RankEachAttribute() throws java.lang.Exception
java.lang.Exception
- if the evaluation can not be completedpublic ScatterSearchV1.Subset getBestgen(ScatterSearchV1.Subset subset, java.util.BitSet gens) throws java.lang.Exception
java.lang.Exception
- if the evaluation of can not be completedpublic java.util.List<ScatterSearchV1.Subset> bubbleSubsetSort(java.util.List<ScatterSearchV1.Subset> subsetList)
subsetList
- the subsetList to be orderedpublic int getIndexofBiggest(java.util.List<java.lang.Integer> simDif)
simDif
- the Lists of numbers for getting from them the index of the biggerpublic java.util.BitSet getAllBits(java.util.List<ScatterSearchV1.Subset> subsets)
subsets
- the Lists of subsets for getting from them all their genspublic void InitPopulation(int popSize)
popSize
- the number of subset in the initial populationpublic ScatterSearchV1.Subset joinSubsets(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2) throws java.lang.Exception
subset1
- one of the subsetssubset2
- the other subsetjava.lang.Exception
- if the evaluation of the subsets can not be completedpublic ScatterSearchV1.Subset intersectSubsets(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2) throws java.lang.Exception
subset1
- one of the subsetssubset2
- the other subsetjava.lang.Exception
- if the evaluation of the subsets can not be completedpublic ScatterSearchV1.Subset simetricDif(ScatterSearchV1.Subset subset1, ScatterSearchV1.Subset subset2, int mode) throws java.lang.Exception
java.lang.Exception
public int generateRandomNumber(int limit)
public double calculateTreshhold() throws java.lang.Exception
java.lang.Exception
- if the calculation can not be completedpublic int SimetricDiference(ScatterSearchV1.Subset subset, java.util.BitSet bitset)
java.lang.Exception
- if the calculation can not be completedpublic java.util.List<ScatterSearchV1.Subset> filterSubset(java.util.List<ScatterSearchV1.Subset> subsetList, int preferredSize)
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).java.lang.Exception
- if the calculation can not be completedpublic java.lang.String printSubset(ScatterSearchV1.Subset subset)
public int[] attributeList(java.util.BitSet group)
group
- the BitSet to convert