public class RuleBase
extends java.lang.Object
Constructor and Description |
---|
RuleBase()
Default Constructor
|
RuleBase(DataBase dataBase,
myDataset train)
Parameters Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(Itemset itemset,
long time)
It adds a rule to the rule base
|
void |
add(Rule rule)
It adds a rule to the rule base
|
boolean |
BETTER(int a,
int b)
Maximization
|
RuleBase |
classifier()
This function generates a classifier from the CompSet of the generated fuzzy rules
|
RuleBase |
clone()
Clone Function
|
void |
evalua()
Function to evaluate the whole rule base by using the training dataset
|
int |
FRM(double[] example)
It returns the class which better fits to the given example
|
Rule |
get(int pos)
Function to get a rule from the rule base
|
double |
getAccuracy()
Function to return the fitness of the rule base
|
java.lang.String |
printString()
It prints the whole rulebase
|
Rule |
remove(int pos)
It removes the rule stored in the given position
|
void |
removeRules()
Removes the rules stored.
|
void |
saveFile(java.lang.String filename)
It stores the rule base in a given file
|
void |
selection()
Function to eliminate the redundant rules
|
int |
size()
It returns the number of rules in the rule base
|
void |
sort()
Function to sort the rule base
|
public boolean BETTER(int a, int b)
a
- first numberb
- second numberpublic RuleBase clone()
Clone Function
clone
in class java.lang.Object
public void add(Rule rule)
It adds a rule to the rule base
rule
- Rule to be addedpublic void add(Itemset itemset, long time)
It adds a rule to the rule base
itemset
- itemset to be addedtime
- Time of the rulepublic Rule get(int pos)
Function to get a rule from the rule base
pos
- Position in the rule base where the desired rule is storedpublic int size()
It returns the number of rules in the rule base
public void sort()
Function to sort the rule base
public Rule remove(int pos)
It removes the rule stored in the given position
pos
- Position where the rule we want to remove ispublic void removeRules()
public void evalua()
Function to evaluate the whole rule base by using the training dataset
public int FRM(double[] example)
It returns the class which better fits to the given example
example
- Example to be classifiedpublic double getAccuracy()
Function to return the fitness of the rule base
public void selection()
Function to eliminate the redundant rules
public RuleBase classifier()
This function generates a classifier from the CompSet of the generated fuzzy rules
public java.lang.String printString()
It prints the whole rulebase
public void saveFile(java.lang.String filename)
It stores the rule base in a given file
filename
- Name for the rulebase file