coser.datamodel.decisionsystem
类 TestCostConstraintNominalDecisionSystem

java.lang.Object
  继承者 Instances
      继承者 coser.datamodel.decisionsystem.RoughDecisionSystem
          继承者 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
              继承者 coser.datamodel.decisionsystem.NominalDecisionSystem
                  继承者 coser.datamodel.decisionsystem.TestCostNominalDecisionSystem
                      继承者 coser.datamodel.decisionsystem.TestCostConstraintNominalDecisionSystem
直接已知子类:
TestCostConstraintNominalDecisionSystemGA

public class TestCostConstraintNominalDecisionSystem
extends TestCostNominalDecisionSystem

Summary: Decision system with test constraint while constructing a subreduct. It is devoted to test cost constraint feature selection. For more information of the data model please refer to our papers:
For test-cost constraint attribute reduction exhaustive algorithms please refer to:
\@INPROCEEDINGS{MinZhu11TheOptimal,
author = {Fan Min and William Zhu},
title = {The optimal test cost constraint sub-reduct problem},
booktitle = {Proceedings of Rough Set and Knowledge Technology},
pages = {57--62},
series = {LNAI},
volume = {6954},
year = {2011}
}

For the set of all sub-reducts please refer to:
\@INPROCEEDINGS{MinZhu11BASS,
author = {Fan Min and William Zhu},
title = {Optimal sub-reducts in the dynamic environment},
booktitle = {Proceedings of {IEEE} International Conference on Granular Computing},
pages = {457--462},
year = {2011}
}

For test-cost constraint attribute reduction heuristic algorithms please refer to:
\@INPROCEEDINGS{MinZhu11Attribute,
author = {Fan Min and William Zhu},
title = {Attribute reduction with test-cost constraint},
booktitle = {Journal of Electronic Science and Technology of China},
volumn = {9},
number = {2},
year = {2011}
}

For the CSP viewpoint of the problem please refer to:
\@article{MinHuZhu12Feature,
author = {Fan Min and Qinghua Hu and William Zhu},
title = {Feature selection with test cost constraint},
journal = {submitted to Knowledge-Based Systems},
year = {2012}
}

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 lambda-weighted reduction algorithm implemented in \cite{MinZhu11Attribute}
The heuristic algorithms to one optimal reduct \cite{MinZhu11TheOptimal} and the set of all optimal reducts \cite{MinZhu11BASS} are implemented. Algorithms from the viewpoint of CSP are implemented. Written time: June 14, 2011. Separated from TestCostNominalDecisionSystem.java
Last modify time: January 12, 2011.


字段摘要
修饰符 和 类型 字段 和 描述
static int ALL_EXHAUSTIVE
          all exhaustive algorithms.
static int BASS
          A backtrack algorithm to all sub-reducts.
(专用软件包)  boolean[] currentSubreduct
          The current sub-reduct.
(专用软件包)  double currentSubreductEntropy
          The entropy of the current sub-reduct.
(专用软件包)  int currentSubreductTestCost
          The test-cost of the current sub-reduct.
(专用软件包)  long[] exhaustiveSubreductResultArray
          An array to store running information of exhaustive algorithm for sub-reduct.
static int MAX_CANDIDATES_FOR_BASS
          Maximal number of candidates for the AROP algorithm, which is exhaustive.
static int MAX_CANDIDATES_FOR_SESRA
          Maximal number of candidates for the SESRA algorithm, which is exhaustive.
static int MAX_TESTS_FOR_EXHAUSTIVE
          Maximal number of tests for exhaustive algorithms.
static int OPR_RESULT_LENGTH
          The array length of exhaustiveSubreductResultArray.
(专用软件包)  int optimalSubreductConsistency
          The consistency of the optimal sub-reduct.
(专用软件包)  int optimalSubreductCost
          The test cost of the sub-reduct.
(专用软件包)  double optimalSubreductEntropy
          The entropy of the optimal sub-reduct.
(专用软件包)  long[] optimalSubreductsArray
          The set of all optimal sub-reducts.
static int PURE_BACKTRACK
          A backtrack algorithm to one optimal sub-reduct.
