|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.rules.Rule
weka.classifiers.rules.FRIP.RipperRule
protected class FRIP.RipperRule
This class implements a single rule that predicts specified class. A rule consists of antecedents "AND"ed together and the consequent (class value) for the classification. In this class, the Information Gain (p*[log(p/t) - log(P/T)]) is used to select an antecedent and Reduced Error Prunning (REP) with the metric of accuracy rate p/(p+n) or (TP+TN)/(P+N) is used to prune the rule.
Field Summary | |
---|---|
protected weka.core.FastVector |
m_Antds
The vector of antecedents of this rule |
private double |
m_confidence
|
private double |
m_Consequent
The internal representation of the class label to be predicted |
(package private) static long |
serialVersionUID
for serialization |
Constructor Summary | |
---|---|
FRIP.RipperRule()
Constructor |
Method Summary | |
---|---|
private double |
computeDefAccu(weka.core.Instances data)
Private function to compute default number of accurate instances in the specified data for the consequent of the rule |
private weka.core.Instances |
computeInfoGain(weka.core.Instances instances,
double defAcRt,
FRIP.Antd antd)
Compute the best information gain for the specified antecedent |
java.lang.Object |
copy()
Get a shallow copy of this rule |
double |
coverageDegree(weka.core.Instance datum)
The degree of coverage instance covered by this rule |
private weka.core.Instances |
coveredData(weka.core.Instances instances)
A function which returns all instances that are covered by the this rule. |
boolean |
covers(weka.core.Instance datum)
Whether the instance covered by this rule |
void |
findAndSetSupportBoundForDataspaceEdges(weka.core.Instances thisClassifiersExtension)
|
void |
findAndSetSupportBoundForKnownAntecedents(weka.core.Instances thisClassifiersExtension,
boolean allWeightsAreOne)
|
void |
fitAndSetCoreBound(weka.core.Instances instances)
This function fits the rule to the data which it overlaps. |
double |
getConsequent()
Gets the internal representation of the class label to be predicted |
java.lang.String |
getRevision()
Returns the revision string. |
void |
grow(weka.core.Instances data)
Build one rule using the growing data |
boolean |
hasAntds()
Whether this rule has antecedents, i.e. whether it is a default rule |
void |
prune(weka.core.Instances pruneData,
boolean useWhole)
Prune all the possible final sequences of the rule using the pruning data. |
void |
setConsequent(double cl)
Sets the internal representation of the class label to be predicted |
double |
size()
the number of antecedents of the rule |
java.lang.String |
toString(weka.core.Attribute classAttr)
Prints this rule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
private double m_Consequent
protected weka.core.FastVector m_Antds
private double m_confidence
Constructor Detail |
---|
public FRIP.RipperRule()
Method Detail |
---|
public void setConsequent(double cl)
cl
- the internal representation of the class label to be predictedpublic double getConsequent()
getConsequent
in class weka.classifiers.rules.Rule
public java.lang.Object copy()
copy
in interface weka.core.Copyable
copy
in class weka.classifiers.rules.Rule
public boolean covers(weka.core.Instance datum)
covers
in class weka.classifiers.rules.Rule
datum
- the instance in question
public double coverageDegree(weka.core.Instance datum)
datum
- the instance in question
public boolean hasAntds()
hasAntds
in class weka.classifiers.rules.Rule
public double size()
size
in class weka.classifiers.rules.Rule
private double computeDefAccu(weka.core.Instances data)
data
- the data in question
public void grow(weka.core.Instances data) throws java.lang.Exception
grow
in class weka.classifiers.rules.Rule
data
- the growing data used to build the rule
java.lang.Exception
- if the consequent is not set yetprivate weka.core.Instances computeInfoGain(weka.core.Instances instances, double defAcRt, FRIP.Antd antd)
instances
- the data based on which the infoGain is computeddefAcRt
- the default accuracy rate of dataantd
- the specific antecedentnumConds
- the number of antecedents in the rule so far
public void prune(weka.core.Instances pruneData, boolean useWhole)
pruneData
- the pruning data used to prune the ruleuseWhole
- flag to indicate whether use the error rate of
the whole pruning data instead of the data coveredpublic java.lang.String toString(weka.core.Attribute classAttr)
classAttr
- the class attribute in the data
private weka.core.Instances coveredData(weka.core.Instances instances)
instances
- All instances which shall be checked
public void fitAndSetCoreBound(weka.core.Instances instances)
instances
- The data to which the rule shall be fittedpublic void findAndSetSupportBoundForKnownAntecedents(weka.core.Instances thisClassifiersExtension, boolean allWeightsAreOne)
public void findAndSetSupportBoundForDataspaceEdges(weka.core.Instances thisClassifiersExtension) throws java.io.IOException
java.io.IOException
public java.lang.String getRevision()
weka.core.RevisionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |