coser.datamodel.decisionsystem
类 DecisionSystemNeighborhood

java.lang.Object
  继承者 Instances
      继承者 coser.datamodel.decisionsystem.RoughDecisionSystem
          继承者 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
              继承者 coser.datamodel.decisionsystem.NumericDecisionSystem
                  继承者 coser.datamodel.decisionsystem.DecisionSystemNeighborhood
直接已知子类:
DecisionSystemErrorRange, DecisionSystemFixedNeighborhood, DecisionSystemNormalError

public class DecisionSystemNeighborhood
extends NumericDecisionSystem

Summary: Decision system with neighborhood, or neighborhood based rough sets.

Author: Fan Min, Hong Zhao 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 very beginning.
Written time: February 16, 2013.
Last modify time: February 16, 2012.


字段摘要
修饰符 和 类型 字段 和 描述
(专用软件包)  long[] candidateReductsArray
          Used to store temporarily computed super reducts
protected  double[] neighborhoodSizeArray
          Individual neighborhood size array.
(专用软件包)  int numberOfCandidateReducts
          Number of candidate reducts
protected  int seed
          Random seed
 
从类 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, numberOfCandidateSubreducts, numberOfConditions, numberOfInstances, optimalReduct, POSITIVE_REGION, runTimeInformation, startTime, totalEntropy, totalMajority, totalPositiveRegion
 
构造方法摘要
构造函数 和 描述
DecisionSystemNeighborhood(Instances dataset)
          Construct the decision system.
DecisionSystemNeighborhood(Instances dataset, int capacity)
          Construct the decision system.
DecisionSystemNeighborhood(Instances source, int first, int toCopy)
          Construct the decision system.
DecisionSystemNeighborhood(java.io.Reader reader)
          Construct the decision system.
DecisionSystemNeighborhood(java.lang.String name, FastVector attInfo, int capacity)
          Construct the decision system.
 
方法摘要
修饰符 和 类型 方法 和 描述
protected  void addAttribute(int[][] paraNeighbors, int[] paraNumberOfInconsistentNeighbors, int paraAttributeIndex)
          Add an attribute and change neighborhoods.
 double averageMisclassificationCost(boolean[] paraTestSet)
          Compute the average misclassification cost given a test set.
 void buildCandidatesBacktrack(int[][] paraNeighbors, int[] paraNumberOfInconsistentNeighbors, boolean[] paraSelectedTests, int paraTestLowerBound)
          Compute all candidate reducts using backtrack.
 void computeAllReductsBacktrack()
          Compute all reducts through backtracking.
 double computeExceedingFactor()
          Compute the exceeding factor.
 void computeNeighborhood(boolean[] paraTestSet, int[][] paraNeighbors, int[] paraNumberOfInconsistentNeighbors)
          Is the decision system consistent with respect to given attributes?
 int computeOptimalReductTestCostBacktrack()
          Compute the test cost of an optimal reduct using backtrack.
 int computeOptimalTestCost()
          Compute the optimal test-cost.
 double[] getNeighborhoodSizeArray()
          Get the neighborhood size array.
 boolean[] inconsistencyBasedLambdaReduction(double paraLambda)
          Find a (possibly) minimal reduct using the inconsistency based lambda weighted approach.
protected  int inconsistencyDecrease(int[][] paraNeighbors, int[] paraNumberOfInconsistentNeighbors, int paraAttributeIndex)
          Find a (possibly) minimal reduct using the inconsistency based approach.
 boolean isConsistent(boolean[] paraSelectedAttributes)
          Is the decision system consistent with respect to given attributes?
 boolean isCurrentReductOptimal()
          Is the current reduct optimal?
 void oneOptimalBacktrack(int[][] paraNeighbors, int[] paraNumberOfInconsistentNeighbors, boolean[] paraSelectedTests, int paraTestLowerBound, int paraExistingTestCost)
          Compute one optimal reduct using backtrack.
 void removeSuperReducts()
          Remove super-reducts.
 void setMisclassificationCostMatrix(int paraMisclassificationCost, int paraRatio)
          Set the different misclassification costs.
 void setNeighborhoodSizeArray(double[] paraNeighborhoodSizeArray)
          Set the neighborhood size array.
 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.NumericDecisionSystem 继承的方法