static int SESRA
          The straightforward exhaustive sub-reduct algorithm
static int SESRAstar
          The straightforward exhaustive sub-reduct algorithm
 
从类 coser.datamodel.decisionsystem.TestCostNominalDecisionSystem 继承的字段
lambda, weighting
 
从类 coser.datamodel.decisionsystem.NominalDecisionSystem 继承的字段
ATTRIBUTES_COMBINATIONS, BACKTRACK, EXPONENTIAL, reductMinimalSize
 
从类 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, 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
 
构造方法摘要
构造函数 和 描述
TestCostConstraintNominalDecisionSystem(TestCostNominalDecisionSystem paraDecisionSystem)
          Construct the decision system.
 
方法摘要
修饰符 和 类型 方法 和 描述
 void backtrackForSubreducts(Instances[] paraInstances, long paraSeletctedAttributes, int paraExistingTestCost, int paraLowerBound)
          Backtrack approach to produce candidate subreducts.
protected  long[] computeConstraintSatisfiedTestSetsBacktrack(int paraConstraint)
          Compute all test sets satisfying the test cost constraint using the backtrack approach.
protected  long[] computeConstraintSatisfiedTestSetsBacktrack(int paraConstraint, boolean[] paraAvailableTests)
          Compute all test sets satisfying the test cost constraint using the backtrack approach.
 java.lang.String constraintReductionBacktrack(int paraConstraint)
          Find an optimal sub-reduct using the backtrack algorithm.
 java.lang.String constraintReductionBASS(int paraConstraint)
          Find an optimal subreduct using the BASS algorithm.
 java.lang.String constraintReductionSESRA(int paraConstraint)
          Find an optimal sub-reduct using the SESRA algorithm.
 java.lang.String constraintReductionSESRA(int paraConstraint, boolean[] paraAvailableTests)
          Find an optimal sub-reduct using the SESRA algorithm.
 java.lang.String constraintReductionSESRAstar(int paraConstraint)
          Find an optimal sub-reduct using the SESRA star algorithm.
 boolean constraintSatisfied(boolean[] paraSelectedTests, int paraConstraint)
          Judge whether or not the given test set satisfy the constraint.
 boolean[] entropyBasedLambdaWeightedConstraintReduction(double paraLambda, int paraConstraint)
          Find a (possibly) minimal entropy sub-reduct using the lambda-weighted reduction algorithm.
 long[] getExhaustiveSubreductResults()
          Get sub-reduct results (exhaustive algorithms).
 long getOneOptimalSubreduct()
          Get one optimal sub-reduct.
 int getOptimalSubreductConsistency()
          Get the optimal sub-reduct consistency.
 int getOptimalSubreductCost()
          Get the optimal sub-reduct cost.
 double getSubreductEntropy()
          Get the entropy of the current sub-reduct.
 java.lang.String getSubreductString()
          Get the current sub-reduct with the form of String.
 int getSubreductTestCost()
          Get the test-cost of the current sub-reduct.
 boolean[] posBasedLambdaWeightedConstraintReduction(double paraLambda, int paraConstraint)
          Find a (possibly) minimal positive sub-reduct using the lambda-weighted reduction algorithm.
protected  long[] removeShortTestSets(long[] paraInitialTestSetArray)
          Remove short test sets such that we do not have to compute their consistency.
protected  long[] removeShortTestSets(long[] paraInitialTestSetArray, int paraNumberOfTestSets)
          Remove short test sets such that we do not have to compute their consistency.
protected  long[] selectMaximalConsistencySubreducts(long[] paraSubreducts)
          Select sub-reducts with the maximal consistency.
 java.lang.String toString()
          For toString().
 
从类 coser.datamodel.decisionsystem.TestCostNominalDecisionSystem 继承的方法
computeOptimalReductBacktrack, entropyBasedLambdaWeightedReduction, isCurrentReductOptimal, optimalReductBacktrack, removeRedundantAttributes, setLambda, setWeighting, sortByTestCost
 
