|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.ObjectInstances
coser.datamodel.decisionsystem.RoughDecisionSystem
public class RoughDecisionSystem extends Instances
Decision systems for rough sets however without algorithm implementation. The
following data are claimed:
1) basic information of the decision system;
2) basic information for nominal and numeric decision systems;
3) reduct related information; and
4) subreduct related information.
No algorithm is implemented. Some methods are essentially abstract, so does
this class.
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: Done. New methods may be added in the future.
Written time: August 12, 2011.
Last modify time: February 15, 2012.
| 修饰符 和 类型 | 字段 和 描述 |
|---|---|
protected boolean[] |
allConditions
The set of all conditional attributes. |
protected boolean[][] |
allReducts
The set of all reducts. |
protected java.lang.String |
allReductsFilename
The file for all reducts. |
protected boolean[][] |
allSubreducts
The set of all subreducts. |
protected java.lang.String |
allSubreductsFilename
The file for all subreducts. |
protected java.lang.String |
arffFilename
The file for the basic decision system. |
protected long |
backtrackSteps
Backtrack steps, only useful in subclasses. |
protected long[] |
candidateReductArray
Candidate reduct array, useful in the process of reduction. |
protected long[] |
candidateSubreductArray
Candidate sub-reduct array |
protected int[] |
candidateSubreductConsistencyArray
Candidate sub-reduct consistency array |
protected int |
classSize
The number of values of the class attribute. |
static int |
CONDITIONAL_ENTROPY
Conditional entropy based, for attribute reduct definition. |
protected int |
consistency
The consistency computed for the current measure. |
protected boolean[] |
core
The array that indicate the set of core attributes. |
protected boolean[] |
currentReduct
The current reduct represented by an boolean array. |
protected boolean[] |
currentSelectedAttributes
Currently selected attributes. |
protected long |
endTime
Reduction end time, only useful in subclasses. |
static int |
MAJORITY
Majority based, for attribute reduct definition. |
protected int |
minimalReductSize
The size of the minimal reduct. |
protected int |
numberOfCandidateReducts
The number of candidate reducts. |
protected int |
numberOfCandidateSubreducts
Number of candidate sub-reducts |
protected int |
numberOfConditions
Number of conditional attributes. |
protected int |
numberOfInstances
Number of instances. |
protected boolean[] |
optimalReduct
The optimal reduct. |
static int |
POSITIVE_REGION
Positive region based, for attribute reduct definition. |
protected java.lang.String |
runTimeInformation
Runtime information, only useful in subclasses. |
protected long |
startTime
Reduction start time, only useful in subclasses. |
protected double |
totalEntropy
The total entropy of the decision system; |
protected int |
totalMajority
The total majority of the decision system; |
protected int |
totalPositiveRegion
The total positive region of the decision system; |
| 构造函数 和 描述 |
|---|
RoughDecisionSystem(Instances paraDataset)
Construct the decision system, essentially clone a decision system. |
RoughDecisionSystem(Instances paraDataset,
boolean[] paraSelectedAttributes)
Construct a new sub decision system with selected attributes. |
RoughDecisionSystem(Instances paraDataset,
int paraCapacity)
Construct the decision system. |
RoughDecisionSystem(Instances source,
int first,
int toCopy)
Construct the decision system. |
RoughDecisionSystem(java.io.Reader paraReader)
Construct the rough decision system. |
RoughDecisionSystem(java.lang.String name,
FastVector attInfo,
int capacity)
Construct the decision system. |
| 修饰符 和 类型 | 方法 和 描述 |
|---|---|
double |
classEntropy()
Computes the entropy of a dataset by considering the class attribute. |
double |
classEntropy(Instances paraData)
Computes the entropy of a dataset by considering the class attribute. |
int |
computeConsistency()
Compute the attribute set consistency. |
int |
computeConsistency(boolean[] paraSelectedAttributes)
Compute the attribute set consistency. |
int |
computeConsistency(long paraSelectedAttributesByLong)
Compute the attribute set consistency. |
boolean[] |
computeCore()
Compute the core, essentially an abstract method. |
boolean[] |
computeCore(boolean[] paraAvailableAttributes)
Find a core with available attributes, should be overridden. |
double |
conditionalEntropy()
Computes the conditional entropy of this dataset, for overload. |
double |
conditionalEntropy(boolean[] paraSelectedAttributes)
Compute the conditional entropy given an attribute subset represented by a boolean array, essentially an abstract method. |
double |
conditionalEntropy(Instances[] paraInstancesArray)
Computes the conditional entropy of object subsets. |
double |
conditionalEntropy(long paraSelectedAttributesByLong)
Compute the conditional entropy given an attribute subset, for overload. |
protected void |
copyForClone(RoughDecisionSystem paraDecisionSystem)
Copy from the given decision system. |
void |
delete(boolean[] paraIndices)
Delete elements marked FALSE in a boolean array. |
RoughDecisionSystem[] |
divideInTwo(double paraPercentage)
Divide the decision system in two according to the given percentage. |
int |
entropyReciprocal()
Compute the entropy reciprocal. |
int |
entropyReciprocal(boolean[] paraSelectedAttributes)
Compute the entropy reciprocal. |
int |
entropyReciprocal(double paraEntropy)
Compute the entropy reciprocal. |
int |
entropyReciprocal(Instances[] paraInstancesArray)
Compute the entropy reciprocal for object subsets. |
int |
entropyReciprocal(long paraSelectedAttributesByLong)
Compute the entropy reciprocal. |
java.lang.String |
getAllReductsFilename()
Get the sred filename. |
java.lang.String |
getAllReductsString()
Get all reducts reprensented by a string, which can be written to a .reds file directly. |
java.lang.String |
getAllSubreductsFilename()
Get the sred filename. |
java.lang.String |
getArffFilename()
Get the arff filename of the current dataset. |
java.lang.String |
getArffSource()
Get the arff source. |
long |
getBacktrackSteps()
Get the backtrack steps. |
int[] |
getCandidateSubreductConsistencyArray()
Get the candidate subreduct entropy array. |
boolean[] |
getCurrentReduct()
Get the current reduct. |
int |
getCurrentReductIndex()
Get the index of the current index. |
int |
getMeasure()
Get the measure. |
int |
getNumberOfConditions()
Get the number of conditions, only invoked by those who have not access to numberOfConditions. |
boolean[] |
getOptimalReduct()
Get the optimal reduct. |
long |
getReductionTime()
Get the reduction run time. |
java.lang.String |
getReductString()
Get the current reduct with the form of String. |
java.lang.String |
getRunTimeInformation()
Get the run time information. |
boolean |
hasMissingValue()
Has the decision system missing value? |
void |
initializeForReduction()
Initialize for reduction. |
boolean |
isNominal()
Is the decision system nominal? |
boolean |
isNormalized()
Is the decision system normalized? |
boolean |
isNumeric()
Is the decision system numeric? |
int |
majority()
Compute the majority number of instances, for overload. |
int |
majority(boolean[] paraSelectedAttributes)
Compute the majority number of instances, should be overridden. |
int |
majority(long paraSelectedAttributesByLong)
Compute the majority number of instances, for overload. |
RoughDecisionSystem |
normalize()
Normalize the current decision system and write to an arff file. |
int |
positiveRegion()
Compute the positive region size using all conditional attributes, essentially an abstract method. |
int |
positiveRegion(boolean[] paraSelectedAttributes)
Compute the positive region given the attribute subset, should be overridden. |
int |
positiveRegion(long paraSelectedAttributes)
Compute the positive region size given the attribute subset, for overload. |
void |
printAllReducts()
Print all reducts. |
void |
readAllReducts()
Read all reducts from the default reduct file, whose filename only differs from the arff file by the suffix. |
void |
readAllReducts(java.lang.String paraFilename)
Read all reducts from a text file with the following format: 2 1,3,6 1,4,5,7 That is, the first line indicates the number of reducts. |
void |
readAllSubreducts()
Read all subreducts from the default subreduct file, whose filename only differs from the arff file by the suffix. |
void |
readAllSubreducts(java.lang.String paraFilename)
Read all reducts from a text file with the following format: 2 1,3,6: 0.0135 1,4,5,7: 0 That is, the first line indicates the number of subreducts. |
void |
setAllReductsFilename()
Set the reds filename such that it can be stored for and reloaded next time. |
void |
setAllReductsFilename(java.lang.String paraFilename)
Set the red filename such that it can be stored for and reloaded next time. |
void |
setAllSubreductsFilename()
Set the sred filename such that it can be stored for and reloaded next time. |
void |
setAllSubreductsFilename(java.lang.String paraFilename)
Set the sred filename such that it can be stored for and reloaded next time. |
void |
setArffFilename(java.lang.String paraFilename)
Set the arff filename such that it can be stored and reloaded next time. |
void |
setCurrentReduct(boolean[] paraCurrentReduct)
Set the current reduct. |
void |
setCurrentReduct(long paraCurrentReduct)
Set the current reduct. |
void |
setMeasure(int paraMeasure)
Set the measure for evaluation the consistency of an attribute or a decision system. |
java.lang.String |
toString()
For toString(). |
void |
writeAllReducts()
Write all reducts to the default reduct file, whose filename only differs from the arff file by the suffix. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 字段详细信息 |
|---|
protected java.lang.String arffFilename
protected int numberOfConditions
protected int numberOfInstances
protected int classSize
protected boolean[] allConditions
public static final int POSITIVE_REGION
public static final int CONDITIONAL_ENTROPY
public static final int MAJORITY
protected int consistency
protected double totalEntropy
protected int totalPositiveRegion
protected int totalMajority
protected java.lang.String allReductsFilename
protected boolean[][] allReducts
protected boolean[] currentReduct
protected boolean[] currentSelectedAttributes
protected boolean[] core
protected int minimalReductSize
protected boolean[] optimalReduct
protected int numberOfCandidateReducts
protected long[] candidateReductArray
protected java.lang.String allSubreductsFilename
protected boolean[][] allSubreducts
protected int numberOfCandidateSubreducts
protected long[] candidateSubreductArray
protected int[] candidateSubreductConsistencyArray
protected long startTime
protected long endTime
protected long backtrackSteps
protected java.lang.String runTimeInformation
| 构造方法详细信息 |
|---|
public RoughDecisionSystem(java.io.Reader paraReader)
throws java.io.IOException
paraReader - the input with the form of a Reader. We can generate a
FileReader given an .arff filename.java.io.IOExceptionpublic RoughDecisionSystem(Instances paraDataset)
paraDataset - the initial dataset with the form of Instance.
public RoughDecisionSystem(Instances paraDataset,
int paraCapacity)
public RoughDecisionSystem(Instances source,
int first,
int toCopy)
public RoughDecisionSystem(java.lang.String name,
FastVector attInfo,
int capacity)
public RoughDecisionSystem(Instances paraDataset,
boolean[] paraSelectedAttributes)
paraDataset - the initial dataset with the form of Instance.paraSelectedAttributes - selected attributes, others are removed.| 方法详细信息 |
|---|
protected void copyForClone(RoughDecisionSystem paraDecisionSystem)
paraDecisionSystem - the decision system that copy from.public void setArffFilename(java.lang.String paraFilename)
paraFilename - the given filename.
public java.lang.String getArffFilename()
throws java.lang.Exception
java.lang.Exception - if the filename is not assigned.public int getNumberOfConditions()
public boolean isNominal()
public boolean isNumeric()
public boolean hasMissingValue()
public boolean isNormalized()
public void setMeasure(int paraMeasure)
throws java.lang.Exception
paraMeasure - the given measure.java.lang.Exceptionpublic int getMeasure()
public int computeConsistency()
throws java.lang.Exception
java.lang.ExceptioncomputeConsistency(boolean[])
public int computeConsistency(long paraSelectedAttributesByLong)
throws java.lang.Exception
paraSelectedAttributesByLong - the test set represented by an integer.java.lang.Exception - because it might be thrown by
SimpleTool.longToBooleanArray().computeConsistency(boolean[])
public int computeConsistency(boolean[] paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - selected attributes represented as a boolean array.java.lang.Exception
public int positiveRegion()
throws java.lang.Exception
java.lang.ExceptionpositiveRegion(boolean[]).
public int positiveRegion(long paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - the attribute subset represented by a long integer.java.lang.ExceptionpositiveRegion(boolean[])
public int positiveRegion(boolean[] paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - selected attributes represented as a boolean array.java.lang.Exception - for overridden by subclasses.
public int entropyReciprocal()
throws java.lang.Exception
java.lang.Exception - from conditionalEntropy().
public int entropyReciprocal(long paraSelectedAttributesByLong)
throws java.lang.Exception
paraSelectedAttributesByLong - the test set represented by an integer.java.lang.Exception - from conditionalEntropy(int).
public int entropyReciprocal(boolean[] paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - selected attributes represented as a boolean array.java.lang.Exception - for overridden by subclasses.
public int entropyReciprocal(double paraEntropy)
throws java.lang.Exception
paraEntropy - the given entropy.java.lang.Exception - for overridden by subclasses.
public int entropyReciprocal(Instances[] paraInstancesArray)
throws java.lang.Exception
paraInstancesArray - instances array.java.lang.Exception
public double conditionalEntropy()
throws java.lang.Exception
java.lang.Exception - for overridden by subclasses.conditionalEntropy(boolean[])
public double conditionalEntropy(long paraSelectedAttributesByLong)
throws java.lang.Exception
paraSelectedAttributesByLong - the selected attributes represented by a long integer.java.lang.ExceptionconditionalEntropy(boolean[])
public double conditionalEntropy(boolean[] paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - the selected attributes.java.lang.Exception - for overridden by subclasses.
public double conditionalEntropy(Instances[] paraInstancesArray)
throws java.lang.Exception
paraInstancesArray - object subsets.java.lang.Exceptionpublic double classEntropy()
classEntropy(Instances)public double classEntropy(Instances paraData)
paraData - the data for which entropy is to be computed
public int majority()
throws java.lang.Exception
java.lang.Exceptionmajority(boolean[])
public int majority(long paraSelectedAttributesByLong)
throws java.lang.Exception
paraSelectedAttributesByLong - the test set represented by an integer.java.lang.Exception - for negative number. Maybe not initialized.majority(boolean[])
public int majority(boolean[] paraSelectedAttributes)
throws java.lang.Exception
paraSelectedAttributes - selected attributes represented as a boolean array.java.lang.Exception
public void initializeForReduction()
throws java.lang.Exception
java.lang.Exception - missing values exists.public boolean[] getOptimalReduct()
public boolean[] computeCore()
throws java.lang.Exception
java.lang.ExceptioncomputeCore(boolean[])
public boolean[] computeCore(boolean[] paraAvailableAttributes)
throws java.lang.Exception
paraAvailableAttributes - available attributesjava.lang.Exceptionpublic void setAllReductsFilename(java.lang.String paraFilename)
paraFilename - the given filename.
public java.lang.String getAllReductsFilename()
throws java.lang.Exception
java.lang.Exception - to avoid the null pointer exception.
public void readAllReducts()
throws java.io.IOException,
java.lang.Exception
java.io.IOException - if an error occurr while reading the file. It is thrown
directly without processing.java.lang.Exception - if an attribute index exceeds the bound.
public void readAllReducts(java.lang.String paraFilename)
throws java.io.IOException,
java.lang.Exception
paraFilename - the filename of the reduct file.java.io.IOException - if an error occurr while reading the file.java.lang.Exception - if an attribute index exceeds the bound.
public void printAllReducts()
throws java.lang.Exception
java.lang.Exception
public void writeAllReducts()
throws java.lang.Exception
java.lang.Exception - For file writing.public java.lang.String getAllReductsString()
public void setAllReductsFilename()
public void setCurrentReduct(long paraCurrentReduct)
paraCurrentReduct - current reduct with a form of long.public void setCurrentReduct(boolean[] paraCurrentReduct)
paraCurrentReduct - current reduct with a form of boolean array.public boolean[] getCurrentReduct()
public int getCurrentReductIndex()
throws java.lang.Exception
java.lang.Exception - if the reduct or the set of all reducts not computed yet, or
the current reduct is not valid.
public java.lang.String getReductString()
throws java.lang.Exception
java.lang.Exceptionpublic int[] getCandidateSubreductConsistencyArray()
public void setAllSubreductsFilename()
public void setAllSubreductsFilename(java.lang.String paraFilename)
paraFilename - the given filename.
public java.lang.String getAllSubreductsFilename()
throws java.lang.Exception
java.lang.Exception
public void readAllSubreducts()
throws java.io.IOException,
java.lang.Exception
java.io.IOException - if an error occurr while reading the file.java.lang.Exception - if an attribute index exceeds the bound.readAllSubreducts(String)
public void readAllSubreducts(java.lang.String paraFilename)
throws java.io.IOException,
java.lang.Exception
paraFilename - the filename of the reduct file.java.io.IOException - if an error occurr while reading the file.java.lang.Exception - if an attribute index exceeds the bound.public long getReductionTime()
public java.lang.String getRunTimeInformation()
public long getBacktrackSteps()
public void delete(boolean[] paraIndices)
paraIndices - The indices marked with false are deleted. Although not
checked, the length of paraIndices should be
numberOfInstances.
public RoughDecisionSystem[] divideInTwo(double paraPercentage)
throws java.lang.Exception
paraPercentage - The percentage of instances in the first subset.java.lang.Exception
public RoughDecisionSystem normalize()
throws java.lang.Exception
java.lang.Exception - for I/O exceptions.public java.lang.String getArffSource()
public java.lang.String toString()
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||