coser.datamodel.decisionsystem
类 BothCostsNumericDecisionSystem

java.lang.Object
  继承者 Instances
      继承者 coser.datamodel.decisionsystem.RoughDecisionSystem
          继承者 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
              继承者 coser.datamodel.decisionsystem.NumericDecisionSystem
                  继承者 coser.datamodel.decisionsystem.BothCostsNumericDecisionSystem

public class BothCostsNumericDecisionSystem
extends NumericDecisionSystem

Summary: Keep the balance between test cost and misclassification cost. Cost data are defined in class CostSenstiveDecisionSystem. For more information of the data model please refer to our papers:
\@INPROCEEDINGS{MinZhu11MinimalCost,
author = {Fan Min and William Zhu},
title = {Minimal cost attribute reduction through backtracking},
booktitle = {Proceedings of International Conference on Database Theory and Application},
series = {FGIT-DTA/BSBT, CCIS},
volume = {258},
year = {2011},
pages = {100--107}
}

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: The optimal feature subset can be obtained now.
Written time: Feburary 23, 2012.
Last modify time: Feburary 23, 2012.


字段摘要
修饰符 和 类型 字段 和 描述
(专用软件包)  double optimalAverageCost
          The optimal average cost.
 
从类 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem 继承的字段
alpha, COMPLEX_COMMON_TEST_COST, COST_TYPE_MONEY, COST_TYPE_TESTING_TIME, COST_TYPE_WAITING_TIME, currentReductCost, currentReductTime, currentReductTotalTestCost, DEFAULT_AVERAGE_NUMBER_OF_TESTS_PER_GROUP, groupCommonTestCostArray, groupInclusionArray, groupInclusionMatrix, IMPOSSIBLE_COST, individualCostDistributions, individualCostLowerBounds, individualCostMatrix, individualCostRandom, individualCostUpperBounds, minimalTestCostReduct, minimalTimeReduct, misclassificationCostMatrix, misclassificationCostSumArray, NORMAL, optimalReductTestCost, optimalReductTime, PARETO, randomMode, SIMPLE_COMMON_TEST_COST, TEST_COST_INDEPENDENT, TEST_COST_TYPES, testCostConstraint, testCostRelationship, testingOrderMatrix, timeParts, totalTimeConstraint, unifiedMisclassificationCost, UNIFORM
 
从类 coser.datamodel.decisionsystem.RoughDecisionSystem 继承的字段
allConditions, allReducts, allReductsFilename, allSubreducts, allSubreductsFilename, arffFilename, backtrackSteps, candidateReductArray, candidateSubreductArray, candidateSubreductConsistencyArray, classSize, CONDITIONAL_ENTROPY, consistency, core, currentReduct, currentSelectedAttributes, endTime, MAJORITY, minimalReductSize, numberOfCandidateReducts, numberOfCandidateSubreducts, numberOfConditions, numberOfInstances, optimalReduct, POSITIVE_REGION, runTimeInformation, startTime, totalEntropy, totalMajority, totalPositiveRegion
 
构造方法摘要
构造函数 和 描述
BothCostsNumericDecisionSystem(BothCostsNumericDecisionSystem paraDecisionSystem)
          Copy everything.
BothCostsNumericDecisionSystem(java.io.Reader reader)
          Construct the decision system.
 
方法摘要
修饰符 和 类型 方法 和 描述
 double averageMisclassificationCost(boolean[] paraTestSet)
          Compute the average misclassification cost given a test set.
 double balancedClassEntropy(Instances paraData)
          Computes the balanced entropy of a dataset by considering the class attribute and misclassification costs.
 double balancedConditionalEntropy()
          Computes the balanced conditional entropy of this dataset.
 double balancedConditionalEntropy(boolean[] paraSelectedAttributes)
          Computes the conditional entropy of a dataset.
 double balancedConditionalEntropy(long paraSelectedAttributesByLong)
          Computes the balanced conditional entropy of a dataset.
 double balancedInformationGain(int paraAttributeIndex)
          Computes the balanced information gain of an attribute.
 double costGain(Attribute paraAtt)
          Compute the cost gain given an attribute.
 BothCostsNumericDecisionSystem[] divideInTwo(double paraPercentage)
          Divide the decision system in two according to the given percentage.
 void oneOptimalBacktrack(Instances[] paraImpureInstancesArray, boolean[] paraSelectedTests, int paraTestLowerBound, double paraExistingMisclassificationCost, double paraExistingTestCost, boolean paraFast)
          Compute one optimal reduct using backtrack.
 double optimalCostReductBacktrack(boolean paraFast)
          Compute the optimal cost reduct through backtracking.
 void refreshTestCost()
          Refresh the test-cost settings.
 java.lang.String toString()
          Print the object message.
 double totalCost(boolean[] paraTestSet)
          Compute the total cost given a test set.
 double totalCost(long paraTestSet)
          Compute the total cost given a test set.
 