从类 coser.datamodel.decisionsystem.NominalDecisionSystem 继承的方法
buildCandidateReducts, computeAllReductsBacktrack, computeAllReductsBacktrack, computeAllReductsExhaustive, computeAllReductsExhaustive, computeAllReductsExhaustive, computeAllReductsExhaustiveExponential, computeAllSubreducts, computeConsistency, computeCore, conditionalEntropy, entropyBasedReduction, informationGain, informationGain, main, majority, majority, positiveRegion, positiveRegion, removeRedundantSubreducts, splitData, splitData, splitData
 
从类 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem 继承的方法
averageMisclassificationCost, averageMisclassificationCost, averageMisclassificationCost, averageMisclassificationCost, bestClassValue, computeAdditiveCost, computeExceedingFactor, computeOptimalTestCost, computeReductTestCost, computeReductWaitingTime, computeTestCost, computeTestCost, copyForClone, generateIndividualCosts, generateOneCost, getClassificationCost, getDistributionString, getIndividualCost, getIndividualTestCost, getIndividualTestCostArray, getMisclassificationCostMatrix, getOptimalReductTestCost, getReductTotalTestCost, initializeForReduction, refreshTestCost, setAlpha, setComplexCommonTestCostArrays, setCostRandomMode, setIndividualCostArray, setIndividualCostBounds, setIndividualCostDistribution, setMisclassificationCostMatrix, setMisclassificationCostMatrix, setSimpleCommonTestCostArrays, setTestCostsRelationShip, setUnifiedMisclassificationCost
 
从类 coser.datamodel.decisionsystem.RoughDecisionSystem 继承的方法
classEntropy, classEntropy, computeConsistency, computeConsistency, computeCore, conditionalEntropy, conditionalEntropy, copyForClone, delete, divideInTwo, 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, normalize, 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
 

字段详细信息

MAX_TESTS_FOR_EXHAUSTIVE

public static final int MAX_TESTS_FOR_EXHAUSTIVE
Maximal number of tests for exhaustive algorithms.

另请参见:
常量字段值

MAX_CANDIDATES_FOR_SESRA

public static final int MAX_CANDIDATES_FOR_SESRA
Maximal number of candidates for the SESRA algorithm, which is exhaustive.

另请参见:
常量字段值

MAX_CANDIDATES_FOR_BASS

public static final int MAX_CANDIDATES_FOR_BASS
Maximal number of candidates for the AROP algorithm, which is exhaustive. It is unlikely that a reduct contains more than 11 attributes

另请参见:
常量字段值

SESRA

public static final int SESRA
The straightforward exhaustive sub-reduct algorithm

另请参见:
常量字段值

SESRAstar

public static final int SESRAstar
The straightforward exhaustive sub-reduct algorithm

另请参见:
常量字段值

BASS

public static final int BASS
A backtrack algorithm to all sub-reducts.

另请参见:
常量字段值

PURE_BACKTRACK

public static final int PURE_BACKTRACK
A backtrack algorithm to one optimal sub-reduct.

另请参见:
常量字段值

ALL_EXHAUSTIVE

public static final int ALL_EXHAUSTIVE
all exhaustive algorithms.

另请参见:
常量字段值

currentSubreduct

boolean[] currentSubreduct
The current sub-reduct. Only for test-cost constraint reduction.


currentSubreductEntropy

double currentSubreductEntropy
The entropy of the current sub-reduct. Only for test-cost constraint reduction.


currentSubreductTestCost

int currentSubreductTestCost
The test-cost of the current sub-reduct. Only for test-cost constraint reduction.


optimalSubreductEntropy

double optimalSubreductEntropy
The entropy of the optimal sub-reduct. Only for test-cost constraint reduction.


optimalSubreductConsistency

int optimalSubreductConsistency
The consistency of the optimal sub-reduct. Conditional entropy is divided by 100, then the reciprocal is used.


optimalSubreductCost

int optimalSubreductCost
The test cost of the sub-reduct.


optimalSubreductsArray

long[] optimalSubreductsArray
The set of all optimal sub-reducts.


OPR_RESULT_LENGTH

