Class RandomForestMethod
java.lang.Object
unifeat.featureSelection.FeatureSelection
unifeat.featureSelection.embedded.EmbeddedApproach
unifeat.featureSelection.embedded.TreeBasedMethods.TreeBasedMethods
unifeat.featureSelection.embedded.TreeBasedMethods.RandomForestMethod
This java class is used to implement the random forest based method for
feature selection.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Fields inherited from class unifeat.featureSelection.embedded.TreeBasedMethods.TreeBasedMethods
TEMP_PATH, TREE_TYPE
Fields inherited from class unifeat.featureSelection.embedded.EmbeddedApproach
classLabel, nameFeatures, PROJECT_PATH
Fields inherited from class unifeat.featureSelection.FeatureSelection
numClass, numFeatures, numSelectedFeature, selectedFeatureSubset, trainSet
-
Constructor Summary
ConstructorDescriptionRandomForestMethod
(Object... arguments) Initializes the parametersRandomForestMethod
(String path, int randomForestNumFeatures, int randomForestMaxDepth, int randomForestNumIterations) Initializes the parameters -
Method Summary
Modifier and TypeMethodDescriptionprotected String
buildClassifier
(weka.core.Instances dataTrain) Generates a classifier using input datavoid
Starts the feature selection process by Random Forest based methodprotected void
selectedFeatureSubset
(String tree) Finds the feature subset from the nodes of the created tree (Used for Random Forest)Methods inherited from class unifeat.featureSelection.embedded.EmbeddedApproach
loadDataSet, loadDataSet, newMethod, originalFeatureSet
Methods inherited from class unifeat.featureSelection.FeatureSelection
getSelectedFeatureSubset, setNumSelectedFeature, validate
-
Constructor Details
-
RandomForestMethod
Initializes the parameters- Parameters:
arguments
- array of parameter contains (path
,tree type
,NumFeatures
,MaxDepth
,NumIterations
) in whichpath
is the path of the project,tree type
is the type of tree,NumFeatures
is the number of randomly selected features,MaxDepth
is the maximum depth of the tree,NumIterations
is the number of iterations to be performed
-
RandomForestMethod
public RandomForestMethod(String path, int randomForestNumFeatures, int randomForestMaxDepth, int randomForestNumIterations) Initializes the parameters- Parameters:
path
- the path of the projectrandomForestNumFeatures
- the number of randomly selected featuresrandomForestMaxDepth
- the maximum depth of the treerandomForestNumIterations
- the number of iterations to be performed
-
-
Method Details
-
selectedFeatureSubset
Finds the feature subset from the nodes of the created tree (Used for Random Forest)- Specified by:
selectedFeatureSubset
in classTreeBasedMethods
- Parameters:
tree
- the generated tree based on the train set
-
buildClassifier
Generates a classifier using input data- Specified by:
buildClassifier
in classTreeBasedMethods
- Parameters:
dataTrain
- the data to train the classifier- Returns:
- the output of the generated classifier
-
evaluateFeatures
public void evaluateFeatures()Starts the feature selection process by Random Forest based method- Specified by:
evaluateFeatures
in classFeatureSelection
-