coser.datamodel.informationsystem
类 NominalInformationSystem

java.lang.Object
  继承者 Instances
      继承者 coser.datamodel.informationsystem.RoughInformationSystem
          继承者 coser.datamodel.informationsystem.NominalInformationSystem

public class NominalInformationSystem
extends RoughInformationSystem

Summary: Information system with only nominal values.

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: Half done.
Written time: April 12, 2012.
Last modify time: July 4, 2012.


字段摘要
修饰符 和 类型 字段 和 描述
static int APRIORI
          The apriori algorithm.
(专用软件包)  boolean[][] conceptsRelationshipMatrix
          Who is who's sub-concept (subset).
static int FPGROWTH
          The FP-growth algorithm.
(专用软件包)  Concept[] frequentConcepts
          All frequent concepts.
(专用软件包)  Concept[][] frequentConceptsByLength
          Frequent concepts of different length.
(专用软件包)  int[][] frequentConceptsExtensionInInteger
          The extension of frequent concepts.
(专用软件包)  int[] frequentConceptsSizes
          The number of frequent concepts for respective length.
static int MAX_CONCEPT_LENGTH
          The maximal length of a concept.
static int MAX_CONCEPTS
          The maximal number of concepts/itemsets.
(专用软件包)  int maximalConceptLength
          Frequent concept maximal length.
(专用软件包)  int totalAttributeValues
          The total number of attribute values.
 
从类 coser.datamodel.informationsystem.RoughInformationSystem 继承的字段
allConditions, allReducts, allReductsFilename, allSubreducts, allSubreductsFilename, arffFilename, backtrackSteps, candidateReductArray, candidateSubreductArray, candidateSubreductEntropyArray, core, currentReduct, currentSelectedAttributes, endTime, minimalReductSize, numberOfAttributes, numberOfCandidateReducts, numberOfCandidateSubreducts, numberOfInstances, optimalReduct, runTimeInformation, startTime, STRANGE_VALUE
 
构造方法摘要
构造函数 和 描述
NominalInformationSystem(Instances paraDataset)
          Construct the decision system.
NominalInformationSystem(Instances paraDataset, int paraCapacity)
          Construct the decision system.
NominalInformationSystem(Instances paraSource, int paraFirst, int paraToCopy)
          Construct the decision system.
NominalInformationSystem(NominalInformationSystem paraDataset, boolean[] paraSelectedAttributes)
          Construct the decision system.
NominalInformationSystem(java.io.Reader paraReader)
          Construct the decision system.
NominalInformationSystem(java.lang.String paraName, FastVector paraAttInfo, int paraCapacity)
          Construct the decision system.
 
方法摘要
修饰符 和 类型 方法 和 描述
 boolean adjustID(Attribute paraID)
          Adjust the information system to remove objects without the given ID.
 java.lang.String allFrequentConceptsToString()
          Convert all concepts to string for display.
protected  Concept[] aprioriGeneration(int paraLevel)
          Generate frequent itemsets of the given length.
 Concept[] computeFrequentConcepts(double paraSupportThreshold, int paraAlgorithm)
          Mine frequent concepts.
protected  Concept[] computeFrequentConceptsApriori(double paraSupportThreshold)
          Mine frequent concepts using the Apriori algorithm.
protected  int[][] computeFrequentConceptsExtension()
          Compute frequent concepts extension through copying frequent concepts.
protected  Concept[] computeFrequentConceptsFpgrowth(double paraSupportThreshold)
          Mine frequent concepts using the FP-growth algorithm.
protected  Concept[] computeLength1FrequentConcepts(double paraSupportThreshold)
          Compute length-1 frequent itemsets.
 void deleteAttributeAt(int paraIndex)
          While deleting attribute, reset the scaled attributes.
 boolean[] extensionInBooleanArray(Concept paraConcept)
          The extension of a concept.
 int[] extensionInIntegerArray(Concept paraConcept)
          The extension of a concept in integer array.
 int[][] getFrequentConceptsExtension()
          Get the frequent concepts extension an int two-dimensional array (not a matrix).
static void main(java.lang.String[] args)
          Test incrementalJoin.
protected  Concept[] removeInfrequentConcepts(Concept[] paraConcepts, double paraSupportThreshold)
          Remove infrequent concepts.
 void setScaled(boolean paraScaled)
          Set the variable scaled.
 java.lang.String toString()
          For toString().
 
从类 coser.datamodel.informationsystem.RoughInformationSystem 继承的方法
computeCore, computeCore, delete, divideInTwo, generateBooleanArrays, getAllReductsFilename, getAllReductsString, getAllSubreductsFilename, getArffFilename, getArffSource, getBacktrackSteps, getCandidateSubreductEntropyArray, getCurrentReduct, getCurrentReductIndex, getNumberOfConditions, getOptimalReduct, getReductionTime, getReductString, getRunTimeInformation, hasMissingValue, initializeForReduction, isBoolean, isNominal, isNormalized, isNormalizedJudge, isNumeric, normalize, printAllReducts, readAllReducts, readAllReducts, readAllSubreducts, readAllSubreducts, removeSupersets, resetNumberOfAttributes, setAllReductsFilename, setAllReductsFilename, setAllSubreductsFilename, setAllSubreductsFilename, setArffFilename, setCurrentReduct, setCurrentReduct, writeAllReducts
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

MAX_CONCEPTS

public static final int MAX_CONCEPTS
The maximal number of concepts/itemsets. If there are too many frequent concepts, "array index out of bounds" exception will be thrown.

另请参见:
常量字段值

MAX_CONCEPT_LENGTH

public static final int MAX_CONCEPT_LENGTH
The maximal length of a concept.

另请参见:
常量字段值

totalAttributeValues

int totalAttributeValues
The total number of attribute values.


frequentConcepts

Concept[] frequentConcepts
All frequent concepts.


conceptsRelationshipMatrix

boolean[][] conceptsRelationshipMatrix
Who is who's sub-concept (subset).


frequentConceptsExtensionInInteger

int[][] frequentConceptsExtensionInInteger
The extension of frequent concepts. The extension of a concept is the object subset described by the concept.


frequentConceptsByLength

Concept[][] frequentConceptsByLength
Frequent concepts of different length.


frequentConceptsSizes

int[] frequentConceptsSizes
The number of frequent concepts for respective length.


maximalConceptLength

int maximalConceptLength
Frequent concept maximal length.


APRIORI

public static final int APRIORI
The apriori algorithm.

另请参见:
常量字段值

FPGROWTH

public static final int FPGROWTH
The FP-growth algorithm.

另请参见:
常量字段值
构造方法详细信息

NominalInformationSystem

public NominalInformationSystem(java.io.Reader paraReader)
                         throws java.io.IOException,
                                java.lang.Exception
Construct the decision system. Simply adopt everything of the super class. This is the most often used constructor since it reads from a file.

参数:
paraReader - the given reader, often with the form of a file reader. We can generate a FileReader given an .arff filename.
抛出:
java.io.IOException
java.lang.Exception

NominalInformationSystem

public NominalInformationSystem(Instances paraDataset)
                         throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

NominalInformationSystem

public NominalInformationSystem(Instances paraDataset,
                                int paraCapacity)
                         throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class. Rarely used.

抛出:
java.lang.Exception

NominalInformationSystem

public NominalInformationSystem(Instances paraSource,
                                int paraFirst,
                                int paraToCopy)
                         throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

NominalInformationSystem

public NominalInformationSystem(java.lang.String paraName,
                                FastVector paraAttInfo,
                                int paraCapacity)
                         throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

NominalInformationSystem

public NominalInformationSystem(NominalInformationSystem paraDataset,
                                boolean[] paraSelectedAttributes)
                         throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception
方法详细信息

adjustID

public boolean adjustID(Attribute paraID)
                 throws java.lang.Exception
Adjust the information system to remove objects without the given ID. This is because many datasets contain redundant data. For example, some registered customers never buy anything on the website, or some products are never bought by anyone.

参数:
paraID - the given set of ID
返回:
true if adjusted, false if no need to adjust.
抛出:
java.lang.Exception - if it cannot be adjusted

setScaled

public void setScaled(boolean paraScaled)
Set the variable scaled. This method should be invoked before generating frequent concepts. It avoids transferring the parameter in many methods.

参数:
paraScaled - Whether or not scale.

extensionInBooleanArray

public boolean[] extensionInBooleanArray(Concept paraConcept)
The extension of a concept. This method might be rather slow since it requires a scan of the information system.

参数:
paraConcept - the given concept.
返回:
The set in a boolean array with fixed length.

extensionInIntegerArray

public int[] extensionInIntegerArray(Concept paraConcept)
The extension of a concept in integer array.

参数:
paraConcept - the given concept.
返回:
The set in an integer array with variable length.

computeFrequentConcepts

public Concept[] computeFrequentConcepts(double paraSupportThreshold,
                                         int paraAlgorithm)
                                  throws java.lang.Exception
Mine frequent concepts.

参数:
paraSupportThreshold - the threshold of support measure.
paraAlgorithm - the algorithm index.
抛出:
java.lang.Exception

computeFrequentConceptsApriori

protected Concept[] computeFrequentConceptsApriori(double paraSupportThreshold)
                                            throws java.lang.Exception
Mine frequent concepts using the Apriori algorithm.

参数:
paraSupportThreshold - the threshold of support measure.
抛出:
java.lang.Exception - If there are too many frequent concepts to handle.

computeLength1FrequentConcepts

protected Concept[] computeLength1FrequentConcepts(double paraSupportThreshold)
Compute length-1 frequent itemsets. Stored in variable frequentConceptsByLength. This method is the core method since it is the only difference between the nominal and scaled data.

参数:
paraSupportThreshold - the threshold of support measure.
返回:
Frequent concepts with length-1.

removeInfrequentConcepts

protected Concept[] removeInfrequentConcepts(Concept[] paraConcepts,
                                             double paraSupportThreshold)
Remove infrequent concepts. Should scan the dataset once.

参数:
paraConcepts - Candidate concepts.
paraSupportThreshold - The support threshold by percentage.
返回:
Frequent concepts.

aprioriGeneration

protected Concept[] aprioriGeneration(int paraLevel)
                               throws java.lang.Exception
Generate frequent itemsets of the given length.

参数:
paraLevel - the level of itemsets.
抛出:
java.lang.Exception - When there are too many frequent concepts

computeFrequentConceptsFpgrowth

protected Concept[] computeFrequentConceptsFpgrowth(double paraSupportThreshold)
Mine frequent concepts using the FP-growth algorithm.

参数:
paraSupportThreshold - the threshold of support measure.

computeFrequentConceptsExtension

protected int[][] computeFrequentConceptsExtension()
                                            throws java.lang.Exception
Compute frequent concepts extension through copying frequent concepts. An extension is an object subset.

抛出:
java.lang.Exception

getFrequentConceptsExtension

public int[][] getFrequentConceptsExtension()
Get the frequent concepts extension an int two-dimensional array (not a matrix).


allFrequentConceptsToString

public java.lang.String allFrequentConceptsToString()
Convert all concepts to string for display.

返回:
object status.

deleteAttributeAt

public void deleteAttributeAt(int paraIndex)
While deleting attribute, reset the scaled attributes.

参数:
paraIndex - the index of the deleted attribute, it should always be 0 in our case.

toString

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

覆盖:
类 RoughInformationSystem 中的 toString
返回:
object status.

main

public static void main(java.lang.String[] args)
Test incrementalJoin.