public static int OPR_RESULT_LENGTH
The array length of exhaustiveSubreductResultArray. Can be extended.


exhaustiveSubreductResultArray

long[] exhaustiveSubreductResultArray
An array to store running information of exhaustive algorithm for sub-reduct. The length is 10. The content is stored as follows:
[0]: the number of test sets satisfying the constraint.
[1]: the number of test sets with consistency checked.
[2]: the number of maximal consistency test sets.
[3]: the number of minimal cost test sets.
[4]: the time for candidates building.
[5]: the time for computing consistency.
[6]: the time for the execution.
[7]: the number of maximal consistency test sets. Applicable to SESRAstar and AROP_S to count the number after reduction.
[8]: backtrack steps.
[9]: the length of the sub-reduct.

构造方法详细信息

TestCostConstraintNominalDecisionSystem

public TestCostConstraintNominalDecisionSystem(TestCostNominalDecisionSystem paraDecisionSystem)
                                        throws java.io.IOException,
                                               java.lang.Exception
Construct the decision system. Simply copy everything of the given decision system.

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

getOptimalSubreductConsistency

public int getOptimalSubreductConsistency()
                                   throws java.lang.Exception
Get the optimal sub-reduct consistency.

返回:
the optimal test-cost reducts.
抛出:
java.lang.Exception

getOneOptimalSubreduct

public long getOneOptimalSubreduct()
                            throws java.lang.Exception
Get one optimal sub-reduct.

返回:
One optimal sub-reduct
抛出:
java.lang.Exception

getOptimalSubreductCost

public int getOptimalSubreductCost()
Get the optimal sub-reduct cost.

返回:
the optimal sub-reduct cost

getSubreductTestCost

public int getSubreductTestCost()
Get the test-cost of the current sub-reduct.

返回:
the test cost of the current sub-reduct.

getSubreductEntropy

public double getSubreductEntropy()
Get the entropy of the current sub-reduct.

返回:
the entropy of the sub-reduct.

getSubreductString

public java.lang.String getSubreductString()
Get the current sub-reduct with the form of String.

返回:
the reduct with the form of boolean vector.

computeConstraintSatisfiedTestSetsBacktrack

protected long[] computeConstraintSatisfiedTestSetsBacktrack(int paraConstraint)
                                                      throws java.lang.Exception
Compute all test sets satisfying the test cost constraint using the backtrack approach. This is the first step of SESRA and SESRA*.

参数:
paraConstraint - the test cost upper bound.
返回:
all test setss satisfying the constraint.
抛出:
java.lang.Exception

computeConstraintSatisfiedTestSetsBacktrack

protected long[] computeConstraintSatisfiedTestSetsBacktrack(int paraConstraint,
                                                             boolean[] paraAvailableTests)
                                                      throws java.lang.Exception
Compute all test sets satisfying the test cost constraint using the backtrack approach.

参数:
paraConstraint - the test cost upper bound.
paraAvailableTests - which tests are available.
返回:
all test setss satisfying the constraint.
抛出:
java.lang.Exception

constraintReductionSESRA

public java.lang.String constraintReductionSESRA(int paraConstraint)
                                          throws java.lang.Exception
Find an optimal sub-reduct using the SESRA algorithm.

参数:
paraConstraint - the test cost upper bound.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

constraintReductionSESRA

public java.lang.String constraintReductionSESRA(int paraConstraint,
                                                 boolean[] paraAvailableTests)
                                          throws java.lang.Exception
Find an optimal sub-reduct using the SESRA algorithm.

参数:
paraConstraint - the test cost upper bound.
paraAvailableTests - which tests are available.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

constraintReductionSESRAstar

public java.lang.String constraintReductionSESRAstar(int paraConstraint)
                                              throws java.lang.Exception
Find an optimal sub-reduct using the SESRA star algorithm. Support decision systems with at most 32 tests.

参数:
paraConstraint - the test cost upper bound.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

constraintReductionBASS

public java.lang.String constraintReductionBASS(int paraConstraint)
                                         throws java.lang.Exception
Find an optimal subreduct using the BASS algorithm. It only support the conditional entropy measure, however not the positive region measure.

