public class RipperRule extends Rule
Modifier and Type | Field and Description |
---|---|
FastVector |
m_Antds
The vector of antecedents of this rule
|
double |
m_Consequent
The internal representation of the class label to be predicted
|
protected boolean |
m_Debug
Whether in a debug mode
|
Constructor and Description |
---|
RipperRule()
Constructor
|
RipperRule(double[] aprioriClassDistribution)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calculateConfidences(Instances data)
Computes the confidences of the given data.
|
java.lang.Object |
copy()
Get a shallow copy of this rule
|
double |
coverageDegree(Instance datum)
The degree of coverage instance covered by this rule
|
boolean |
covers(Instance datum)
Whether the instance covered by this rule
|
void |
findAndSetSupportBoundForKnownAntecedents(Instances thisClassifiersExtension,
boolean allWeightsAreOne)
Finds and sets the support bound for the known antecedents.
|
void |
fitAndSetCoreBound(Instances instances)
This function fits the rule to the data which it overlaps.
|
double |
getConfidence()
Returns the confidence of the last element of the antecetents.
|
double |
getConsequent()
Gets the internal representation of the class label to be predicted
|
java.lang.String |
getRevision()
String "1.0"
|
void |
grow(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(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(AttributeWeka classAttr)
Prints this rule
|
public double m_Consequent
public FastVector m_Antds
protected boolean m_Debug
public RipperRule()
public RipperRule(double[] aprioriClassDistribution)
aprioriClassDistribution
- apriori class distribution to be set.public void setConsequent(double cl)
cl
- the internal representation of the class label to be predictedpublic double getConsequent()
getConsequent
in class Rule
public java.lang.Object copy()
public double coverageDegree(Instance datum)
datum
- the instance in questionpublic boolean covers(Instance datum)
public boolean hasAntds()
public double size()
public void grow(Instances data) throws java.lang.Exception
public void prune(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(AttributeWeka classAttr)
classAttr
- the class attribute in the datapublic void fitAndSetCoreBound(Instances instances)
instances
- The data to which the rule shall be fittedpublic void findAndSetSupportBoundForKnownAntecedents(Instances thisClassifiersExtension, boolean allWeightsAreOne)
thisClassifiersExtension
- instances to extend the classifier.allWeightsAreOne
- true if all weights are one.public void calculateConfidences(Instances data) throws java.lang.Exception
data
- given data.java.lang.Exception
- if the data is not correct.public double getConfidence()
public java.lang.String getRevision()