coser.classifiers.trees
类 BuildAndTestTreeCostC45

java.lang.Object
  继承者 coser.classifiers.trees.BuildAndTestTreeCostC45

public class BuildAndTestTreeCostC45
extends java.lang.Object

Summary: Build and test decision tree. Run different algorithms.

Author: Fan Min minfanphd@163.com
Copyright: The source code and all documents are open and free. PLEASE keep this header while revising the program.
Organization: Lab of Granular Computing, Zhangzhou Normal University, Fujian 363000, China.
Project: The cost-sensitive rough sets project.

Progress: Half done.
Written time: November 5, 2011.
Last modify time: January 27, 2012.


字段摘要
修饰符 和 类型 字段 和 描述
static boolean[] attributeTested
          The attributes which are tested.
static int[] attributeTestedCounts
          The tested counts of each attribute
 int[][] costMatrix
          The misclassification cost matrix
static int[] individualTestCostArray
          The test cost of the decision system.
 
构造方法摘要
构造函数 和 描述
BuildAndTestTreeCostC45(BothCostsNominalDecisionSystem paraNominalDecisionSystem, double paraLambdaLowerBound, double paraLambdaUpperBound, double paraLambdaStepLength, int paraPruneStrategy, int paraTestStrategy, double paraTrainsetProportion, boolean paraDetail)
          The third constructor
BuildAndTestTreeCostC45(BothCostsNominalDecisionSystem paraBothCostsNominalDecisionSystem, double paraLambda, int paraPruneStrategy, int paraTestStrategy, double paraTrainsetProportion, boolean paraDetail)
          The first constructor
BuildAndTestTreeCostC45(BothCostsNumericDecisionSystem paraNumericDecisionSystem, double paraLambdaLowerBound, double paraLambdaUpperBound, double paraLambdaStepLength, int paraPruneStrategy, int paraTestStrategy, double paraTrainsetProportion, boolean paraDetail)
          The fourth constructor
BuildAndTestTreeCostC45(BothCostsNumericDecisionSystem paraBothCostsNumericDecisionSystem, double paraLambda, int paraPruneStrategy, int paraTestStrategy, double paraTrainsetProportion, boolean paraDetail)
          The second constructor
 
方法摘要
修饰符 和 类型 方法 和 描述
 java.lang.String batchDecisionTreeC45(double paraLambdaLowerBound, double paraLambdaUpperBound, double paraLambdaStepLength, int paraExperiments)
          Batch experiments
 java.lang.String batchDecisionTreeC45Rank(double paraLambdaLowerBound, double paraLambdaUpperBound, double paraLambdaStepLength, int paraExperiments)
          Batch decision tree experiments with competition ranking.
 java.lang.String batchDecisionTreeMisCostVariety(double paraLambdaLowerBound, double paraLambdaUpperBound, double paraLambdaStepLength, int paraExperiments)
          Batch decision tree experiments considering the variety of the misclassification matrix.
 CostJ48 buildDecisionTree()
          Build the decision tree.
 double evaluateCost(CostJ48 paraCostJ48, Instances paraTest)
          Evaluate the cost of the generated decision tree.
 double evaluateDecisionTree(CostJ48 paraCostJ48, Instances paraTest)
          Evaluate the decistion tree on the test data set.
 void postPrune(coser.classifiers.trees.csj48.ClassifierTree paraRoot)
          Post prune
 void postPruneNumeric(coser.classifiers.trees.csj48.ClassifierTree paraRoot)
          Post prune the numeric cost-sensitive decision tree.
 boolean postPruneNumericHalf()
          Post prune the numeric cost-sensitive decision tree.
 void postPruneSymbolic(coser.classifiers.trees.csj48.ClassifierTree paraRoot)
          Post prune the symbolic cost-sensitive decision tree.
 void setTrainsetProportion(double paraTrainsetProportion)
          Set the train set proportion
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

individualTestCostArray

public static int[] individualTestCostArray
The test cost of the decision system.


costMatrix

public int[][] costMatrix
The misclassification cost matrix


attributeTested

public static boolean[] attributeTested
The attributes which are tested.


attributeTestedCounts

public static int[] attributeTestedCounts
The tested counts of each attribute

构造方法详细信息

BuildAndTestTreeCostC45

public BuildAndTestTreeCostC45(BothCostsNominalDecisionSystem paraBothCostsNominalDecisionSystem,
                               double paraLambda,
                               int paraPruneStrategy,
                               int paraTestStrategy,
                               double paraTrainsetProportion,
                               boolean paraDetail)
The first constructor

参数:
paraBothCostsNominalDecisionSystem - The given nominal decision system
paraLambda - The parameter lambda
paraPruneStrategy - The pruning stragy
paraTestStrategy - The testing strategy
paraTrainsetProportion - The proportion of training data set
paraDetail - If reveal the running details

BuildAndTestTreeCostC45

public BuildAndTestTreeCostC45(BothCostsNumericDecisionSystem paraBothCostsNumericDecisionSystem,
                               double paraLambda,
                               int paraPruneStrategy,
                               int paraTestStrategy,
                               double paraTrainsetProportion,
                               boolean paraDetail)
The second constructor

参数:
paraBothCostsNumericDecisionSystem - The given both costs numeric decision system
paraLambda - The parameter lambda
paraPruneStrategy - The pruning stragy
paraTestStrategy - The testing strategy
paraTrainsetProportion - The proportion of training data set
paraDetail - If reveal the running details

