public class PRM
extends java.lang.Object
Constructor and Description |
---|
PRM()
Default Constructor
|
PRM(DataBase dataBase,
myDataset train,
RuleBase ruleBase,
double alfa,
double delta,
double min_gain)
Parameters Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calculateAc(Rule r)
It computes the PNArray A' from a rule r
|
void |
calculatePNc(Rule r)
It computes positive and negative values for each example in the training set
by means a given rule
|
void |
changePNAc(Literal lit)
It modifies positive and negative values and the PNArray of each example from a given literal
|
void |
copyA()
Function to copy a PNArray to an auxiliar PNArray
|
void |
copyPN()
Function to copy P and N values to an auxiliar structure
|
void |
generatePR()
Main function of the method: it prunes the rulebase to obtain the final set of rules.
|
double |
getTotalWeight()
It returns the total weight of the positive classification
|
void |
iniPN(int clas)
It initializes positive and negative values for each example for a given class
|
public PRM()
Default Constructor
public PRM(DataBase dataBase, myDataset train, RuleBase ruleBase, double alfa, double delta, double min_gain)
Parameters Constructor
dataBase
- DataBase Set of training data which is necessary to compute PRMtrain
- myDataset Training data set with information to compute PRM (mainly, the training examples)ruleBase
- RuleBase Set of rules to be prunedalfa
- double Weight decay factordelta
- double Number of best rules we will take in account for each examplemin_gain
- double Minimum gain threshold to be usedpublic void generatePR()
Main function of the method: it prunes the rulebase to obtain the final set of rules.
public void iniPN(int clas)
It initializes positive and negative values for each example for a given class
clas
- int Class to initialize positive and negative values of each examplepublic void copyPN()
Function to copy P and N values to an auxiliar structure
public void copyA()
Function to copy a PNArray to an auxiliar PNArray
public void calculatePNc(Rule r)
It computes positive and negative values for each example in the training set by means a given rule
r
- Rule Rule used to compute P and Npublic void calculateAc(Rule r)
It computes the PNArray A' from a rule r
r
- Rule Rule used to compute the PNArraypublic void changePNAc(Literal lit)
It modifies positive and negative values and the PNArray of each example from a given literal
lit
- Literal Given literal to modify P, N and Acpublic double getTotalWeight()
It returns the total weight of the positive classification