public class Regla
extends java.lang.Object
Title: Regla (Rule).
Description: This class implements a rule of the classifier.
Constructor and Description |
---|
Regla()
Default Constructor.
|
Regla(myDataset train,
java.lang.String linea)
Paramenter constructor.
|
Regla(java.lang.String clase,
myDataset train)
Paramenter constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contieneAtributo(int att)
Checks if the rule contains the given attribute in its antecedents.
|
Regla |
copia()
Returns a copy of the rule.
|
int |
cubiertos()
Returns the number of covered examples.
|
int |
cubiertosOK()
Returns the number of correctly covered examples.
|
boolean |
cubre(double[] ejemplo)
Checks if an example given is covered by the rule.
|
void |
cubrirEjemplos()
Computes the examples covered by the rule.
|
void |
incluyeSelector(Selector s)
Adds a Selector (antedent of the rule, attribute-condition).
|
java.lang.String |
printString()
Returns a String representation of the rule.
|
int |
size()
Returns the size of the rule (number of antecedents).
|
public Regla()
public Regla(java.lang.String clase, myDataset train)
clase
- Consequent class of the rule.train
- Training dataset.public Regla(myDataset train, java.lang.String linea)
linea
- String representation of the rule. This will be parsed into rule object.train
- Training dataset.public void incluyeSelector(Selector s)
s
- Selector to be added.public java.lang.String printString()
public Regla copia()
public int cubiertos()
public int cubiertosOK()
public void cubrirEjemplos()
public boolean cubre(double[] ejemplo)
ejemplo
- given example.public int size()
public boolean contieneAtributo(int att)
att
- given attribute.