|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.ObjectInstances
coser.datamodel.decisionsystem.RoughDecisionSystem
coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
coser.datamodel.decisionsystem.NominalDecisionSystem
public class NominalDecisionSystem extends CostSensitiveDecisionSystem
Summary: Decision system with only nominal values for Pawlak rough sets.
Implement the following algorithms:
1) compute positive region, information entropy, majority;
2) compute core;
3) compute reducts with exhaustively (backtrack and exponential) or
heuristically (information-gain based).
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: Finished. New methods can be added, though.
Written time: March 09, 2011.
Last modify time: February 21, 2012.
| 修饰符 和 类型 | 字段 和 描述 |
|---|---|
static int |
ATTRIBUTES_COMBINATIONS
Attribute value maximal combination. |
static int |
BACKTRACK
The backtrack algorithm. |
static int |
EXPONENTIAL
The exponential algorithm. |
protected int |
reductMinimalSize
The minimal size of reducts. |
| 构造函数 和 描述 |
|---|
NominalDecisionSystem(Instances paraDataset)
Construct the decision system. |
NominalDecisionSystem(Instances paraDataset,
int paraCapacity)
Construct the decision system. |
NominalDecisionSystem(Instances paraSource,
int paraFirst,
int paraToCopy)
Construct the decision system. |
NominalDecisionSystem(NominalDecisionSystem paraDataset,
boolean[] paraSelectedAttributes)
Construct the decision system. |
NominalDecisionSystem(java.io.Reader paraReader)
Construct the decision system. |
NominalDecisionSystem(java.lang.String paraName,
FastVector paraAttInfo,
int paraCapacity)
Construct the decision system. |
| 修饰符 和 类型 | 方法 和 描述 |
|---|---|
void |
buildCandidateReducts(Instances[] paraInstancesArray,
long paraSelectedAttributes,
int attributeIndexLowerBound)
Backtrack approach to produce candidate reducts. |
boolean[][] |
computeAllReductsBacktrack()
Compute the set of all reducts using the backtrack algorithm. |
boolean[][] |
computeAllReductsBacktrack(boolean[] paraAvailableAttributes)
Compute the set of all reducts using the backtrack algorithm. |
boolean[][] |
computeAllReductsExhaustive(boolean[] paraAvailableAttributes,
int paraAlgorithm)
Exhaustive reduction. |
boolean[][] |
computeAllReductsExhaustive(int paraAlgorithm)
Exhaustive reduction. |
long[] |
computeAllReductsExhaustive(long[] paraAttributeSetsInLong,
int paraAlgorithm)
Exhaustive reduction. |
boolean[][] |
computeAllReductsExhaustiveExponential(boolean[] paraAvailableAttributes)
Exhaustive reduction using the exponential approach. |
boolean[][] |
computeAllSubreducts()
Compute the set of all sub-reducts. |
int |
computeConsistency(Instances[] paraInstancesArray)
Compute the attribute set consistency. |
boolean[] |
computeCore(boolean[] paraAvailableAttributes)
Find a core subject to the given measure. |
double |
computeOptimalReductBacktrack()
Compute one optimal reducts using the backtrack algorithm. |
double |
conditionalEntropy(boolean[] paraSelectedAttributes)
Computes the conditional entropy of a dataset. |
boolean[] |
entropyBasedReduction()
Find a (possibly) minimal reduct using the information entropy based approach. |
double |
informationGain(boolean[] paraSelectedAttributes,
int paraAttributeIndex)
Computes the information gain of an attribute given an attribute subset. |
double |
informationGain(int paraAttributeIndex)
Computes the information gain of an attribute given an attribute subset. |
boolean |
isCurrentReductOptimal()
Is the current reduct optimal? |
static void |
main(java.lang.String[] args)
Test information entopy. |
int |
majority(boolean[] paraSelectedAttributes)
Compute the majority number of instances. |
int |
majority(Instances[] paraInstancesArray)
Compute the majority number of instances. |
void |
optimalReductBacktrack(Instances[] paraInstancesArray,
long paraSelectedAttributes,
int paraNumberOfSelectedAttributes,
int paraAttributeLowerBound)
Backtrack approach to produce an optimal. |
int |
positiveRegion(boolean[] paraSelectedAttributes)
Compute the positive region given the attribute subset. |
int |
positiveRegion(Instances[] paraInstancesArray)
Compute the positive region given the attribute subset. |
long[] |
removeRedundantSubreducts()
Remove redundant sub-reducts. |
Instances[] |
splitData(boolean[] paraSelectedAttributes)
Splits this dataset according to the given attribute subset. |
Instances[] |
splitData(Instances[] paraInstancesArray,
Attribute paraAttribute)
Splits a number of datasets according to the values of a nominal attribute. |
Instances[] |
splitData(Instances paraData,
Attribute paraAttribute)
Splits a dataset according to the values of a nominal attribute. |
java.lang.String |
toString()
For toString(). |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 字段详细信息 |
|---|
public static final int ATTRIBUTES_COMBINATIONS
public static final int EXPONENTIAL
public static final int BACKTRACK
protected int reductMinimalSize
| 构造方法详细信息 |
|---|
public NominalDecisionSystem(java.io.Reader paraReader)
throws java.io.IOException,
java.lang.Exception
paraReader - the given reader, often with the form of a file reader. We can
generate a FileReader given an .arff filename.java.io.IOExceptionjava.lang.Exception
public NominalDecisionSystem(Instances paraDataset)
throws java.lang.Exception
java.lang.Exception
public NominalDecisionSystem(Instances paraDataset,
int paraCapacity)
throws java.lang.Exception
java.lang.Exception
public NominalDecisionSystem(Instances paraSource,
int paraFirst,
int paraToCopy)
throws java.lang.Exception
java.lang.Exception
public NominalDecisionSystem(java.lang.String paraName,
FastVector paraAttInfo,
int paraCapacity)
throws java.lang.Exception
java.lang.Exception
public NominalDecisionSystem(NominalDecisionSystem paraDataset,
boolean[] paraSelectedAttributes)
throws java.lang.Exception
java.lang.Exception| 方法详细信息 |
|---|
public int positiveRegion(boolean[] paraSelectedAttributes)
throws java.lang.Exception
RoughDecisionSystem 中的 positiveRegionparaSelectedAttributes - selected attributes represented as a boolean array.java.lang.Exception - for overridden by subclasses.positiveRegion(Instances[])
public int positiveRegion(Instances[] paraInstancesArray)
throws java.lang.Exception
RoughDecisionSystem 中的 positiveRegionparaInstancesArray - instances array, already a number of object subsets.java.lang.Exception - for overridden by subclasses.
public int majority(boolean[] paraSelectedAttributes)
throws java.lang.Exception
RoughDecisionSystem 中的 majorityparaSelectedAttributes - selected attributes represented as a boolean array.java.lang.Exceptionmajority(Instances[])
public int majority(Instances[] paraInstancesArray)
throws java.lang.Exception
RoughDecisionSystem 中的 majorityparaInstancesArray - the subsets.java.lang.Exception
public Instances[] splitData(Instances paraData,
Attribute paraAttribute)
paraData - the data which is to be split.paraAttribute - the attribute to be used for splitting.
public Instances[] splitData(Instances[] paraInstancesArray,
Attribute paraAttribute)
throws java.lang.Exception
paraInstancesArray - the data array which is to be split.paraAttribute - the attribute to be used for splitting.java.lang.Exception
public Instances[] splitData(boolean[] paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - selected attributes.java.lang.Exception
public double conditionalEntropy(boolean[] paraSelectedAttributes)
throws java.lang.Exception
RoughDecisionSystem 中的 conditionalEntropyparaSelectedAttributes - the selected attributes.java.lang.ExceptionRoughDecisionSystem.conditionalEntropy(Instances[])
public int computeConsistency(Instances[] paraInstancesArray)
throws java.lang.Exception
RoughDecisionSystem 中的 computeConsistencyparaInstancesArray - object subsets.java.lang.Exception
public double informationGain(int paraAttributeIndex)
throws java.lang.Exception
paraAttributeIndex - the index of the new attribute.java.lang.Exception
public double informationGain(boolean[] paraSelectedAttributes,
int paraAttributeIndex)
throws java.lang.Exception
paraSelectedAttributes - the selected attributes.paraAttributeIndex - the index of the new attribute.java.lang.Exception
public boolean[] computeCore(boolean[] paraAvailableAttributes)
throws java.lang.Exception
RoughDecisionSystem 中的 computeCoreparaAvailableAttributes - available attributesjava.lang.Exception
public boolean[][] computeAllReductsBacktrack(boolean[] paraAvailableAttributes)
throws java.lang.Exception
paraAvailableAttributes - the set of available attributesjava.lang.ExceptioncomputeAllReductsBacktrack()
public boolean[][] computeAllReductsBacktrack()
throws java.lang.Exception
java.lang.Exception
public void buildCandidateReducts(Instances[] paraInstancesArray,
long paraSelectedAttributes,
int attributeIndexLowerBound)
throws java.lang.Exception
paraInstancesArray - Instances array from the last level.paraSelectedAttributes - Attributes already selected in the last level.attributeIndexLowerBound - The lower bound of the atribute index. We can only look
forward.java.lang.Exception
public boolean[] entropyBasedReduction()
throws java.lang.Exception
java.lang.Exception
public boolean isCurrentReductOptimal()
throws java.lang.Exception
java.lang.Exception - if the reduct or the set of all reducts not computed yet.
public boolean[][] computeAllReductsExhaustive(int paraAlgorithm)
throws java.lang.Exception
paraAlgorithm - the algorithm employed.java.lang.Exception
public boolean[][] computeAllReductsExhaustive(boolean[] paraAvailableAttributes,
int paraAlgorithm)
throws java.lang.Exception
paraAvailableAttributes - which attributes are available. Sometimes we need to compute
reducts of a subtable.paraAlgorithm - the algorithm employed.java.lang.Exception - if the algorithm is not supported. Or other Exceptions threw
by more fundamental methods.
public boolean[][] computeAllReductsExhaustiveExponential(boolean[] paraAvailableAttributes)
throws java.lang.Exception
paraAvailableAttributes - which attributes are available. Sometimes we need to compute
reducts of a subtable.java.lang.Exception
public boolean[][] computeAllSubreducts()
throws java.lang.Exception
java.lang.Exception
public long[] removeRedundantSubreducts()
throws java.lang.Exception
java.lang.Exception
public long[] computeAllReductsExhaustive(long[] paraAttributeSetsInLong,
int paraAlgorithm)
throws java.lang.Exception
paraAttributeSetsInLong - Attributes sets by long values. Each long value corresponds to
an attribute subset. Each bit in the long represents whether
or not the corresponding attribute is selected.paraAlgorithm - the algorithm employed.java.lang.Exception - if the algorithm is not supported. Or other Exceptions threw
by more fundamental methods.
public double computeOptimalReductBacktrack()
throws java.lang.Exception
java.lang.Exception
public void optimalReductBacktrack(Instances[] paraInstancesArray,
long paraSelectedAttributes,
int paraNumberOfSelectedAttributes,
int paraAttributeLowerBound)
throws java.lang.Exception
paraInstancesArray - Instances array from the last level.paraSelectedAttributes - Attributes already selected in the last level.paraNumberOfSelectedAttributes - Number of already selected tests.paraAttributeLowerBound - The lower bound of the attribute index. We can only look
forward.java.lang.Exceptionpublic java.lang.String toString()
CostSensitiveDecisionSystem 中的 toStringpublic static void main(java.lang.String[] args)
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||