public class Rule
extends java.lang.Object
implements java.lang.Comparable
Title: Rule
Description: Codifies a Fuzzy Rule
Copyright: KEEL Copyright (c) 2008
Company: KEEL
| Constructor and Description |
|---|
Rule(DataBase dataBase,
int compatibilityType,
boolean[] nominals)
Constructor with parameters
|
Rule(Rule r)
Copy Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
assignConsequent(myDataset train,
int ruleWeight)
It assigns the rule Weigth
|
void |
buildHeuristic(myDataset train,
int example,
double p_DC)
Builds a new rule from a heuristic function
|
Rule |
clone()
It carries out a copy of the current rule
|
int |
compareTo(java.lang.Object a)
Compares the fitness of two rules for the ordering procedure
|
double |
compatibility(double[] example)
Computes the compatibility of a given example with the rule.
|
void |
computeConsequent(myDataset train)
Procedure to compute the best consequent for a given rule
|
void |
mutate(myDataset train,
double prob_mut)
Mutatation Operator.
|
void |
setClass(int clas)
Sets the class for the rule
|
public Rule(Rule r)
r - Rule the rule to be copiedpublic Rule(DataBase dataBase, int compatibilityType, boolean[] nominals)
dataBase - DataBase the DBcompatibilityType - int a code for the compatibility degre computationnominals - array that indicates the possible nominal attributes of the data-setpublic void buildHeuristic(myDataset train, int example, double p_DC)
train - myDataset the tranning setexample - int an example for building the rulep_DC - double the don't care probabilitypublic void computeConsequent(myDataset train)
train - myDataset the tranning setpublic void setClass(int clas)
clas - int the class idpublic void assignConsequent(myDataset train, int ruleWeight)
train - myDataset trainnig setruleWeight - int code for selecting the rule weight heuristic computationpublic double compatibility(double[] example)
example - example to be tested.public Rule clone()
clone in class java.lang.Objectpublic void mutate(myDataset train, double prob_mut)
train - myDataset trainnig setprob_mut - double mutation probabilitypublic int compareTo(java.lang.Object a)
compareTo in interface java.lang.Comparablea - Object a Rule