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 |
adaptiveRules(double n1,
double n2,
int Jmax)
Function to adjust fuzzy confidences (Nozaki method)
|
void |
add(Itemset itemset)
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 |
clone()
Clone Function
|
double |
evaluate()
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
|
void |
reduceRules()
Function to eliminate the redundant rules
|
Rule |
remove(int pos)
It removes the rule stored in the given position
|
void |
saveFile(java.lang.String filename,
double minFS,
double minFC)
It stores the rule base in a given file
|
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
- int first numberb
- int 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 Rule to be addedpublic void add(Itemset itemset)
It adds a rule to the rule base
itemset
- Itemset itemset to be addedpublic Rule get(int pos)
Function to get a rule from the rule base
pos
- int 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
- int Position where the rule we want to remove ispublic double evaluate()
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
- int[] Example to be classifiedpublic double getAccuracy()
Function to return the fitness of the rule base
public void reduceRules()
Function to eliminate the redundant rules
public void adaptiveRules(double n1, double n2, int Jmax)
Function to adjust fuzzy confidences (Nozaki method)
n1
- double learning raten2
- double learning rateJmax
- int number of iterationspublic java.lang.String printString()
It prints the whole rulebase
public void saveFile(java.lang.String filename, double minFS, double minFC)
It stores the rule base in a given file
filename
- String Name for the rulebase fileminFS
- Minimum SupportminFC
- Minimum Confidence