coser.datamodel.decisionsystem
类 RoughDecisionSystem

java.lang.Object
  继承者 Instances
      继承者 coser.datamodel.decisionsystem.RoughDecisionSystem
直接已知子类:
CostSensitiveDecisionSystem, PartialCovering

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
 

字段详细信息

arffFilename

protected java.lang.String arffFilename
The file for the basic decision system.


numberOfConditions

protected int numberOfConditions
Number of conditional attributes. This variable is used to avoid invoking numAttributes() - 1, which might be time-consuming.


numberOfInstances

protected int numberOfInstances
Number of instances. This variable is used to avoid invoking numInstances(), which might be time-consuming.


classSize

protected int classSize
The number of values of the class attribute.


allConditions

protected boolean[] allConditions
The set of all conditional attributes. An array with only true values. It is used to save time while computing.


POSITIVE_REGION

public static final int POSITIVE_REGION
Positive region based, for attribute reduct definition.

另请参见:
常量字段值

CONDITIONAL_ENTROPY

public static final int CONDITIONAL_ENTROPY
Conditional entropy based, for attribute reduct definition.

另请参见:
常量字段值

MAJORITY

public static final int MAJORITY
Majority based, for attribute reduct definition.

另请参见:
常量字段值

consistency

protected int consistency
The consistency computed for the current measure. It is comparable to totalEntropy, totalPositiveRegion and totalMajority.


totalEntropy

protected double totalEntropy
The total entropy of the decision system;


totalPositiveRegion

protected int totalPositiveRegion
The total positive region of the decision system;


totalMajority

protected int totalMajority
The total majority of the decision system;


allReductsFilename

protected java.lang.String allReductsFilename
The file for all reducts.


allReducts

protected boolean[][] allReducts
The set of all reducts. This class only support reading reducts from a file. The computation of reducts is not supported because we do not know the characteristics of the decision system (numeric, nominal, etc).


currentReduct

protected boolean[] currentReduct
The current reduct represented by an boolean array. It is more useful in subclasses.


currentSelectedAttributes

protected boolean[] currentSelectedAttributes
Currently selected attributes. Used in the process of reduction. Useful in subclasses.


core

protected boolean[] core
The array that indicate the set of core attributes. Useful in subclasses.


minimalReductSize

protected int minimalReductSize
The size of the minimal reduct.


optimalReduct

protected boolean[] optimalReduct
The optimal reduct. More useful in subclasses.


numberOfCandidateReducts

protected int numberOfCandidateReducts
The number of candidate reducts.


candidateReductArray

protected long[] candidateReductArray
Candidate reduct array, useful in the process of reduction.


allSubreductsFilename

protected java.lang.String allSubreductsFilename
The file for all subreducts. Now the concept of subreduct is only supported by nominal decision systems. In the further, however, we may move it to general decision systems. In that case, the information entropy is not applicable.


allSubreducts

protected boolean[][] allSubreducts
The set of all subreducts. Similar to the case of allReducts, it can be read, however not computed in this class.


numberOfCandidateSubreducts

protected int numberOfCandidateSubreducts
Number of candidate sub-reducts


candidateSubreductArray

protected long[] candidateSubreductArray
Candidate sub-reduct array


candidateSubreductConsistencyArray

protected int[] candidateSubreductConsistencyArray
Candidate sub-reduct consistency array


startTime

protected long startTime
Reduction start time, only useful in subclasses.


endTime

protected long endTime
Reduction end time, only useful in subclasses.


backtrackSteps

protected long backtrackSteps
Backtrack steps, only useful in subclasses.


runTimeInformation

protected java.lang.String runTimeInformation
Runtime information, only useful in subclasses.

构造方法详细信息

RoughDecisionSystem

public RoughDecisionSystem(java.io.Reader paraReader)
                    throws java.io.IOException
Construct the rough decision system. Simply adopt everything of the super class. This is the most often invoked constructor.