toString
 
从类 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem 继承的方法
averageMisclassificationCost, averageMisclassificationCost, bestClassValue, computeAdditiveCost, 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, sortByTestCost
 
从类 coser.datamodel.decisionsystem.RoughDecisionSystem 继承的方法
classEntropy, classEntropy, computeConsistency, computeConsistency, computeConsistency, computeCore, computeCore, conditionalEntropy, conditionalEntropy, 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, 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
 

字段详细信息

neighborhoodSizeArray

protected double[] neighborhoodSizeArray
Individual neighborhood size array. Should be positive.


candidateReductsArray

long[] candidateReductsArray
Used to store temporarily computed super reducts


numberOfCandidateReducts

int numberOfCandidateReducts
Number of candidate reducts


seed

protected int seed
Random seed

构造方法详细信息

DecisionSystemNeighborhood

public DecisionSystemNeighborhood(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

DecisionSystemNeighborhood

public DecisionSystemNeighborhood(Instances dataset)
                           throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

DecisionSystemNeighborhood

public DecisionSystemNeighborhood(Instances dataset,
                                  int capacity)
                           throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

DecisionSystemNeighborhood

public DecisionSystemNeighborhood(Instances source,
                                  int first,
                                  int toCopy)
                           throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

DecisionSystemNeighborhood

public DecisionSystemNeighborhood(java.lang.String name,
                                  FastVector attInfo,
                                  int capacity)
                           throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

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

setNeighborhoodSizeArray

public void setNeighborhoodSizeArray(double[] paraNeighborhoodSizeArray)
Set the neighborhood size array.

参数:
paraNeighborhoodSizeArray - the neighborhood size array.

getNeighborhoodSizeArray

public double[] getNeighborhoodSizeArray()
Get the neighborhood size array.

返回:
The neighborhood size array.

computeAllReductsBacktrack

public void computeAllReductsBacktrack()
                                throws java.lang.Exception
Compute all reducts through backtracking.

抛出:
java.lang.Exception
另请参见:
buildCandidatesBacktrack(int[][], int[], boolean[], int), removeSuperReducts()

buildCandidatesBacktrack

public void buildCandidatesBacktrack(int[][] paraNeighbors,
                                     int[] paraNumberOfInconsistentNeighbors,
                                     boolean[] paraSelectedTests,
                                     int paraTestLowerBound)
                              throws java.lang.Exception
Compute all candidate reducts using backtrack.

参数:
paraNeighbors - Neighbors of each object. The matrix is not full.
paraNumberOfInconsistentNeighbors - Effective number of neighbors of each object. Consistent objects should not be considered.
paraSelectedTests - Already selected tests.
paraTestLowerBound - The lower bound of test index. We only need forward search.
抛出:
java.lang.Exception

removeSuperReducts

public void removeSuperReducts()
                        throws java.lang.Exception
Remove super-reducts. Reducts should not be removed. Candidate reducts are stored in candidateReductsArray, numberOfCandidateReducts is known.

抛出:
java.lang.Exception

inconsistencyDecrease

protected int inconsistencyDecrease(int[][] paraNeighbors,
                                    int[] paraNumberOfInconsistentNeighbors,
                                    int paraAttributeIndex)
                             throws java.lang.Exception
Find a (possibly) minimal reduct using the inconsistency based approach.

返回:
the reduct with the form of boolean vector.
抛出:
java.lang.Exception

addAttribute

protected void addAttribute(int[][] paraNeighbors,
                            int[] paraNumberOfInconsistentNeighbors,
                            int paraAttributeIndex)
                     throws java.lang.Exception
Add an attribute and change neighborhoods. Although nothing is returned, some parameters are changed since they are references.

参数:
paraNeighbors - The matrix to indicate who is who's neighbor.
paraNumberOfInconsistentNeighbors - How many inconsistent neighbors for respective object.
paraAttributeIndex - The new attribute.
抛出:
java.lang.Exception

isConsistent

public boolean isConsistent(boolean[] paraSelectedAttributes)
                     throws java.lang.Exception
Is the decision system consistent with respect to given attributes?

参数:
paraSelectedAttributes - Selected attributes.
返回:
Is consistent or not.
抛出:
java.lang.Exception

computeOptimalTestCost

public int computeOptimalTestCost()
                           throws java.lang.Exception
Compute the optimal test-cost. The difference from the one in CostSensitiveDecisionSystem is that when all reducts cannot be read, we compute them.

覆盖:
类 CostSensitiveDecisionSystem 中的 computeOptimalTestCost
返回:
the optimal test-cost.
抛出:
exception - unkonwn exception.
java.lang.Exception

isCurrentReductOptimal

public boolean isCurrentReductOptimal()
                               throws java.lang.Exception
Is the current reduct optimal?

返回:
true if it is optimal.
抛出:
java.lang.Exception - if the reduct or the set of all reducts not computed yet.

computeExceedingFactor

public double computeExceedingFactor()
                              throws java.lang.Exception
Compute the exceeding factor. Overwrite the one in CostSensitiveDecisionSystem. It computes the optimal reduct through backtracking, instead of reading from a file.

覆盖:
类 CostSensitiveDecisionSystem 中的 computeExceedingFactor
返回:
the exceeding factor.
抛出:
exception - if the optimal reduct is not obtained yet.
java.lang.Exception

setMisclassificationCostMatrix

public void setMisclassificationCostMatrix(int paraMisclassificationCost,
                                           int paraRatio)
Set the different misclassification costs. The matrix is also set.

参数:
paraMisclassificationCost - The unified misclassfication cost.

computeOptimalReductTestCostBacktrack

public int computeOptimalReductTestCostBacktrack()
                                          throws java.lang.Exception
Compute the test cost of an optimal reduct using backtrack.

抛出:
java.lang.Exception

oneOptimalBacktrack

public void oneOptimalBacktrack(int[][] paraNeighbors,
                                int[] paraNumberOfInconsistentNeighbors,
                                boolean[] paraSelectedTests,
                                int paraTestLowerBound,
                                int paraExistingTestCost)
                         throws java.lang.Exception
Compute one optimal reduct using backtrack.

参数:
paraNeighbors - Neighbors of each object. The matrix is not full.
paraNumberOfInconsistentNeighbors - Effective number of neighbors of each object. Consistent objects should not be considered.
paraSelectedTests - Already selected tests.
paraTestLowerBound - The lower bound of test index. We only need forward search.
paraExistingTestCost - The cost of already selected tests.
抛出:
java.lang.Exception
另请参见:
buildCandidatesBacktrack(int[][], int[], boolean[], int)

inconsistencyBasedLambdaReduction

public boolean[] inconsistencyBasedLambdaReduction(double paraLambda)
                                            throws java.lang.Exception
Find a (possibly) minimal reduct using the inconsistency based lambda weighted approach.

参数:
paraLambda - the lambda value.
返回:
the reduct with the form of boolean vector.
抛出:
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[])

computeNeighborhood

public void computeNeighborhood(boolean[] paraTestSet,
                                int[][] paraNeighbors,
                                int[] paraNumberOfInconsistentNeighbors)
                         throws java.lang.Exception
Is the decision system consistent with respect to given attributes?

参数:
paraTestSet - Selected attributes.
paraNeighbors - The matrix to indicate who is who's neighbor.
paraNumberOfInconsistentNeighbors - How many inconsistent neighbors for respective object.
抛出:
java.lang.Exception

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.