public class Rule
extends java.lang.Object
implements java.lang.Comparable
Title: Regla
Description: It defines a Rule for the SIA algorithm
Company: KEEL
Constructor and Description |
---|
Rule(int nAtributos)
Default builder
|
Rule(int nAtributos,
int clas,
double fuerza)
Rule Builder
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeNames(java.lang.String[] atributos)
It stores the names of the input attributes
|
void |
addClassName(java.lang.String className)
It stores the name for the class attribute
|
void |
addClassNames(java.lang.String[] classes)
It stores the names of the output attribute
|
void |
addValuesNames(java.lang.String[][] valores)
It stores the name for the different values in the data-set
|
int |
compareTo(java.lang.Object o)
It compares the rule with respect to their strength
|
Rule |
copyRule()
It performs a copy of the rule
|
int |
getClas()
It returns the consequent class of the rule
|
Condition |
getCondition(int i)
It returns a condition defined for the i-th attribute
|
double |
getStrength()
It gets the strength of the rule
|
boolean |
isEqual(Rule r)
It checks if the rule is equal to another
|
void |
print()
It prints the rule
|
java.lang.String |
printString()
It prints the rule into a string
|
void |
setClas(int clas)
It assigns a new class for the rule
|
void |
setCondition(Condition c)
It adds a new condition to the rule
|
void |
setMinValues(double[] valores)
It stores the minimum values for each attribute
|
void |
setStrength(double strength)
It assigns a new strength to the rule
|
public Rule(int nAtributos)
nAtributos
- Number of antecedents of the rulepublic Rule(int nAtributos, int clas, double fuerza)
nAtributos
- Number of antecedents of the ruleclas
- class in the consequent of the rulefuerza
- Significance of the rulepublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- Another rule objectpublic void print()
public java.lang.String printString()
public Rule copyRule()
public void setClas(int clas)
clas
- the new classpublic int getClas()
public void setCondition(Condition c)
c
- the conditionpublic void setStrength(double strength)
strength
- the new strengthpublic double getStrength()
public Condition getCondition(int i)
i
- attribute idpublic boolean isEqual(Rule r)
r
- Rule for comparisonpublic void addAttributeNames(java.lang.String[] atributos)
atributos
- String[] an Array that stores the name of each variablepublic void addClassName(java.lang.String className)
className
- String name of the class attributepublic void addClassNames(java.lang.String[] classes)
classes
- String[] an Array that stores the name of the classes of the problempublic void addValuesNames(java.lang.String[][] valores)
valores
- String[][] the name for the different values in the data-setpublic void setMinValues(double[] valores)
valores
- double[] the minimum values for each attribute