Class DecisionTreeBasedMethod
java.lang.Object
unifeat.featureSelection.FeatureSelection
unifeat.featureSelection.embedded.EmbeddedApproach
unifeat.featureSelection.embedded.TreeBasedMethods.TreeBasedMethods
unifeat.featureSelection.embedded.TreeBasedMethods.DecisionTreeBasedMethod
This java class is used to implement the decision tree based methods.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate double
private int
private int
private int
private double
private double
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
ConstructorDescriptionDecisionTreeBasedMethod
(Object... arguments) Initializes the parametersDecisionTreeBasedMethod
(String path, double confidence, int minNum) Initializes the parametersDecisionTreeBasedMethod
(String path, int randomTreeKValue, int randomTreeMaxDepth, double randomTreeMinNum, double randomTreeMinVarianceProp) 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 Decision Tree based methodsprotected void
selectedFeatureSubset
(String tree) Finds the feature subset from the nodes of the created tree (Used for C4.5 and Random Tree)Methods inherited from class unifeat.featureSelection.embedded.EmbeddedApproach
loadDataSet, loadDataSet, newMethod, originalFeatureSet
Methods inherited from class unifeat.featureSelection.FeatureSelection
getSelectedFeatureSubset, setNumSelectedFeature, validate
-
Field Details
-
confidenceValue
private double confidenceValue -
minNumSampleInLeaf
private int minNumSampleInLeaf -
randomTreeKValue
private int randomTreeKValue -
randomTreeMaxDepth
private int randomTreeMaxDepth -
randomTreeMinNum
private double randomTreeMinNum -
randomTreeMinVarianceProp
private double randomTreeMinVarianceProp
-
-
Constructor Details
-
DecisionTreeBasedMethod
Initializes the parameters- Parameters:
arguments
- array of parameter containsif the type of tree is C4.5 (
path
,tree type
,confidenceValue
,minNumSampleInLeaf
) in whichpath
is the path of the project,tree type
is the type of tree,confidenceValue
is the confidence factor used for pruning,minNumSampleInLeaf
is the minimum number of samples per leafif the type of tree is random tree (
path
,tree type
,KValue
,MaxDepth
,MinNum,
,MinVarianceProp
) in whichpath
is the path of the project,tree type
is the type of tree,KValue
is the number of randomly chosen attributes,MaxDepth
is the maximum depth of the tree,MinNum
is the minimum total weight of the instances in a leaf,MinVarianceProp
is the minimum proportion of the total variance
-
DecisionTreeBasedMethod
Initializes the parameters- Parameters:
path
- the path of the projectconfidence
- the confidence factor used for pruningminNum
- the minimum number of samples per leaf
-
DecisionTreeBasedMethod
public DecisionTreeBasedMethod(String path, int randomTreeKValue, int randomTreeMaxDepth, double randomTreeMinNum, double randomTreeMinVarianceProp) Initializes the parameters- Parameters:
path
- the path of the projectrandomTreeKValue
- the number of randomly chosen attributesrandomTreeMaxDepth
- the maximum depth of the treerandomTreeMinNum
- the minimum total weight of the instances in a leafrandomTreeMinVarianceProp
- the minimum proportion of the total variance (over all the data) required for split
-
-
Method Details
-
selectedFeatureSubset
Finds the feature subset from the nodes of the created tree (Used for C4.5 and Random Tree)- 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 Decision Tree based methods- Specified by:
evaluateFeatures
in classFeatureSelection
-