Class MGSACO
java.lang.Object
unifeat.featureSelection.FeatureSelection
unifeat.featureSelection.filter.FilterApproach
unifeat.featureSelection.filter.unsupervised.MGSACO
This java class is used to implement the microarray gene selection based on
ant colony optimization (MGSACO) method.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate double[]
private int[][]
private final double
private int[]
private final double
private int[]
private final double
private final double
private final double
private final int
private int
private double
private double[]
private final double
private double[]
private double[]
private boolean[][]
Fields inherited from class unifeat.featureSelection.FeatureSelection
numClass, numFeatures, numSelectedFeature, selectedFeatureSubset, trainSet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Computes the relevance of each feature using the normalized term variance (the relevance values normalized by softmax scaling function)void
Starts the feature selection process by microarray gene selection based on ant colony optimization (MGSACO) methodprivate int
Evaluates the subset of selected features by using fitness function and return the index of the ant with the max performance in the current iterationprivate void
findBestSubset
(int indexBestSubset) Finds the best subset of feature up to knowprivate static int
findIndex
(int index1, int index2) Finds index in new Data Structure(Symmetric Matrix)private int
greedyRule
(int indexAnt) Greedy state transition ruleprivate void
Updates intensity of pheromone valuesprivate int
probRule
(int indexAnt) Probability state transition ruleprivate void
Places the ants randomly on the graph nodes as their starting nodesprivate int
stateTransitionRules
(int indexAnt) Chooses the next feature among unvisited features according to the state transition rulesvalidate()
This method returns the potential errors in the input parameters.Methods inherited from class unifeat.featureSelection.filter.FilterApproach
newMethod
Methods inherited from class unifeat.featureSelection.FeatureSelection
getSelectedFeatureSubset, loadDataSet, loadDataSet, setNumSelectedFeature
-
Field Details
-
INIT_PHEROMONE_VALUE
private final double INIT_PHEROMONE_VALUE -
MAX_ITERATION
private final int MAX_ITERATION -
NUM_ANTS
private int NUM_ANTS -
DECAY_RATE
private final double DECAY_RATE -
BETA
private final double BETA -
PROB_CHOOSE_EQUATION
private final double PROB_CHOOSE_EQUATION -
performBestSubset
private double performBestSubset -
antSubsetSelected
private int[][] antSubsetSelected -
antPerformValues
private double[] antPerformValues -
relevanceFeature
private double[] relevanceFeature -
simValues
private double[] simValues -
pheromoneValues
private double[] pheromoneValues -
edgeCounter
private int[] edgeCounter -
tabuList
private boolean[][] tabuList -
currentState
private int[] currentState -
ERROR_SIMILARITY
private final double ERROR_SIMILARITY- See Also:
-
ERROR_RELEVANCE
private final double ERROR_RELEVANCE- See Also:
-
-
Constructor Details
-
MGSACO
Initializes the parameters- Parameters:
arguments
- array of parameter contains (sizeSelectedFeatureSubset
,initPheromone
,numIterations
,numAnt
,evaporationRate
,betaParameter
,q0_Parameter
) in whichsizeSelectedFeatureSubset
is the number of selected features,initPheromone
is the initial value of the pheromone,numIterations
is the maximum number of iteration,numAnt
is the number of ants,evaporationRate
is the evaporation rate of the pheromone,betaParameter
is the beta parameter in the state transition rule, andq0_Parameter
is the q0 parameter in the state transition rule
-
MGSACO
public MGSACO(int sizeSelectedFeatureSubset, double initPheromone, int numIterations, int numAnt, double evaporationRate, double betaParameter, double q0_Parameter) Initializes the parameters- Parameters:
sizeSelectedFeatureSubset
- the number of selected featuresinitPheromone
- the initial value of the pheromonenumIterations
- the maximum number of iterationnumAnt
- the number of antsevaporationRate
- the evaporation rate of the pheromonebetaParameter
- the beta parameter in the state transition ruleq0_Parameter
- the q0 parameter in the state transition rule
-
-
Method Details
-
findIndex
private static int findIndex(int index1, int index2) Finds index in new Data Structure(Symmetric Matrix)- Parameters:
index1
- index of the rowindex2
- index of the column- Returns:
- the index in new Data Structure
-
computeRelevance
private void computeRelevance()Computes the relevance of each feature using the normalized term variance (the relevance values normalized by softmax scaling function) -
setStartNode
private void setStartNode()Places the ants randomly on the graph nodes as their starting nodes -
greedyRule
private int greedyRule(int indexAnt) Greedy state transition rule- Parameters:
indexAnt
- index of the ant- Returns:
- the index of the selected feature
-
probRule
private int probRule(int indexAnt) Probability state transition rule- Parameters:
indexAnt
- index of the ant- Returns:
- the index of the selected feature
-
stateTransitionRules
private int stateTransitionRules(int indexAnt) Chooses the next feature among unvisited features according to the state transition rules- Parameters:
indexAnt
- the index of the ant- Returns:
- the index of the selected feature
-
evaluateSubsets
private int evaluateSubsets()Evaluates the subset of selected features by using fitness function and return the index of the ant with the max performance in the current iteration- Returns:
- the index of the ant with the maximum performance
-
findBestSubset
private void findBestSubset(int indexBestSubset) Finds the best subset of feature up to know- Parameters:
indexBestSubset
- the index of the found best subset in the current iteration
-
pheromoneUpdatingRule
private void pheromoneUpdatingRule()Updates intensity of pheromone values -
evaluateFeatures
public void evaluateFeatures()Starts the feature selection process by microarray gene selection based on ant colony optimization (MGSACO) method- Specified by:
evaluateFeatures
in classFeatureSelection
-
validate
This method returns the potential errors in the input parameters.- Overrides:
validate
in classFeatureSelection
- Returns:
- a string contains the information about incorrect parameters
-