参数:
paraReader - the input with the form of a Reader. We can generate a FileReader given an .arff filename.
抛出:
java.io.IOException

RoughDecisionSystem

public RoughDecisionSystem(Instances paraDataset)
Construct the decision system, essentially clone a decision system. Simply adopt everything of the super class.

参数:
paraDataset - the initial dataset with the form of Instance.

RoughDecisionSystem

public RoughDecisionSystem(Instances paraDataset,
                           int paraCapacity)
Construct the decision system. Simply adopt everything of the super class.


RoughDecisionSystem

public RoughDecisionSystem(Instances source,
                           int first,
                           int toCopy)
Construct the decision system. Simply adopt everything of the super class.


RoughDecisionSystem

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


RoughDecisionSystem

public RoughDecisionSystem(Instances paraDataset,
                           boolean[] paraSelectedAttributes)
Construct a new sub decision system with selected attributes.

参数:
paraDataset - the initial dataset with the form of Instance.
paraSelectedAttributes - selected attributes, others are removed.
方法详细信息

copyForClone

protected void copyForClone(RoughDecisionSystem paraDecisionSystem)
Copy from the given decision system. This method is often invoked in subclasses.

参数:
paraDecisionSystem - the decision system that copy from.

setArffFilename

public void setArffFilename(java.lang.String paraFilename)
Set the arff filename such that it can be stored and reloaded next time. It is not used to read the file this time. At the same time set the reduct filename and subreduct filename. They can be constructed from the arff filename

参数:
paraFilename - the given filename.

getArffFilename

public java.lang.String getArffFilename()
                                 throws java.lang.Exception
Get the arff filename of the current dataset.

返回:
arff filename of the current dataset.
抛出:
java.lang.Exception - if the filename is not assigned.

getNumberOfConditions

public int getNumberOfConditions()
Get the number of conditions, only invoked by those who have not access to numberOfConditions.

返回:
the number of conditions.

isNominal

public boolean isNominal()
Is the decision system nominal?

返回:
true only if all attributes are nominal.

isNumeric

public boolean isNumeric()
Is the decision system numeric?

返回:
true only if all attributes except the decision class are numeric.

hasMissingValue

public boolean hasMissingValue()
Has the decision system missing value?

返回:
has missing value or not.

isNormalized

public boolean isNormalized()
Is the decision system normalized?

返回:
true only if all attribute values are in [0, 1].

setMeasure

public void setMeasure(int paraMeasure)
                throws java.lang.Exception
Set the measure for evaluation the consistency of an attribute or a decision system. At the same time compute the consistency.

参数:
paraMeasure - the given measure.
抛出:
java.lang.Exception

getMeasure

public int getMeasure()
Get the measure.

返回:
the measure.

computeConsistency

public int computeConsistency()
                       throws java.lang.Exception
Compute the attribute set consistency. At the same time set the consistency variable.

返回:
the attribute set consistency.
抛出:
java.lang.Exception
另请参见:
computeConsistency(boolean[])

computeConsistency

public int computeConsistency(long paraSelectedAttributesByLong)
                       throws java.lang.Exception
Compute the attribute set consistency.

参数:
paraSelectedAttributesByLong - the test set represented by an integer.
返回:
the attribute set consistency.
抛出:
java.lang.Exception - because it might be thrown by SimpleTool.longToBooleanArray().
另请参见:
computeConsistency(boolean[])

computeConsistency

public int computeConsistency(boolean[] paraSelectedAttributes)
                       throws java.lang.Exception
Compute the attribute set consistency.

参数:
paraSelectedAttributes - selected attributes represented as a boolean array.
返回:
the attribute set consistency.
抛出:
java.lang.Exception

positiveRegion

public int positiveRegion()
                   throws java.lang.Exception
Compute the positive region size using all conditional attributes, essentially an abstract method.

返回:
the number of objects in the positive region.
抛出:
java.lang.Exception
另请参见:
positiveRegion(boolean[]).

