|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.rules.Ridor.Ridor_node
Private class implementing the single node of Ridor. It consists of a default class label, a set of exceptions to the default rule and the exceptions to each exception
Field Summary | |
private double |
defClass
The default class label |
private Ridor.Ridor_node[] |
excepts
The exceptions of the exception rules |
private int |
level
The level of this node |
private Ridor.RidorRule[] |
rules
The set of exceptions of the default rule. |
Constructor Summary | |
private |
Ridor.Ridor_node()
|
Method Summary | |
private Instances |
append(Instances data1,
Instances data2)
Private function to combine two data |
private double |
buildRuleset(Instances insts,
double classCount,
java.util.Vector ruleset)
Private function to build a rule set and return the weighted avg of accuracy rate of rules in the set. |
private double |
computeWeightedAcRt(double worthRt,
double cover,
double total)
Compute the weighted average of accuracy rate of a certain rule Each rule is weighted by its coverage proportion in the whole data. |
private Instances[][] |
divide(Ridor.RidorRule rule,
Instances[] dataByClass)
Builds an array of data according to their true class label Each bag of data is filtered through the rule specified and is totally covered by this rule. |
void |
findRules(Instances[] dataByClass,
int lvl)
Builds a ripple-down manner rule learner. |
double |
getDefClass()
"Get" member functions |
Ridor.Ridor_node[] |
getExcepts()
|
Ridor.RidorRule[] |
getRules()
|
int |
size()
The size of the certain node of Ridor, i.e. the number of rules generated within and below this node |
java.lang.String |
toString()
Prints the all the rules of one node of Ridor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private double defClass
private Ridor.RidorRule[] rules
private Ridor.Ridor_node[] excepts
private int level
Constructor Detail |
private Ridor.Ridor_node()
Method Detail |
public double getDefClass()
public Ridor.RidorRule[] getRules()
public Ridor.Ridor_node[] getExcepts()
public void findRules(Instances[] dataByClass, int lvl) throws java.lang.Exception
dataByClass
- the divided data by their class label. The real class
labels of the instances are all set to 0lvl
- the level of the parent node
java.lang.Exception
- if ruleset of this node cannot be builtprivate double buildRuleset(Instances insts, double classCount, java.util.Vector ruleset) throws java.lang.Exception
insts
- the data used to build rulesetclassCount
- the counts of the instances with the predicted class but not
yet covered by the rulesetruleset
- the ruleset to be built
if
- the rules cannot be built properly
java.lang.Exception
private Instances append(Instances data1, Instances data2)
data1
- the data to which data2 is appendeddata2
- the data to be appended to data1
private double computeWeightedAcRt(double worthRt, double cover, double total)
worthRt
- the worth ratecover
- the coverage of the rule on the whole datatotal
- the total data size fed into the ruleset
private Instances[][] divide(Ridor.RidorRule rule, Instances[] dataByClass)
rule
- the rule covering the datadataByClass
- the array of data to be covered by the rule
public int size()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |