|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.associations.classification.PruneCAR
weka.associations.classification.CrTree
public class CrTree
Class for building and using a CrTree. A CrTree(n-ary tree in child-sibling representation) can store classification association rules(CARs) and allows pruning and classification. Tree Structure described at: W. Li, J. Han, J.Pei: CMAR: Accurate and Efficient Classification Based on Multiple Class-Association Rules. In ICDM'01:369-376,2001. The child sibling representation for n-ary trees is used
Constructor Summary | |
---|---|
CrTree()
Constructor constructs an empty CrTree |
|
CrTree(CrNode root,
Instances instances,
Instances onlyClass)
Constructor |
|
CrTree(Instances instances,
Instances onlyClass)
Constructor |
Method Summary | |
---|---|
void |
deleteContent(CrNode node,
int index)
Deletes one rule out of the CrTree |
void |
deleteNode(CrNode node)
deletes a node out of the CrTree if possible |
CrList |
getAssociateList()
Gets the associated list |
int |
getDefaultClass()
Gets the default class |
java.lang.String[] |
getOptions()
Gets the current settings of the CrTree object. |
CrNode |
getRoot()
Gets the root node |
void |
insertContent(CrNode node,
FastVector input)
Adds another consequence to an existing premise. |
void |
insertNode(FastVector rulePremise,
FastVector ruleConsequence)
insert a new rule into the CrTree in three steps: 1. |
boolean |
isEmpty()
Checks if the the CrTree is empty |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
void |
makeEmpty()
Deletes the whole CrTree and its associated list by setting the child pointer of the root to null |
java.lang.String |
pathToString(java.lang.String metricString)
Prints a rule |
void |
preprocess(FastVector premises,
FastVector consequences,
FastVector confidences)
The preprocessing step before a rule is inserted into a CrTree. |
void |
prune()
Method for pruning a CrTree. |
void |
pruneBeforeInsertion(FastVector premise,
FastVector consequence)
Method that provides a pruning step before a rule is inserted into the CrTree. |
int |
prunedRules()
Returns the number of pruned rules |
FastVector |
pruningCriterions(FastVector input)
Potentially adds additional measures that can be used as pruning criterias to a rule. |
void |
removeAtChild(CrNode node,
CrNode sibling)
Deletes a node out of the parent list. |
void |
removeAtList(CrNode node)
deletes the node out of the list that connects nodes storing the same item. |
void |
removeAtSibling(CrNode node)
Deletes a node out of the child list. |
int[] |
reportSubtreeCount(CrNode subTreeRoot)
Gets the class distribution of the rules from a subtree of a specified node |
java.lang.String |
rulePremise()
Prints a rule premise (from bottom to top in the tree, respectively infrequent items to frequent ones). |
FastVector |
search(FastVector data)
Searches for an existing rule premise are parts of an rule premise in the CrTree |
void |
setDefaultClass()
Sets the default class as the amjority class in the instances. |
void |
setInstancesNoClass(Instances instances)
Sets the instances (without class attribute) |
void |
setInstancesOnlyClass(Instances instances)
Sets the class information |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
FastVector |
sortItemSet(ItemSet current)
Sorts an item set accoring to the frequencies values of the items. |
java.lang.String |
toString(java.lang.String metricString)
Returns a string description of the CrTree Object |
void |
updateHeight(CrNode node)
Adjust the (minimum) height of a CrListElement |
Methods inherited from class weka.associations.classification.PruneCAR |
---|
forName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CrTree()
public CrTree(CrNode root, Instances instances, Instances onlyClass)
root
- the root nodeinstances
- the instances without class attributeonlyClass
- the class attribute and its values for all instancespublic CrTree(Instances instances, Instances onlyClass)
instances
- the instances without class attributeonlyClass
- the class attribute and its values for all instancesMethod Detail |
---|
public final void setInstancesNoClass(Instances instances)
setInstancesNoClass
in class PruneCAR
instances
- instances without classattributepublic final void setInstancesOnlyClass(Instances instances)
setInstancesOnlyClass
in class PruneCAR
instances
- the class attribute and its valuespublic void preprocess(FastVector premises, FastVector consequences, FastVector confidences) throws java.lang.Exception
preprocess
in class PruneCAR
premises
- the premisesconsequences
- the consequencesconfidences
- the interestingness measures
java.lang.Exception
- throws exception if preprocessing is not possiblepublic void setDefaultClass()
public int getDefaultClass()
public final FastVector sortItemSet(ItemSet current)
current
- the item set
public FastVector pruningCriterions(FastVector input)
pruningCriterions
in class PruneCAR
input
- pruning criteria
public void pruneBeforeInsertion(FastVector premise, FastVector consequence)
pruneBeforeInsertion
in class PruneCAR
premise
- the rule premiseconsequence
- the rule consequencepublic final boolean isEmpty()
isEmpty
in class PruneCAR
public final CrNode getRoot()
public final CrList getAssociateList()
public final void removeAtSibling(CrNode node)
node
- the node that has to be deletet out of the child listpublic final void removeAtChild(CrNode node, CrNode sibling)
node
- the node that has to be deletedsibling
- a sibling nodepublic final void removeAtList(CrNode node)
node
- the node that has to be deletedpublic final void updateHeight(CrNode node)
node
- the node that has to deletedpublic final void deleteContent(CrNode node, int index)
deleteContent
in class PruneCAR
node
- the node where the consequence of the rule is storedindex
- the index of the consequencepublic final void deleteNode(CrNode node)
node
- the node that should be deletedpublic void insertContent(CrNode node, FastVector input)
insertContent
in class PruneCAR
node
- the node where the conesequence should be addedinput
- the consequencepublic final void insertNode(FastVector rulePremise, FastVector ruleConsequence)
rulePremise
- the rule premiseruleConsequence
- the consequence and additional measurespublic final FastVector search(FastVector data)
data
- the rule premise
public void prune()
prune
in class PruneCAR
public final void makeEmpty()
public int[] reportSubtreeCount(CrNode subTreeRoot)
subTreeRoot
- the root of the subtree
public java.lang.String rulePremise()
public java.lang.String toString(java.lang.String metricString)
toString
in class PruneCAR
metricString
- the metric used
public java.lang.String pathToString(java.lang.String metricString)
metricString
- the metric used for class association rule mining
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
There are no options available.
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic int prunedRules()
prunedRules
in class PruneCAR
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |