public class RuleBase
extends java.lang.Object
This class contains the representation of a Rule Set
Constructor and Description |
---|
RuleBase()
Default constructor
|
RuleBase(DataBase dataBase,
myDataset train,
int typeEvaluation)
Builds an object for the Rule Base
|
Modifier and Type | Method and Description |
---|---|
void |
add(Rule rule)
It adds a new rule to the rule set
|
boolean |
BETTER(int a,
int b)
Maximization
|
double |
classify()
It performs the classification process with the current rule set
|
RuleBase |
clone()
Clone Function
|
RuleBase |
cloneEmpty()
It performs a copy of the current RB
|
void |
evaluate()
It evaluates the rule set
|
int |
FRM(double[] example)
Fuzzy Reasoning Method
|
Rule |
get(int pos)
It returns a given rule from the RB
|
double |
getAccuracy()
It returns the accuracy rate for the rule set
|
void |
initialization()
It generates the initial rule set for each partition of the input space (2...L)
|
java.lang.String |
printString()
It prints the rule base into an string
|
Rule |
remove(int pos)
It removes a given rule from the RB
|
void |
removeRules(int nRules)
It removes a prespecified number of rules from the rule set
|
void |
saveFile(java.lang.String filename)
It writes the rule set into a file
|
void |
selection(RuleBase ruleBase,
int nRules)
It adds the best rules to a new rule base
|
int |
size()
It returns the size of the Rule Base
|
void |
sort()
It sorts the rule base according to the fitness of the rules
|
public boolean BETTER(int a, int b)
a
- int first numberb
- int second numberpublic void initialization()
public int size()
public void add(Rule rule)
rule
- Rule the new rulepublic Rule get(int pos)
pos
- int the rule idpublic Rule remove(int pos)
pos
- int the rule idpublic void sort()
public RuleBase clone()
Clone Function
clone
in class java.lang.Object
public RuleBase cloneEmpty()
public void removeRules(int nRules)
nRules
- int the number of rules to removepublic double classify()
public void evaluate()
public int FRM(double[] example)
example
- double[] the input examplepublic double getAccuracy()
public void selection(RuleBase ruleBase, int nRules)
ruleBase
- RuleBase a given rule base to insert rulesnRules
- int the number of rules to insertpublic java.lang.String printString()
public void saveFile(java.lang.String filename)
filename
- String the name of the file