public class Rule
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
Rule(DataBase dataBase)
Parameters Constructor
|
Rule(Rule r)
Copy Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
asignaAntecedente(int[] antecedente)
It sets the antecedent of the rule
|
Rule |
clone()
Clone Function
|
int |
compareTo(java.lang.Object a)
Function to compare objects of the Rule class.
|
int |
getClas()
It returns the output class of the rule
|
double |
getConfidence()
It returns the Confidence of the rule
|
double |
getDF()
It returns the DF of the rule
|
int |
getRightN()
It returns the number of right of the rule
|
double |
getSupport()
It returns the support of the rule
|
long |
getTime()
It returns the time of the rule
|
int |
getWrongN()
It returns the number of wrong of the rule
|
void |
incrRightN()
It increases the number of right
|
void |
incrWrongN()
It increases the number of wrong
|
boolean |
isSubset(Rule a)
Function to check if a given rule is a subrule of this rule
|
double |
matching(double[] ejemplo)
Function to check if a given example matchs with the rule (the rule correctly classifies it)
|
void |
orderDF()
It selects to order by DF
|
void |
orderPrecede()
It selects to order by precede
|
void |
setConfidence(double Dconf)
It sets the confidence of the rule
|
void |
setConsequent(int clas)
It sets the consequent of the rule
|
void |
setIni()
It sets to 0 the number of right and wrong of the rule
|
void |
setLabel(int pos,
int label)
It sets the label for a given position in the antecedent (for a given attribute)
|
void |
setSupport(double Dsupp)
It sets the support of the rule
|
void |
setTime(long time)
It sets the time of the rule
|
public Rule(Rule r)
Copy Constructor
r
- Rule Rule to be copiedpublic Rule(DataBase dataBase)
Parameters Constructor
dataBase
- Set of training data which is necessary to generate a rulepublic Rule clone()
Clone Function
clone
in class java.lang.Object
public void asignaAntecedente(int[] antecedente)
It sets the antecedent of the rule
antecedente
- Antecedent of the rulepublic void setConsequent(int clas)
It sets the consequent of the rule
clas
- Class of the rulepublic double matching(double[] ejemplo)
Function to check if a given example matchs with the rule (the rule correctly classifies it)
ejemplo
- Example to be classifiedpublic void setConfidence(double Dconf)
It sets the confidence of the rule
Dconf
- Confidence to be setpublic void setSupport(double Dsupp)
It sets the support of the rule
Dsupp
- Support to be setpublic void setTime(long time)
It sets the time of the rule
time
- Time to be setpublic void setIni()
It sets to 0 the number of right and wrong of the rule
public void incrRightN()
It increases the number of right
public void incrWrongN()
It increases the number of wrong
public void orderPrecede()
It selects to order by precede
public void orderDF()
It selects to order by DF
public double getConfidence()
It returns the Confidence of the rule
public double getSupport()
It returns the support of the rule
public long getTime()
It returns the time of the rule
public int getRightN()
It returns the number of right of the rule
public int getWrongN()
It returns the number of wrong of the rule
public double getDF()
It returns the DF of the rule
public int getClas()
It returns the output class of the rule
public boolean isSubset(Rule a)
Function to check if a given rule is a subrule of this rule
a
- Rule to be examinatedpublic void setLabel(int pos, int label)
pos
- Location of the attribute which we want to set the labellabel
- New label value to setpublic int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
a
- Rule object to compare with.