BuildAndTestTreeCostC45

public BuildAndTestTreeCostC45(BothCostsNominalDecisionSystem paraNominalDecisionSystem,
                               double paraLambdaLowerBound,
                               double paraLambdaUpperBound,
                               double paraLambdaStepLength,
                               int paraPruneStrategy,
                               int paraTestStrategy,
                               double paraTrainsetProportion,
                               boolean paraDetail)
The third constructor

参数:
paraNominalDecisionSystem - The given both costs nominal decision system
paraLambdaLowerBound - The lower bound of parameter lambda
paraLambdaUpperBound - The upper bound of parameter lambda
paraLambdaStepLength - The step length of parameter lambda
paraPruneStrategy - The pruning strategy
paraTestStrategy - The testing strategy
paraTrainsetProportion - The proportion of training data set
paraDetail - If reveal running details

BuildAndTestTreeCostC45

public BuildAndTestTreeCostC45(BothCostsNumericDecisionSystem paraNumericDecisionSystem,
                               double paraLambdaLowerBound,
                               double paraLambdaUpperBound,
                               double paraLambdaStepLength,
                               int paraPruneStrategy,
                               int paraTestStrategy,
                               double paraTrainsetProportion,
                               boolean paraDetail)
The fourth constructor

参数:
paraNumericDecisionSystem - The given both costs nominal decision system
paraLambdaLowerBound - The lower bound of parameter lambda
paraLambdaUpperBound - The upper bound of parameter lambda
paraLambdaStepLength - The step length of parameter lambda
paraPruneStrategy - The pruning strategy
paraTestStrategy - The testing strategy
paraTrainsetProportion - The proportion of training data set
paraDetail - If reveal running details
方法详细信息

buildDecisionTree

public CostJ48 buildDecisionTree()
Build the decision tree.

返回:
The CostJ48 object

batchDecisionTreeC45

public java.lang.String batchDecisionTreeC45(double paraLambdaLowerBound,
                                             double paraLambdaUpperBound,
                                             double paraLambdaStepLength,
                                             int paraExperiments)
                                      throws java.lang.Exception
Batch experiments

参数:
paraLambdaLowerBound - The lower bound of lambda
paraLambdaUpperBound - The upper bound of lambda
paraLambdaStepLength - The step length of lambda
paraExperiments - The experiment counts
返回:
The message representing results.
抛出:
java.lang.Exception - Exceptions

batchDecisionTreeC45Rank

public java.lang.String batchDecisionTreeC45Rank(double paraLambdaLowerBound,
                                                 double paraLambdaUpperBound,
                                                 double paraLambdaStepLength,
                                                 int paraExperiments)
                                          throws java.lang.Exception
Batch decision tree experiments with competition ranking.

参数:
paraLambdaLowerBound - The lower bound of lambda
paraLambdaUpperBound - The upper bound of lambda
paraLambdaStepLength - The step length of lambda
paraExperiments - The experiment counts
返回:
The probability of the correct classification on the test data set.
抛出:
java.lang.Exception - Exceptions

batchDecisionTreeMisCostVariety

public java.lang.String batchDecisionTreeMisCostVariety(double paraLambdaLowerBound,
                                                        double paraLambdaUpperBound,
                                                        double paraLambdaStepLength,
                                                        int paraExperiments)
                                                 throws java.lang.Exception
Batch decision tree experiments considering the variety of the misclassification matrix.

参数:
paraLambdaLowerBound - The lower bound of lambda value
paraLambdaUpperBound - The upper bound of lambda value
paraLambdaStepLength - The lambda step length
paraExperiments - The number of experiments
返回:
The probability of the correct classification on the test data set.
抛出:
java.lang.Exception

evaluateDecisionTree

public double evaluateDecisionTree(CostJ48 paraCostJ48,
                                   Instances paraTest)
Evaluate the decistion tree on the test data set.

参数:
paraCostJ48 - The cost J48 to be evaluted.
paraTest - The testing data set.
返回:
The probability of the correct classification on the test data set.

evaluateCost

public double evaluateCost(CostJ48 paraCostJ48,
                           Instances paraTest)
Evaluate the cost of the generated decision tree.

参数:
paraCostJ48 - The cost J48 to be evaluted.
paraTest - The testing data set.
返回:
The average cost including the test cost and the misclassification cost.

postPrune

public void postPrune(coser.classifiers.trees.csj48.ClassifierTree paraRoot)
Post prune

参数:
paraRoot - The classifier tree root.

postPruneSymbolic

public void postPruneSymbolic(coser.classifiers.trees.csj48.ClassifierTree paraRoot)
Post prune the symbolic cost-sensitive decision tree.

参数:
paraRoot - The classifier tree root.

postPruneNumeric

public void postPruneNumeric(coser.classifiers.trees.csj48.ClassifierTree paraRoot)
Post prune the numeric cost-sensitive decision tree.

参数:
paraRoot - The classifier tree root.

postPruneNumericHalf

public boolean postPruneNumericHalf()
Post prune the numeric cost-sensitive decision tree.
Half post-pruning

返回:
A boolean representing if the tree is pruned.

setTrainsetProportion

public void setTrainsetProportion(double paraTrainsetProportion)
Set the train set proportion

参数:
paraTrainsetProportion - The proportion of the training set.