类 JRip.RipperRule
java.lang.Object
weka.classifiers.rules.Rule
weka.classifiers.rules.JRip.RipperRule
- 所有已实现的接口:
Serializable
,Copyable
,RevisionHandler
,WeightedInstancesHandler
- 封闭类:
- JRip
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.
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明copy()
Get a shallow copy of this ruleboolean
Whether the instance covered by this rulegetAntds()
Return the antecedentsdouble
Gets the internal representation of the class label to be predictedReturns the revision string.void
Build one rule using the growing databoolean
hasAntds()
Whether this rule has antecedents, i.e.void
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 predicteddouble
size()
the number of antecedents of the rulePrints this rule
-
构造器详细资料
-
RipperRule
public RipperRule()Constructor
-
-
方法详细资料
-
setConsequent
public void setConsequent(double cl) Sets the internal representation of the class label to be predicted- 参数:
cl
- the internal representation of the class label to be predicted
-
getConsequent
public double getConsequent()Gets the internal representation of the class label to be predicted- 指定者:
getConsequent
在类中Rule
- 返回:
- the internal representation of the class label to be predicted
-
copy
Get a shallow copy of this rule -
covers
Whether the instance covered by this rule -
hasAntds
public boolean hasAntds()Whether this rule has antecedents, i.e. whether it is a default rule -
getAntds
Return the antecedents- 返回:
- the vector of antecedents
-
size
public double size()the number of antecedents of the rule -
grow
Build one rule using the growing data -
prune
Prune all the possible final sequences of the rule using the pruning data. The measure used to prune the rule is based on flag given.- 参数:
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 covered
-
toString
Prints this rule- 参数:
classAttr
- the class attribute in the data- 返回:
- a textual description of this rule
-
getRevision
Returns the revision string.- 返回:
- the revision
-