public class RuleBase
extends java.lang.Object
implements java.lang.Comparable
Title: RuleBase
Description: Fuzzy Rule Base
Copyright: KEEL Copyright (c) 2008
Company: KEEL
Constructor and Description |
---|
RuleBase()
Default builder
|
RuleBase(DataBase dataBase,
myDataset train,
int ruleWeight,
int infType,
int compType,
double crossProb,
double p_DC)
Builds an object for the Rule Base
|
RuleBase(int[] examples,
int n_Rules,
DataBase dataBase,
myDataset train,
int ruleWeight,
int infType,
int compType,
double crossProb,
double p_DC)
Builds an object for the Rule Base with an heuristic
|
Modifier and Type | Method and Description |
---|---|
boolean |
BETTER(int a,
int b)
Maximization
|
RuleBase |
clone()
It performs a copy of the current RB
|
int |
compareTo(java.lang.Object a)
Compares the fitness of two RB for the ordering procedure
|
void |
delete()
It deletes from the RB those rules with a negative weight
|
void |
evaluate()
Evaluation funtion
It counts the number of examples correctly classified
|
int |
FRM(double[] example)
Fuzzy Reasoning Method
|
double |
getAccuracy()
It returns the accuracy rate of the Rule Base
|
void |
michigan()
Genetic Cooperative-Competetive procedure
|
void |
mutate()
Mutation operator
|
java.lang.String |
printString()
Prints the Rule Base into a String object
|
void |
writeFile(java.lang.String filename)
It writes the rule base into an ouput file
|
public RuleBase()
public RuleBase(DataBase dataBase, myDataset train, int ruleWeight, int infType, int compType, double crossProb, double p_DC)
dataBase
- DataBase Data Basetrain
- myDataset Training setruleWeight
- int Code for the rule weightinfType
- int Code for the inference systemcompType
- int Code for the compatibility degree computationcrossProb
- double Crossover probabilityp_DC
- double Don't Care probabilitypublic RuleBase(int[] examples, int n_Rules, DataBase dataBase, myDataset train, int ruleWeight, int infType, int compType, double crossProb, double p_DC)
examples
- int[] Position of the training instances for the heuristicn_Rules
- int Number of rules in the Rule BasedataBase
- DataBase Data Basetrain
- myDataset Training setruleWeight
- int Code for the rule weightinfType
- int Code for the inference systemcompType
- int Code for the compatibility degree computationcrossProb
- double Crossover probabilityp_DC
- double Don't Care probabilitypublic boolean BETTER(int a, int b)
a
- int first numberb
- int second numberpublic java.lang.String printString()
public void writeFile(java.lang.String filename)
filename
- String the name of the output filepublic int FRM(double[] example)
example
- double[] the input examplepublic void evaluate()
public void delete()
public double getAccuracy()
public RuleBase clone()
clone
in class java.lang.Object
public void mutate()
public int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
a
- Object an RBpublic void michigan()