从类 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem 继承的方法
averageMisclassificationCost, averageMisclassificationCost, bestClassValue, computeAdditiveCost, computeExceedingFactor, computeOptimalTestCost, computeReductTestCost, computeReductWaitingTime, computeTestCost, computeTestCost, copyForClone, generateIndividualCosts, generateOneCost, getClassificationCost, getDistributionString, getIndividualCost, getIndividualTestCost, getIndividualTestCostArray, getMisclassificationCostMatrix, getOptimalReductTestCost, getReductTotalTestCost, initializeForReduction, setAlpha, setComplexCommonTestCostArrays, setCostRandomMode, setIndividualCostArray, setIndividualCostBounds, setIndividualCostDistribution, setMisclassificationCostMatrix, setMisclassificationCostMatrix, setSimpleCommonTestCostArrays, setTestCostsRelationShip, setUnifiedMisclassificationCost, sortByTestCost
 
从类 coser.datamodel.decisionsystem.RoughDecisionSystem 继承的方法
classEntropy, classEntropy, computeConsistency, computeConsistency, computeConsistency, computeCore, computeCore, conditionalEntropy, conditionalEntropy, conditionalEntropy, conditionalEntropy, copyForClone, delete, entropyReciprocal, entropyReciprocal, entropyReciprocal, entropyReciprocal, entropyReciprocal, getAllReductsFilename, getAllReductsString, getAllSubreductsFilename, getArffFilename, getArffSource, getBacktrackSteps, getCandidateSubreductConsistencyArray, getCurrentReduct, getCurrentReductIndex, getMeasure, getNumberOfConditions, getOptimalReduct, getReductionTime, getReductString, getRunTimeInformation, hasMissingValue, isNominal, isNormalized, isNumeric, majority, majority, majority, normalize, positiveRegion, positiveRegion, positiveRegion, printAllReducts, readAllReducts, readAllReducts, readAllSubreducts, readAllSubreducts, setAllReductsFilename, setAllReductsFilename, setAllSubreductsFilename, setAllSubreductsFilename, setArffFilename, setCurrentReduct, setCurrentReduct, setMeasure, writeAllReducts
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

optimalAverageCost

double optimalAverageCost
The optimal average cost.

构造方法详细信息

BothCostsNumericDecisionSystem

public BothCostsNumericDecisionSystem(java.io.Reader reader)
                               throws java.io.IOException,
                                      java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.io.IOException
java.lang.Exception

BothCostsNumericDecisionSystem

public BothCostsNumericDecisionSystem(BothCostsNumericDecisionSystem paraDecisionSystem)
                               throws java.lang.Exception
Copy everything. Essentially clone.

抛出:
java.lang.Exception
方法详细信息

divideInTwo

public BothCostsNumericDecisionSystem[] divideInTwo(double paraPercentage)
                                             throws java.lang.Exception
Divide the decision system in two according to the given percentage.

覆盖:
类 RoughDecisionSystem 中的 divideInTwo
参数:
paraPercentage - The percentage of instances in the first subset.
返回:
Two decision systems in an array.
抛出:
java.lang.Exception

averageMisclassificationCost

public double averageMisclassificationCost(boolean[] paraTestSet)
                                    throws java.lang.Exception
Compute the average misclassification cost given a test set. The cost should be zero while not misclassified.

覆盖:
类 CostSensitiveDecisionSystem 中的 averageMisclassificationCost
参数:
paraTestSet - The given test set with the form of a boolean array.
抛出:
java.lang.Exception - if the given string does not contain enough boolean values.
另请参见:
CostSensitiveDecisionSystem.averageMisclassificationCost(Instances[])

totalCost

public double totalCost(long paraTestSet)
                 throws java.lang.Exception
Compute the total cost given a test set.

参数:
paraTestSet - The given test set with the form of a long.
抛出:
java.lang.Exception - if the given string does not contain enough integers.

totalCost

public double totalCost(boolean[] paraTestSet)
                 throws java.lang.Exception
Compute the total cost given a test set.

参数:
paraTestSet - The given test set with the form of a boolean array.
抛出:
java.lang.Exception - if the given string does not contain enough integers.

costGain

public double costGain(Attribute paraAtt)
                throws java.lang.Exception
Compute the cost gain given an attribute.

参数:
paraAtt - The given attribute (test).
返回:
the cost gain. Or -inf if the misclassification cost does not decrease.
抛出:
java.lang.Exception

balancedClassEntropy

public double balancedClassEntropy(Instances paraData)
                            throws java.lang.Exception
Computes the balanced entropy of a dataset by considering the class attribute and misclassification costs. Revised from classEntropy().

参数:
paraData - should be a subset of current decision system.
返回:
the entropy of the data's class distribution
抛出:
java.lang.Exception
另请参见:
RoughDecisionSystem.classEntropy(Instances)

balancedConditionalEntropy

public double balancedConditionalEntropy()
                                  throws java.lang.Exception
Computes the balanced conditional entropy of this dataset.

返回:
the balanced conditional entropy of all attributes.
抛出:
java.lang.Exception

balancedConditionalEntropy

public double balancedConditionalEntropy(long paraSelectedAttributesByLong)
                                  throws java.lang.Exception
Computes the balanced conditional entropy of a dataset.

参数:
paraSelectedAttributesByLong - the selected attributes represented by a long int.
返回:
the balanced conditional entropy of selected attributes.
抛出:
java.lang.Exception

balancedConditionalEntropy

public double balancedConditionalEntropy(boolean[] paraSelectedAttributes)
                                  throws java.lang.Exception
Computes the conditional entropy of a dataset.

参数:
paraSelectedAttributes - the selected attributes.
返回:
the conditional entropy of selected attributes.
抛出:
java.lang.Exception

balancedInformationGain

public double balancedInformationGain(int paraAttributeIndex)
                               throws java.lang.Exception
Computes the balanced information gain of an attribute.

参数:
paraAttributeIndex - the index of the attribute.
返回:
the conditional entropy of selected attributes.
抛出:
java.lang.Exception

optimalCostReductBacktrack

public double optimalCostReductBacktrack(boolean paraFast)
                                  throws java.lang.Exception
Compute the optimal cost reduct through backtracking.

参数:
paraFast - Whether or not use the fast version. This only influences the use of the third pruning technique.
返回:
The optimal (minimal) cost.
抛出:
java.lang.Exception - if the given string does not contain enough integers.

oneOptimalBacktrack

public void oneOptimalBacktrack(Instances[] paraImpureInstancesArray,
                                boolean[] paraSelectedTests,
                                int paraTestLowerBound,
                                double paraExistingMisclassificationCost,
                                double paraExistingTestCost,
                                boolean paraFast)
                         throws java.lang.Exception
Compute one optimal reduct using backtrack. The only prune technique is to consider the test cost vs. the total cost of the currently best solution.

参数:
paraImpureInstancesArray - Inpure subtables.
paraSelectedTests - Already selected tests.
paraTestLowerBound - The lower bound of test index. We only need forward search.
paraExistingMisclassificationCost - The misclassification cost with the current test set.
paraExistingTestCost - The cost of already selected tests.
paraFast - Whether or not use the fast version. This only influences the use of the third pruning technique.
抛出:
java.lang.Exception

refreshTestCost

public void refreshTestCost()
                     throws java.lang.Exception
Refresh the test-cost settings.

覆盖:
类 CostSensitiveDecisionSystem 中的 refreshTestCost
抛出:
java.lang.Exception

toString

public java.lang.String toString()
Print the object message.

覆盖:
类 NumericDecisionSystem 中的 toString
返回:
object status.