positiveRegion

public int positiveRegion(long paraSelectedAttributes)
                   throws java.lang.Exception
Compute the positive region size given the attribute subset, for overload.

参数:
paraSelectedAttributes - the attribute subset represented by a long integer.
返回:
the number of objects in the positive region.
抛出:
java.lang.Exception
另请参见:
positiveRegion(boolean[])

positiveRegion

public int positiveRegion(boolean[] paraSelectedAttributes)
                   throws java.lang.Exception
Compute the positive region given the attribute subset, should be overridden.

参数:
paraSelectedAttributes - selected attributes represented as a boolean array.
返回:
the number of objects in the positive region.
抛出:
java.lang.Exception - for overridden by subclasses.

entropyReciprocal

public int entropyReciprocal()
                      throws java.lang.Exception
Compute the entropy reciprocal. It is defined by (ENTROPY_RECIPROCAL_CONSTANT / entropy).

返回:
the entropy reciprocal.
抛出:
java.lang.Exception - from conditionalEntropy().

entropyReciprocal

public int entropyReciprocal(long paraSelectedAttributesByLong)
                      throws java.lang.Exception
Compute the entropy reciprocal.

参数:
paraSelectedAttributesByLong - the test set represented by an integer.
返回:
the entropy reciprocal.
抛出:
java.lang.Exception - from conditionalEntropy(int).

entropyReciprocal

public int entropyReciprocal(boolean[] paraSelectedAttributes)
                      throws java.lang.Exception
Compute the entropy reciprocal.

参数:
paraSelectedAttributes - selected attributes represented as a boolean array.
返回:
the entropy reciprocal.
抛出:
java.lang.Exception - for overridden by subclasses.

entropyReciprocal

public int entropyReciprocal(double paraEntropy)
                      throws java.lang.Exception
Compute the entropy reciprocal.

参数:
paraEntropy - the given entropy.
返回:
the entropy reciprocal.
抛出:
java.lang.Exception - for overridden by subclasses.

entropyReciprocal

public int entropyReciprocal(Instances[] paraInstancesArray)
                      throws java.lang.Exception
Compute the entropy reciprocal for object subsets.

参数:
paraInstancesArray - instances array.
返回:
the entropy reciprocal for object subsets.
抛出:
java.lang.Exception

conditionalEntropy

public double conditionalEntropy()
                          throws java.lang.Exception
Computes the conditional entropy of this dataset, for overload.

返回:
the conditional entropy of all attributes.
抛出:
java.lang.Exception - for overridden by subclasses.
另请参见:
conditionalEntropy(boolean[])

conditionalEntropy

public double conditionalEntropy(long paraSelectedAttributesByLong)
                          throws java.lang.Exception
Compute the conditional entropy given an attribute subset, for overload. It supports attribute subsets represented by a long.

参数:
paraSelectedAttributesByLong - the selected attributes represented by a long integer.
返回:
the conditional entropy of selected attributes.
抛出:
java.lang.Exception
另请参见:
conditionalEntropy(boolean[])

conditionalEntropy

public double conditionalEntropy(boolean[] paraSelectedAttributes)
                          throws java.lang.Exception
Compute the conditional entropy given an attribute subset represented by a boolean array, essentially an abstract method. Subclasses should override it.

参数:
paraSelectedAttributes - the selected attributes.
返回:
the conditional entropy of selected attributes.
抛出:
java.lang.Exception - for overridden by subclasses.

conditionalEntropy

public double conditionalEntropy(Instances[] paraInstancesArray)
                          throws java.lang.Exception
Computes the conditional entropy of object subsets.

参数:
paraInstancesArray - object subsets.
返回:
the conditional entropy of object subsets.
抛出:
java.lang.Exception

classEntropy

public double classEntropy()
Computes the entropy of a dataset by considering the class attribute. This is valid for all data since the decision attribute is always nominal.

返回:
the entropy of the decision system's class distribution
另请参见:
classEntropy(Instances)

classEntropy

public double classEntropy(Instances paraData)
Computes the entropy of a dataset by considering the class attribute. It is valid for all data since the decision attribute is always nominal. Copied from Id3.java.

参数:
paraData - the data for which entropy is to be computed
返回:
the entropy of the data's class distribution

majority

public int majority()
             throws java.lang.Exception
Compute the majority number of instances, for overload.

返回:
the majority number of instances.
抛出:
java.lang.Exception
另请参见:
majority(boolean[])

majority

public int majority(long paraSelectedAttributesByLong)
             throws java.lang.Exception
Compute the majority number of instances, for overload.

参数:
paraSelectedAttributesByLong - the test set represented by an integer.
返回:
the majority number of instances.
抛出:
java.lang.Exception - for negative number. Maybe not initialized.
另请参见:
majority(boolean[])

majority

public int majority(boolean[] paraSelectedAttributes)
             throws java.lang.Exception
Compute the majority number of instances, should be overridden.

参数:
paraSelectedAttributes - selected attributes represented as a boolean array.
返回:
the majority number of instances.
抛出:
java.lang.Exception

initializeForReduction

public void initializeForReduction()
                            throws java.lang.Exception
Initialize for reduction. All attributes are marked as unselected. Missing values are not supported.

抛出:
java.lang.Exception - missing values exists.

getOptimalReduct

public boolean[] getOptimalReduct()
Get the optimal reduct. "Optimal" has different definitions in definition environment.
For a decision system, an optimal reduct is a minimal reduct.
For a test-cost-senstive decision system, an optimal reduct is a minimal test-cost reduct.
For a both-cost-senstive decision system, an optimal reduct is a minimal cost reduct.
Therefore, this method is essentially an abstract method.

返回:
the optimal reduct.

computeCore

public boolean[] computeCore()
                      throws java.lang.Exception
Compute the core, essentially an abstract method.

返回:
the core with the form of boolean vector.
抛出:
java.lang.Exception
另请参见:
computeCore(boolean[])

computeCore

public boolean[] computeCore(boolean[] paraAvailableAttributes)
                      throws java.lang.Exception
Find a core with available attributes, should be overridden.

参数:
paraAvailableAttributes - available attributes
返回:
the core with the form of boolean vector.
抛出:
java.lang.Exception

setAllReductsFilename

public void setAllReductsFilename(java.lang.String paraFilename)
Set the red filename such that it can be stored for and reloaded next time. It is not used to read the file this time.

参数:
paraFilename - the given filename.

getAllReductsFilename

public java.lang.String getAllReductsFilename()
                                       throws java.lang.Exception
Get the sred filename.

返回:
the filename of all reducts
抛出:
java.lang.Exception - to avoid the null pointer exception.

readAllReducts

public void readAllReducts()
                    throws java.io.IOException,
                           java.lang.Exception
Read all reducts from the default reduct file, whose filename only differs from the arff file by the suffix.

抛出:
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.

readAllReducts

public void readAllReducts(java.lang.String paraFilename)
                    throws java.io.IOException,
                           java.lang.Exception
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. Each line corresponds with a reduct, and each element corresponds with the index of the attribute.

参数:
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.

printAllReducts

public void printAllReducts()
                     throws java.lang.Exception
Print all reducts. Only for testing.

抛出:
java.lang.Exception

writeAllReducts

public void writeAllReducts()
                     throws java.lang.Exception
Write all reducts to the default reduct file, whose filename only differs from the arff file by the suffix.

抛出:
java.lang.Exception - For file writing.

getAllReductsString

public java.lang.String getAllReductsString()
Get all reducts reprensented by a string, which can be written to a .reds file directly.

返回:
a string indicating all reducts.

setAllReductsFilename

public void setAllReductsFilename()
Set the reds filename such that it can be stored for and reloaded next time. It is based on the arff filename.


setCurrentReduct

public void setCurrentReduct(long paraCurrentReduct)
Set the current reduct.

参数:
paraCurrentReduct - current reduct with a form of long.

setCurrentReduct

public void setCurrentReduct(boolean[] paraCurrentReduct)
Set the current reduct. The current reduct is a clone of the given array to avoid conflict.

参数:
paraCurrentReduct - current reduct with a form of boolean array.

getCurrentReduct

public boolean[] getCurrentReduct()
Get the current reduct.

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

getCurrentReductIndex

public int getCurrentReductIndex()
                          throws java.lang.Exception
Get the index of the current index. Although the current reduct is obtained in subclasses, this method will not be overridden.

返回:
the index of the current reduct.
抛出:
java.lang.Exception - if the reduct or the set of all reducts not computed yet, or the current reduct is not valid.

getReductString

public java.lang.String getReductString()
                                 throws java.lang.Exception
Get the current reduct with the form of String.

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

getCandidateSubreductConsistencyArray

public int[] getCandidateSubreductConsistencyArray()
Get the candidate subreduct entropy array. May be used somewhere else such as AllSubreductsDialog.java.


setAllSubreductsFilename

public void setAllSubreductsFilename()
Set the sred filename such that it can be stored for and reloaded next time. It is based on the arff filename.


setAllSubreductsFilename

public void setAllSubreductsFilename(java.lang.String paraFilename)
Set the sred filename such that it can be stored for and reloaded next time. It is not used to read the file this time.

参数:
paraFilename - the given filename.

getAllSubreductsFilename

public java.lang.String getAllSubreductsFilename()
                                          throws java.lang.Exception
Get the sred filename.

返回:
the filename of all subreducts
抛出:
java.lang.Exception

readAllSubreducts

public void readAllSubreducts()
                       throws java.io.IOException,
                              java.lang.Exception
Read all subreducts from the default subreduct file, whose filename only differs from the arff file by the suffix. The entropy of each subreduct is stored, therefore it is inappropriate to employ positive region based approaches while reading the file.

抛出:
java.io.IOException - if an error occurr while reading the file.
java.lang.Exception - if an attribute index exceeds the bound.
另请参见:
readAllSubreducts(String)

readAllSubreducts

public void readAllSubreducts(java.lang.String paraFilename)
                       throws java.io.IOException,
                              java.lang.Exception
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. Each line corresponds with a subreduct, the real number correspond with the conditional entropy of the subreduct.

参数:
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.

getReductionTime

public long getReductionTime()
Get the reduction run time.

返回:
the reduction run time.

getRunTimeInformation

public java.lang.String getRunTimeInformation()
Get the run time information.

返回:
the run time informaion in a string.

getBacktrackSteps

public long getBacktrackSteps()
Get the backtrack steps. Many subclasses need backtrack algorithms.

返回:
the backtrack steps.

delete

public void delete(boolean[] paraIndices)
Delete elements marked FALSE in a boolean array.

参数:
paraIndices - The indices marked with false are deleted. Although not checked, the length of paraIndices should be numberOfInstances.

divideInTwo

public RoughDecisionSystem[] divideInTwo(double paraPercentage)
                                  throws java.lang.Exception
Divide the decision system in two according to the given percentage. Obtain two subsets for training and testing classifiers.

参数:
paraPercentage - The percentage of instances in the first subset.
返回:
Two decision systems in an array.
抛出:
java.lang.Exception

normalize

public RoughDecisionSystem normalize()
                              throws java.lang.Exception
Normalize the current decision system and write to an arff file. Symbolic attributes are also normalized. Do not normalize the class. Missing values are set to 0.5. After normalization, this decision system is not modified.

返回:
the normalized decision system.
抛出:
java.lang.Exception - for I/O exceptions.

getArffSource

public java.lang.String getArffSource()
Get the arff source.

返回:
arff source as a string, which can be wrote to an arff file directly.

toString

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

返回:
object status.