Class RSM
java.lang.Object
unifeat.featureSelection.FeatureSelection
unifeat.featureSelection.filter.FilterApproach
unifeat.featureSelection.filter.unsupervised.RSM
This java class is used to implement the random subspace method(RSM) method.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate int[]
private final MultivariateMethodType
private final int
private final int
private final int
Fields inherited from class unifeat.featureSelection.FeatureSelection
numClass, numFeatures, numSelectedFeature, selectedFeatureSubset, trainSet
-
Constructor Summary
ConstructorDescriptionRSM
(int sizeSelectedFeatureSubset, int numIter, int size, int threshold, MultivariateMethodType nameApproach) Initializes the parametersInitializes the parameters -
Method Summary
Modifier and TypeMethodDescriptionprivate double[][]
createNewDataset
(int[] index) Creates a new dataset based on the given indeces of the featuresvoid
Starts the feature selection process by random subspace method(RSM)private int[]
multivariateApproach
(double[][] data) Selects the top feature with size THRESHOLD_ELIMINATION by given methodprivate void
permutation
(int[] indexFeat, int seed) Permutes the index of featuresvalidate()
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
-
NUM_ITERATION
private final int NUM_ITERATION -
SIZE_SUB_SPACE
private final int SIZE_SUB_SPACE -
THRESHOLD_ELIMINATION
private final int THRESHOLD_ELIMINATION -
NAME_MULTI_APPROACH
-
featureScore
private int[] featureScore
-
-
Constructor Details
-
RSM
Initializes the parameters- Parameters:
arguments
- array of parameters contains (sizeSelectedFeatureSubset
,numIter
,size
,threshold
,nameApproach
) in whichsizeSelectedFeatureSubset
is the number of selected features,numIter
is the number of iteration in the RSM method,size
is the size of the subspace,threshold
is the number of selected features in each subspace, andnameApproach
is the name of the multivariate approach used in the RSM
-
RSM
public RSM(int sizeSelectedFeatureSubset, int numIter, int size, int threshold, MultivariateMethodType nameApproach) Initializes the parameters- Parameters:
sizeSelectedFeatureSubset
- the number of selected featuresnumIter
- the number of iteration in the RSM methodsize
- the size of the subspacethreshold
- the number of selected features in each subspacenameApproach
- the name of the multivariate approach used in the RSM
-
-
Method Details
-
permutation
private void permutation(int[] indexFeat, int seed) Permutes the index of features- Parameters:
indexFeat
- the array of the index of featuresseed
- determines the index of the seed
-
multivariateApproach
private int[] multivariateApproach(double[][] data) Selects the top feature with size THRESHOLD_ELIMINATION by given method- Parameters:
data
- the new dataset- Returns:
- the top feature with size THRESHOLD_ELIMINATION
-
createNewDataset
private double[][] createNewDataset(int[] index) Creates a new dataset based on the given indeces of the features- Parameters:
index
- an array of the indeces of features- Returns:
- a new dataset
-
evaluateFeatures
public void evaluateFeatures()Starts the feature selection process by random subspace method(RSM)- 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
-