|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.ObjectInstances
coser.datamodel.decisionsystem.RoughDecisionSystem
coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
public class CostSensitiveDecisionSystem extends RoughDecisionSystem
Summary: Decision system with various types of tests however without
algorithm implementation. Many cost data are considered, including:
1) test cost along with constraint;
2) waiting cost along with constraint; and
3) misclassification cost.
Since attributes can be either numeric or nominal, no algorithm is
implemented. Therefore the class is essentially abstract.
For more information of the data model please refer to our papers:
\@ARTICLE{MinLiu09AHierarchical,
author = {Fan Min and Qihe Liu},
title = {A hierarchical model for test-cost-sensitive decision systems},
journal = {Information Sciences},
year = {2009},
volume = {179},
pages = {2442--2452},
number = {14}
}
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: Almost done. Can be enhanced in the future.
Written time: February 14, 2012.
Last modify time: December 28, 2012.
| 修饰符 和 类型 | 字段 和 描述 |
|---|---|
protected int |
alpha
The value to control the shape of the distribution. |
static int |
COMPLEX_COMMON_TEST_COST
Complex common-test-cost model. |
static int |
COST_TYPE_MONEY
Test cost, or money. |
static int |
COST_TYPE_TESTING_TIME
Testing time. |
static int |
COST_TYPE_WAITING_TIME
Waiting time. |
protected double |
currentReductCost
Total cost of current reduct. |
protected int |
currentReductTime
Total time of current reduct. |
protected int |
currentReductTotalTestCost
Total test-cost of current reduct. |
static int |
DEFAULT_AVERAGE_NUMBER_OF_TESTS_PER_GROUP
Default average number of tests per group. |
protected int[] |
groupCommonTestCostArray
Group common-test-cost. |
protected int[] |
groupInclusionArray
Group inclusion vector. |
protected int[][] |
groupInclusionMatrix
Group inclusion matrix. |
static int |
IMPOSSIBLE_COST
Impossible cost, only used for initialization. |
protected int[] |
individualCostDistributions
Individual cost distribution, currently 3 types. |
protected int[] |
individualCostLowerBounds
Individual money, testing/waiting time lower bounds. |
protected int[][] |
individualCostMatrix
Individual cost matrix, currently 3 types. |
protected java.util.Random |
individualCostRandom
Used to generate individual costs. |
protected int[] |
individualCostUpperBounds
Individual money, testing/waiting time upper bounds. |
protected boolean[] |
minimalTestCostReduct
A minimal test-cost reduct. |
protected boolean[] |
minimalTimeReduct
A minimal time reduct. |
protected int[][] |
misclassificationCostMatrix
The misclassification cost matrix. |
protected int[] |
misclassificationCostSumArray
The misclassification cost sum array. |
static int |
NORMAL
Normal distribution. |
protected int |
optimalReductTestCost
Total test-cost of the optimal reduct. |
protected int |
optimalReductTime
Total time of the optimal reduct. |
static int |
PARETO
Bounded Pareto distribution. |
protected boolean |
randomMode
Random mode. |
static int |
SIMPLE_COMMON_TEST_COST
Simple common-test-cost model. |
static int |
TEST_COST_INDEPENDENT
Test-costs are independent from each other. |
static int |
TEST_COST_TYPES
Test cost types, currently there are test cost (money), testing time, and waiting time. |
protected int |
testCostConstraint
The constraint of the total test cost. |
protected int |
testCostRelationship
Relationship among test-costs, TEST_COST_INDEPENDENT, SIMPLE_COMMON_TEST_COST, or COMPLEX_COMMON_TEST_COST. |
(专用软件包) boolean[][] |
testingOrderMatrix
Indicate whether or not one test is before another. |
protected int |
timeParts
The number of parts for time. |
protected int |
totalTimeConstraint
The constraint of the total time. |
protected int |
unifiedMisclassificationCost
The unified misclassification cost. |
static int |
UNIFORM
Uniform distribution. |
| 构造函数 和 描述 |
|---|
CostSensitiveDecisionSystem(CostSensitiveDecisionSystem paraDataset,
boolean[] paraSelectedAttributes)
Construct the decision system. |
CostSensitiveDecisionSystem(Instances dataset)
Construct the decision system. |
CostSensitiveDecisionSystem(Instances dataset,
int capacity)
Construct the decision system. |
CostSensitiveDecisionSystem(Instances source,
int first,
int toCopy)
Construct the decision system. |
CostSensitiveDecisionSystem(java.io.Reader reader)
Construct the decision system. |
CostSensitiveDecisionSystem(java.lang.String name,
FastVector attInfo,
int capacity)
Construct the decision system. |
| 修饰符 和 类型 | 方法 和 描述 |
|---|---|
double |
averageMisclassificationCost()
Compute the average misclassification cost of this dataset. |
double |
averageMisclassificationCost(boolean[] paraTestSet)
Compute the average misclassification cost given a test set, it is essentially an abstract class because subsets cannot be produced in this class. |
double |
averageMisclassificationCost(Instances[] paraInstancesArray)
Compute the average misclassification cost given a subset family. |
double |
averageMisclassificationCost(long paraTestSet)
Compute the average misclassification cost given a test set. |
int |
bestClassValue()
Compute the best class index for this dataset while no attribute is selected. |
int |
computeAdditiveCost(int paraCostType,
boolean[] paraSelectedTests)
Compute additive cost. |
double |
computeExceedingFactor()
Get the exceeding factor. |
int |
computeOptimalTestCost()
Compute the optimal test-cost. |
int |
computeReductTestCost()
Compute the total test-cost of the current reduct. |
int |
computeReductWaitingTime()
Compute the total test-cost of the current reduct. |
int |
computeTestCost(boolean[] paraSelectedTests)
Compute the cost of selected tests. |
int |
computeTestCost(long paraSelectedTests)
Compute the cost of selected tests. |
protected void |
copyForClone(CostSensitiveDecisionSystem paraDecisionSystem)
Copy from the given decision system. |
void |
generateIndividualCosts(int paraCostType)
Generate individual cost subject to the current distribution. |
protected int |
generateOneCost(int paramCostType)
Generate an integer within a pair of bounds subject to a distribution. |
int |
getClassificationCost(int paraReal,
int paraClassified)
Get an element of the misclassification cost matrix. |
java.lang.String |
getDistributionString(int paraCostType)
Get the distribution name. |
int |
getIndividualCost(int paraCostType,
int paraIndex)
Get a test-cost. |
int |
getIndividualTestCost(int paraIndex)
Get a test-cost. |
int[] |
getIndividualTestCostArray()
Get the test-cost array. |
int[][] |
getMisclassificationCostMatrix()
Get the misclassification cost matrix. |
int |
getOptimalReductTestCost()
Get the optimal test-cost reducts. |
int |
getReductTotalTestCost()
Get the total test cost of the current reduct. |
void |
initializeForReduction()
Initialize for reduction. |
void |
refreshTestCost()
Refresh the test-cost settings. |
void |
setAlpha(int paraAlpha)
Set the alpha value. |
void |
setComplexCommonTestCostArrays(int[][] paraGroupInclusionMatrix,
int[] paraGroupCommonTestCostArray)
Set the group inclusion matrix and the group common test-cost array. |
void |
setCostRandomMode(boolean paraRandomMode)
Set the random mode and reset the Random object. |
void |
setIndividualCostArray(int paraCostType,
int[] paraIndividualCostArray)
Set the test-cost array. |
void |
setIndividualCostBounds(int paraCostType,
int paraLowerBound,
int paraUpperBound)
Set the cost bounds. |
void |
setIndividualCostDistribution(int paraCostType,
int paraDistribution)
Set the distribution. |
void |
setMisclassificationCostMatrix(int[][] paraMatrix)
Set the misclassification cost matrix. |
void |
setMisclassificationCostMatrix(java.lang.String paraMatrixString)
Set the misclassification cost matrix. |
void |
setSimpleCommonTestCostArrays(int[] paraGroupInclusionArray,
int[] paraGroupCommonTestCostArray)
Set the group inclusion array and the group common test-cost array. |
void |
setTestCostsRelationShip(int paraRelationship)
Set the test-cost relationship. |
void |
setUnifiedMisclassificationCost(int paraMisclassificationCost)
Set the unified misclassification cost. |
protected void |
sortByTestCost(int[] paraSequence)
Sort an index sequence according to the test-cost in a descending order. |
java.lang.String |
toString()
For toString(). |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 字段详细信息 |
|---|
public static int IMPOSSIBLE_COST
protected boolean randomMode
protected java.util.Random individualCostRandom
public static final int TEST_COST_TYPES
public static final int COST_TYPE_MONEY
public static final int COST_TYPE_TESTING_TIME
public static final int COST_TYPE_WAITING_TIME
protected int[] individualCostDistributions
public static final int UNIFORM
public static final int NORMAL
public static final int PARETO
protected int[] individualCostLowerBounds
protected int[] individualCostUpperBounds
protected int[][] individualCostMatrix
protected int alpha
protected int testCostConstraint
protected int currentReductTotalTestCost
protected double currentReductCost
protected boolean[] minimalTestCostReduct
protected int optimalReductTestCost
public static final int TEST_COST_INDEPENDENT
public static final int SIMPLE_COMMON_TEST_COST
public static final int COMPLEX_COMMON_TEST_COST
protected int testCostRelationship
protected int[] groupInclusionArray
protected int[][] groupInclusionMatrix
protected int[] groupCommonTestCostArray
public static final int DEFAULT_AVERAGE_NUMBER_OF_TESTS_PER_GROUP
protected int timeParts
boolean[][] testingOrderMatrix
protected int totalTimeConstraint
protected int optimalReductTime
protected boolean[] minimalTimeReduct
protected int currentReductTime
protected int[][] misclassificationCostMatrix
protected int[] misclassificationCostSumArray
protected int unifiedMisclassificationCost
| 构造方法详细信息 |
|---|
public CostSensitiveDecisionSystem(java.io.Reader reader)
throws java.io.IOException,
java.lang.Exception
java.io.IOExceptionjava.lang.Exception
public CostSensitiveDecisionSystem(Instances dataset)
throws java.lang.Exception
java.lang.Exception
public CostSensitiveDecisionSystem(Instances dataset,
int capacity)
throws java.lang.Exception
java.lang.Exception
public CostSensitiveDecisionSystem(Instances source,
int first,
int toCopy)
throws java.lang.Exception
java.lang.Exception
public CostSensitiveDecisionSystem(java.lang.String name,
FastVector attInfo,
int capacity)
throws java.lang.Exception
java.lang.Exception
public CostSensitiveDecisionSystem(CostSensitiveDecisionSystem paraDataset,
boolean[] paraSelectedAttributes)
throws java.lang.Exception
java.lang.Exception| 方法详细信息 |
|---|
protected void copyForClone(CostSensitiveDecisionSystem paraDecisionSystem)
paraDecisionSystem - the decision system that copy from.
public void initializeForReduction()
throws java.lang.Exception
RoughDecisionSystem 中的 initializeForReductionjava.lang.Exception - if the attribute or class is not nominal, or missing values
exists.public java.lang.String getDistributionString(int paraCostType)
paraCostType - the cost type, money, testing time, or waiting time.public int getReductTotalTestCost()
public int getOptimalReductTestCost()
public void setIndividualCostArray(int paraCostType,
int[] paraIndividualCostArray)
throws java.lang.Exception
paraCostType - the cost type, currently three types are supported.paraIndividualCostArray - the test-cost array.java.lang.Exception
public int getIndividualCost(int paraCostType,
int paraIndex)
paraIndex - the index of the attributepublic int getIndividualTestCost(int paraIndex)
paraIndex - the index of the attributepublic int[] getIndividualTestCostArray()
public void setSimpleCommonTestCostArrays(int[] paraGroupInclusionArray,
int[] paraGroupCommonTestCostArray)
throws java.lang.Exception
paraGroupInclusionArray - the group inclusion array.java.lang.Exception - if the sizes of arrays do not match.
public void setComplexCommonTestCostArrays(int[][] paraGroupInclusionMatrix,
int[] paraGroupCommonTestCostArray)
throws java.lang.Exception
paraGroupInclusionMatrix - the group inclusion matrix.paraGroupCommonTestCostArray - the group common test-cost array.java.lang.Exception - if the sizes of arrays/matrices do not match.
public void setTestCostsRelationShip(int paraRelationship)
throws java.lang.Exception
paraRelationship - the given relationship.java.lang.Exception - if the relationship is not supported.public void setCostRandomMode(boolean paraRandomMode)
paraRandomMode - the given random mode.
public void setIndividualCostDistribution(int paraCostType,
int paraDistribution)
throws java.lang.Exception
paraCostType - the cost type, currently three types are supported. These are
testing time, waiting time and money.paraDistribution - the given distribution.java.lang.Exception - if the distribution is not supported.
public void setIndividualCostBounds(int paraCostType,
int paraLowerBound,
int paraUpperBound)
paraCostType - the cost type, currently three types are supported. These are
testing time, waiting time and money.paraLowerBound - the given lower bound.paraUpperBound - the given upper bound.
public void generateIndividualCosts(int paraCostType)
throws java.lang.Exception
java.lang.Exception - directly if it is thrown by an invoked method.
protected int generateOneCost(int paramCostType)
throws java.lang.Exception
paramCostType - the test type, 0 for testing time, and 1 for waiting time, and
2 for test cost,java.lang.Exceptionpublic void setAlpha(int paraAlpha)
public void refreshTestCost()
throws java.lang.Exception
java.lang.Exceptionprotected void sortByTestCost(int[] paraSequence)
paraSequence - the given sequence. The sequence is changed in the method, and
the return value is not needed.
public int computeOptimalTestCost()
throws java.lang.Exception
exception - if the set of all reduct is not obtained yet.java.lang.Exception
public int computeTestCost(boolean[] paraSelectedTests)
throws java.lang.Exception
paraSelectedTests - which tests are selected, represented by a boolean arrayexception - if length of the given array does not match that of the
decision system.java.lang.Exception
public int computeAdditiveCost(int paraCostType,
boolean[] paraSelectedTests)
throws java.lang.Exception
paraCostType - the cost type. It might be money, testing time, or waiting
time.paraSelectedTests - which tests are selected, represented by a boolean arrayexception - if length of the given array does not match that of the
decision system.java.lang.Exception
public int computeTestCost(long paraSelectedTests)
throws java.lang.Exception
paraSelectedTests - which tests are selected, represented by an integer.exception - if the optimal reduct is not obtained yet.java.lang.ExceptioncomputeTestCost(boolean[])
public int computeReductTestCost()
throws java.lang.Exception
exception - if the optimal reduct is not obtained yet.java.lang.Exception
public int computeReductWaitingTime()
throws java.lang.Exception
exception - if the optimal reduct is not obtained yet.java.lang.Exception
public double computeExceedingFactor()
throws java.lang.Exception
exception - if the optimal reduct is not obtained yet.java.lang.Exception
public void setMisclassificationCostMatrix(int[][] paraMatrix)
throws java.lang.Exception
paraMatrix - the given matrix, which will be assigned directly.java.lang.Exception - if the sizes of the given matrix do not meet our requirement.
public void setMisclassificationCostMatrix(java.lang.String paraMatrixString)
throws java.lang.Exception
paraMatrixString - the given matrix with the form of a string.java.lang.Exception - if the given string does not contain enough integers.
public int getClassificationCost(int paraReal,
int paraClassified)
paraReal - real class.paraClassified - classified class.public int[][] getMisclassificationCostMatrix()
public void setUnifiedMisclassificationCost(int paraMisclassificationCost)
paraMisclassificationCost - The unified misclassfication cost.
public double averageMisclassificationCost(long paraTestSet)
throws java.lang.Exception
paraTestSet - The given test set with the form of a long.java.lang.Exception - if the given string does not contain enough integers.
public double averageMisclassificationCost()
throws java.lang.Exception
java.lang.Exception - if the given string does not contain enough integers.
public double averageMisclassificationCost(boolean[] paraTestSet)
throws java.lang.Exception
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.
public double averageMisclassificationCost(Instances[] paraInstancesArray)
throws java.lang.Exception
paraInstancesArray - The given objects subsets.java.lang.Exceptionpublic int bestClassValue()
public java.lang.String toString()
RoughDecisionSystem 中的 toString
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||