Class MRMR
java.lang.Object
unifeat.featureSelection.FeatureSelection
unifeat.featureSelection.filter.FilterApproach
unifeat.featureSelection.filter.supervised.MRMR
This java class is used to implement the minimal redundancy maximal
relevance (mRMR) method.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Fields inherited from class unifeat.featureSelection.FeatureSelection
numClass, numFeatures, numSelectedFeature, selectedFeatureSubset, trainSet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
computeDifferentValue
(int index) Saves the different values of each featureprivate double[]
computeJointProb
(int indexFeat2, int indexStartData, int indexEndData) Computes the joint probabilities values between two featuresprivate double
computeMutualInfo
(int index1, int index2) Computes the mutual information values between two featuresprivate int
computeNumValue
(int index) Computes the number of different values of each featureprivate void
computeProbFeat
(int index) Computes the probabilities values of each featurevoid
Starts the feature selection process by minimal redundancy maximal relevance (mRMR) methodprivate int
findMaxWithIndex
(double[] array) Finds the maximum value in the array and returns its indexprivate boolean
isSelectedFeature
(int index, int currentSize) Checks that is the current feature (index) available in the subset of selected featureMethods inherited from class unifeat.featureSelection.filter.FilterApproach
newMethod
Methods inherited from class unifeat.featureSelection.FeatureSelection
getSelectedFeatureSubset, loadDataSet, loadDataSet, setNumSelectedFeature, validate
-
Field Details
-
probFeature
private double[][] probFeature -
valuesFeature
private double[][] valuesFeature
-
-
Constructor Details
-
MRMR
Initializes the parameters- Parameters:
arguments
- array of parameters contains (sizeSelectedFeatureSubset
) in whichsizeSelectedFeatureSubset
is the number of selected features
-
MRMR
public MRMR(int sizeSelectedFeatureSubset) Initializes the parameters- Parameters:
sizeSelectedFeatureSubset
- the number of selected features
-
-
Method Details
-
computeNumValue
private int computeNumValue(int index) Computes the number of different values of each feature- Parameters:
index
- the index of the feature- Returns:
- the number of different values
-
computeDifferentValue
private void computeDifferentValue(int index) Saves the different values of each feature- Parameters:
index
- the index of the feature
-
computeProbFeat
private void computeProbFeat(int index) Computes the probabilities values of each feature- Parameters:
index
- the index of the feature
-
computeJointProb
private double[] computeJointProb(int indexFeat2, int indexStartData, int indexEndData) Computes the joint probabilities values between two features- Parameters:
indexFeat2
- the index of the second featureindexStartData
- the start index of the datasetindexEndData
- the end index of the dataset- Returns:
- an array of the joint probabilities values
-
computeMutualInfo
private double computeMutualInfo(int index1, int index2) Computes the mutual information values between two features- Parameters:
index1
- the index of the first featureindex2
- the index of the second feature- Returns:
- the mutual information value
-
findMaxWithIndex
private int findMaxWithIndex(double[] array) Finds the maximum value in the array and returns its index- Parameters:
array
- the input array- Returns:
- the index of the maximum value in the array
-
isSelectedFeature
private boolean isSelectedFeature(int index, int currentSize) Checks that is the current feature (index) available in the subset of selected feature- Parameters:
index
- the index of the featurecurrentSize
- the current size of the selected features subset- Returns:
- true if the current feature has been selected
-
evaluateFeatures
public void evaluateFeatures()Starts the feature selection process by minimal redundancy maximal relevance (mRMR) method- Specified by:
evaluateFeatures
in classFeatureSelection
-