Class DecisionTreeBasedMethod


public class DecisionTreeBasedMethod extends TreeBasedMethods
This java class is used to implement the decision tree based methods.
Author:
Sina Tabakhi
See Also:
  • 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

      public DecisionTreeBasedMethod(Object... arguments)
      Initializes the parameters
      Parameters:
      arguments - array of parameter contains

      if the type of tree is C4.5 (path, tree type, confidenceValue, minNumSampleInLeaf) in which path 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 leaf

      if the type of tree is random tree (path, tree type, KValue, MaxDepth, MinNum,, MinVarianceProp) in which path 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

      public DecisionTreeBasedMethod(String path, double confidence, int minNum)
      Initializes the parameters
      Parameters:
      path - the path of the project
      confidence - the confidence factor used for pruning
      minNum - 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 project
      randomTreeKValue - the number of randomly chosen attributes
      randomTreeMaxDepth - the maximum depth of the tree
      randomTreeMinNum - the minimum total weight of the instances in a leaf
      randomTreeMinVarianceProp - the minimum proportion of the total variance (over all the data) required for split
  • Method Details

    • selectedFeatureSubset

      protected void selectedFeatureSubset(String tree)
      Finds the feature subset from the nodes of the created tree (Used for C4.5 and Random Tree)
      Specified by:
      selectedFeatureSubset in class TreeBasedMethods
      Parameters:
      tree - the generated tree based on the train set
    • buildClassifier

      protected String buildClassifier(weka.core.Instances dataTrain)
      Generates a classifier using input data
      Specified by:
      buildClassifier in class TreeBasedMethods
      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 class FeatureSelection