public class Rule
extends java.lang.Object
Title: Rule
Description: Rule representation
Company: KEEL
Constructor and Description |
---|
Rule()
Default constructor
|
Rule(myDataset train,
java.lang.String linea)
Constructor with parameters.
|
Rule(java.lang.String clase,
myDataset train)
Constructor with parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
confidence()
Returns the confidence of the rule.
|
boolean |
contieneAtributo(int att)
Checks if an attribute given as a argument is considered in the rule.
|
Rule |
copy()
Creates a copy of a rule
|
int |
covered()
Returns the instances covered by the rule.
|
void |
coverExamples()
It counts how many examples are covered and also how many of them are positive
|
void |
coverExamples(double[] weights)
It checks the weights of the covered examples
|
boolean |
covers(double[] example)
To compute whether the rule covers an example
|
void |
incluyeSelector(Selector s)
Includes a selector given as an argument into the list of antecedents.
|
int |
positiveCovered()
Returns the instances covered by the rule and are correctly classified.
|
java.lang.String |
printString()
Returns the rule as a String
|
java.lang.String |
printStringF()
Returns the rule as a String (float representation of covers instances).
|
int |
size()
Returns the number of selectors in the rule.
|
public Rule()
public Rule(java.lang.String clase, myDataset train)
clase
- class valuetrain
- training setpublic Rule(myDataset train, java.lang.String linea)
train
- training setlinea
- Line of the file which stores the C4.5 rule setpublic void incluyeSelector(Selector s)
s
- Selector given.public java.lang.String printString()
public java.lang.String printStringF()
public Rule copy()
public int covered()
public int positiveCovered()
public void coverExamples()
public void coverExamples(double[] weights)
weights
- the weights of all examplespublic boolean covers(double[] example)
example
- public int size()
public double confidence()
public boolean contieneAtributo(int att)
att
- attribute given to check.