|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.ObjectInstances
coser.datamodel.informationsystem.RoughInformationSystem
public class RoughInformationSystem extends Instances
Summary: Information systems for rough sets however without algorithm
implementation. The following data are claimed:
1) basic information of the information system;
2) basic information for nominal and numeric information 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: The very beginning. .
Written time: April 12, 2012.
Last modify time: April 12, 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 information 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 double[] |
candidateSubreductEntropyArray
Candidate sub-reduct entropy array |
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. |
protected int |
minimalReductSize
The size of the minimal reduct. |
protected int |
numberOfAttributes
Number of all attributes. |
protected int |
numberOfCandidateReducts
The number of candidate reducts. |
protected int |
numberOfCandidateSubreducts
Number of candidate sub-reducts |
protected int |
numberOfInstances
Number of dataMatrixs. |
protected boolean[] |
optimalReduct
The optimal reduct. |
protected java.lang.String |
runTimeInformation
Runtime information, only useful in subclasses. |
protected long |
startTime
Reduction start time, only useful in subclasses. |
static int |
STRANGE_VALUE
Used to indicate that the value is not computed yet. |
| 构造函数 和 描述 |
|---|
RoughInformationSystem(Instances paraDataset)
Construct the information system, essentially clone a information system. |
RoughInformationSystem(Instances paraDataset,
boolean[] paraSelectedAttributes)
Construct a new sub information system with selected attributes. |
RoughInformationSystem(Instances paraDataset,
int paraCapacity)
Construct the information system. |
RoughInformationSystem(Instances source,
int first,
int toCopy)
Construct the information system. |
RoughInformationSystem(java.io.Reader paraReader)
Construct the rough information system. |
RoughInformationSystem(java.lang.String name,
FastVector attInfo,
int capacity)
Construct the information system. |
| 修饰符 和 类型 | 方法 和 描述 |
|---|---|
boolean[] |
computeCore()
Compute the core, essentially an abstract method. |
boolean[] |
computeCore(boolean[] paraAvailableAttributes)
Find a core with available attributes, should be overridden. |
void |
delete(boolean[] paraIndices)
Delete elements marked FALSE in a boolean array. |
RoughInformationSystem[] |
divideInTwo(double paraPercentage)
Divide the decision system in two according to the given percentage. |
protected boolean[][] |
generateBooleanArrays(double paraPercentage)
Generate two boolean arrays indicating two subsets. |
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. |
double[] |
getCandidateSubreductEntropyArray()
Get the candidate subreduct entropy array. |
boolean[] |
getCurrentReduct()
Get the current reduct. |
int |
getCurrentReductIndex()
Get the index of the current index. |
int |
getNumberOfConditions()
Get the number of conditions, only invoked by those who have not access to numberOfAttributes. |
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 information system missing value? |
void |
initializeForReduction()
Check the information system. |
boolean |
isBoolean()
Is the information system relational? |
boolean |
isNominal()
Is the information system nominal? |
boolean |
isNormalized()
Is the information system normalized? |
protected boolean |
isNormalizedJudge()
Is the decision system normalized? |
boolean |
isNumeric()
Is the information system numeric? |
RoughInformationSystem |
normalize()
Normalize the current decision system and write to an arff file. |
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 reducts from the default reduct 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 1,4,5,7 That is, the first line indicates the number of subreducts. |
static long[] |
removeSupersets(long[] paraSets,
int paraNumberOfConditions)
Remove supersets, used to obtain reducts. |
void |
resetNumberOfAttributes()
Reset number of attributes. |
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. |
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 |
| 字段详细信息 |
|---|
public static int STRANGE_VALUE
protected java.lang.String arffFilename
protected int numberOfAttributes
protected int numberOfInstances
protected boolean[] allConditions
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 double[] candidateSubreductEntropyArray
protected long startTime
protected long endTime
protected long backtrackSteps
protected java.lang.String runTimeInformation
| 构造方法详细信息 |
|---|
public RoughInformationSystem(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 RoughInformationSystem(Instances paraDataset)
paraDataset - the initial dataset with the form of Instance.
public RoughInformationSystem(Instances paraDataset,
int paraCapacity)
public RoughInformationSystem(Instances source,
int first,
int toCopy)
public RoughInformationSystem(java.lang.String name,
FastVector attInfo,
int capacity)
public RoughInformationSystem(Instances paraDataset,
boolean[] paraSelectedAttributes)
paraDataset - the initial dataset with the form of Instance.paraSelectedAttributes - selected attributes, others are removed.| 方法详细信息 |
|---|
public void initializeForReduction()
throws java.lang.Exception
java.lang.Exception - missing values exists.public void setArffFilename(java.lang.String paraFilename)
paraFilename - the given filename.
public java.lang.String getArffFilename()
throws java.lang.Exception
java.lang.Exceptionpublic void resetNumberOfAttributes()
public double[] getCandidateSubreductEntropyArray()
public java.lang.String getRunTimeInformation()
public boolean isNominal()
public boolean isNumeric()
public boolean isNormalized()
public boolean isBoolean()
public boolean hasMissingValue()
protected boolean isNormalizedJudge()
public void delete(boolean[] paraIndices)
paraIndices - The indices marked with false are removed. Although not
checked, the length of paraIndices should be
numberOfInstances.
public RoughInformationSystem[] divideInTwo(double paraPercentage)
throws java.lang.Exception
paraPercentage - The percentage of instances in the first subset.java.lang.Exception
protected boolean[][] generateBooleanArrays(double paraPercentage)
throws java.lang.Exception
paraPercentage - The percentage of instances in the first subset.java.lang.Exceptionpublic int getNumberOfConditions()
public boolean[] getOptimalReduct()
public long getBacktrackSteps()
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 boolean[] computeCore()
throws java.lang.Exception
java.lang.ExceptioncomputeCore(boolean[])
public boolean[] computeCore(boolean[] paraAvailableAttributes)
throws java.lang.Exception
paraAvailableAttributes - available attributesjava.lang.Exception
public java.lang.String getReductString()
throws java.lang.Exception
java.lang.Exception
public RoughInformationSystem normalize()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getArffSource()
public void setAllReductsFilename()
public void setAllReductsFilename(java.lang.String paraFilename)
paraFilename - the given filename.
public java.lang.String getAllReductsFilename()
throws java.lang.Exception
java.lang.Exception
public void readAllReducts()
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.
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()
public void writeAllReducts()
throws java.io.IOException,
java.lang.Exception
java.io.IOException - if an error occurr while writing the file.java.lang.Exception - if an attribute index exceeds the bound.
public java.lang.String getAllReductsString()
throws java.io.IOException,
java.lang.Exception
java.io.IOExceptionjava.lang.Exceptionpublic long getReductionTime()
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.
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 static long[] removeSupersets(long[] paraSets,
int paraNumberOfConditions)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||