public class Regla
extends java.lang.Object
Title: Regla (Rule).
Description: This class implements a rule object for this rule learning algorithm. This class stores the antecedents, consequents and the list of invalid attributes.
Company: KEEL
Constructor and Description |
---|
Regla(Regla r)
Copy Constructor.
|
Regla(java.lang.String c,
int numAtributos)
Parameter constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAntecedente(Atributo_valor av)
Adds the given antecent to the list of the rule.
|
void |
addValoresInv(java.lang.Integer i,
java.lang.Double vinv)
Adds an attribute with its value to the invalid values list.
|
boolean |
contenidoValoreInval(java.lang.Integer atributo,
java.lang.Double valor)
Checks if the given attribute and its value is invalid for this rule.
|
boolean |
equals(Regla rule)
Checks if the rule is equal to the given one.
|
java.util.LinkedList<Atributo_valor> |
getAntecedente()
Returns the list with the antecedents of the rule.
|
Atributo_valor |
getAV(int i)
Returns the pair attribute - values asked from the antecedents list.
|
java.lang.String |
getConsecuente()
Returns the consequent of the rule.
|
boolean |
getConsistencia()
Return the consistency of the rule.
|
Atributo_valor |
getLastAV()
Returns the last pair attribute - values from the antecedents list.
|
java.lang.Double |
getScore(Instances instances)
Computes the quality of the rule with the m-probability-estimation.
|
int |
getSizeAntecedentes()
Returns the size of the antecedents list.
|
java.util.LinkedList<java.util.LinkedList<java.lang.Double>> |
getValoresInvalidos()
Returns the list with the invalid values for the rule.
|
void |
mostrarRegla()
Prints on the standard output the rule information.
|
Regla |
parentRule()
Returns the father of this rule, its ancestor.
|
void |
removeValorInv(java.lang.Integer i,
java.lang.Double vinv)
Removes an attribute with its value to the invalid values list.
|
public Regla(java.lang.String c, int numAtributos)
c
- String rule consequentnumAtributos
- int number of attributes of the dataset.public Regla(Regla r)
r
- rule to be copied.public java.util.LinkedList<Atributo_valor> getAntecedente()
public java.util.LinkedList<java.util.LinkedList<java.lang.Double>> getValoresInvalidos()
public java.lang.String getConsecuente()
public int getSizeAntecedentes()
public boolean getConsistencia()
public boolean contenidoValoreInval(java.lang.Integer atributo, java.lang.Double valor)
atributo
- Integer given attribute.valor
- Double given value.public Atributo_valor getAV(int i)
i
- index of the antecedent asked.public Atributo_valor getLastAV()
public void addAntecedente(Atributo_valor av)
av
- Atributo_valor
antecedent to be added.public void addValoresInv(java.lang.Integer i, java.lang.Double vinv)
i
- Integer attribute to be added.vinv
- Double value of the attribute to be added.public void removeValorInv(java.lang.Integer i, java.lang.Double vinv)
i
- Integer attribute to be removed.vinv
- Double value of the attribute to be removed.public boolean equals(Regla rule)
rule
- Rule to compare with.public Regla parentRule()
Regla
the rule without the last antecedent added.public void mostrarRegla()
public java.lang.Double getScore(Instances instances)
instances
- training dataset.