参数:
paraConstraint - the test cost upper bound.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

removeShortTestSets

protected long[] removeShortTestSets(long[] paraInitialTestSetArray)
                              throws java.lang.Exception
Remove short test sets such that we do not have to compute their consistency. Simply invoke another method.

参数:
paraInitialTestSetArray - test sets are representated by integers. It must be sorted in an ascending order.
返回:
longer test sets.
抛出:
java.lang.Exception

removeShortTestSets

protected long[] removeShortTestSets(long[] paraInitialTestSetArray,
                                     int paraNumberOfTestSets)
                              throws java.lang.Exception
Remove short test sets such that we do not have to compute their consistency. This is done through removing any subsets of given test sets.

参数:
paraInitialTestSetArray - test sets are representated by integers. It must be sorted in an ascending order.
paraNumberOfTestSets - the effective number of elements in paraInitialTestSetArray.
返回:
longer test sets.
抛出:
java.lang.Exception
另请参见:
constraintReductionSESRAstar(int)

selectMaximalConsistencySubreducts

protected long[] selectMaximalConsistencySubreducts(long[] paraSubreducts)
                                             throws java.lang.Exception
Select sub-reducts with the maximal consistency.

参数:
paraSubreducts - test sets are representated by long. It must be sorted in an ascending order.
返回:
longer test sets.
抛出:
java.lang.Exception
另请参见:
constraintReductionSESRA(int), constraintReductionSESRAstar(int)

getExhaustiveSubreductResults

public long[] getExhaustiveSubreductResults()
Get sub-reduct results (exhaustive algorithms).

返回:
results in an int array.

constraintSatisfied

public boolean constraintSatisfied(boolean[] paraSelectedTests,
                                   int paraConstraint)
                            throws java.lang.Exception
Judge whether or not the given test set satisfy the constraint.

参数:
paraSelectedTests - Selected tests represented by a boolean array.
paraConstraint - The constraint.
抛出:
java.lang.Exception - if it is thrown by computeTestCost().

constraintReductionBacktrack

public java.lang.String constraintReductionBacktrack(int paraConstraint)
                                              throws java.lang.Exception
Find an optimal sub-reduct using the backtrack algorithm.

参数:
paraConstraint - the test cost upper bound.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

backtrackForSubreducts

public void backtrackForSubreducts(Instances[] paraInstances,
                                   long paraSeletctedAttributes,
                                   int paraExistingTestCost,
                                   int paraLowerBound)
                            throws java.lang.Exception
Backtrack approach to produce candidate subreducts.

参数:
paraInstances - Instances array from the last level.
paraSeletctedAttributes - Attributes already selected in the last level.
paraLowerBound - The lower bound of the atribute index. We can only look forward.
抛出:
java.lang.Exception

posBasedLambdaWeightedConstraintReduction

public boolean[] posBasedLambdaWeightedConstraintReduction(double paraLambda,
                                                           int paraConstraint)
                                                    throws java.lang.Exception
Find a (possibly) minimal positive sub-reduct using the lambda-weighted reduction algorithm. Please refer to our paper for more detail: \cite{MinZhu12Feature}
Attention: this algorithm may fail on many datasets where no attribute alone produce a non-empty positive region. Therefore it is simply for the counterexample.

参数:
paraLambda - the lambda value.
返回:
the sub-reduct with the form of boolean vector. This sub-reduct is also stored in the object as currentSubreduct.
抛出:
java.lang.Exception

entropyBasedLambdaWeightedConstraintReduction

public boolean[] entropyBasedLambdaWeightedConstraintReduction(double paraLambda,
                                                               int paraConstraint)
                                                        throws java.lang.Exception
Find a (possibly) minimal entropy sub-reduct using the lambda-weighted reduction algorithm. Please refer to our paper for more detail: \cite{MinZhu11Attribute}

参数:
paraLambda - the lambda value.
返回:
the sub-reduct with the form of boolean vector. This sub-reduct is also stored in the object as currentSubreduct.
抛出:
java.lang.Exception

toString

public java.lang.String toString()
For toString(). See interface toString().

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