public class Ruleset
extends java.lang.Object
Constructor and Description |
---|
Ruleset()
Constructs an empty ruleset.
|
Modifier and Type | Method and Description |
---|---|
void |
addRule(Rule r)
Adds a new rule to the ruleset.
|
keel.Algorithms.Rule_Learning.Ripper.Stats |
apply(MyDataset data)
It returns the number of true positives,true negatives,false positives and false negatives of the whole ruleset in a given dataset.
|
keel.Algorithms.Rule_Learning.Ripper.Stats |
apply(MyDataset data,
Mask positives,
Mask negatives)
It returns the number of true positives,true negatives,false positives and false negatives of the whole ruleset in a given dataset.
|
double |
getExceptionCost(MyDataset data)
Returns the exception cost for the Minimum Data Length of a dataset given a theory (this ruleset).
|
double |
getExceptionCost(MyDataset data,
Mask positives,
Mask negatives)
Returns the exception cost for the Minimum Data Length of a dataset given a theory (this ruleset).
|
double |
getExceptionCost(MyDataset data,
Mask positives,
Mask negatives,
keel.Algorithms.Rule_Learning.Ripper.IncrementalMask rulesetMask)
Returns the exception cost for the Minimum Data Length of a dataset given a theory (this ruleset).
|
double |
getMDL(MyDataset data)
Returns the Minimum Data Length of a dataset given a theory (this ruleset).
|
double |
getMDL(MyDataset data,
Mask positives,
Mask negatives)
Returns the Minimum Data Length of a dataset given a theory (this ruleset).
|
double |
getMDL(MyDataset data,
Mask positives,
Mask negatives,
keel.Algorithms.Rule_Learning.Ripper.IncrementalMask rulesetMask)
Returns the Minimum Data Length of a dataset given a theory (this ruleset).
|
Rule |
getRule(int pos)
Returns the rule in the i-th position of the ruleset.
|
keel.Algorithms.Rule_Learning.Ripper.IncrementalMask |
getRulesetMask(MyDataset data)
Returns the combine mask of all the rules in the set.
|
double |
getTheoryCost(MyDataset data)
The description length of the theory for the ruleset.
|
java.lang.String |
getType()
Returns the common output (consecuent) of the rules in the ruleset.
|
void |
insertRule(Rule r,
int pos)
Inserts a new rule in a given position of the ruleset.
|
void |
pulish(MyDataset data,
Mask positives,
Mask negatives)
Remove the rules that increase the DL value of the set.
|
void |
removeDuplicates()
Removes the duplicated rules
|
void |
removeRule(int pos)
Deletes a given rule of the ruleset.
|
void |
setType(java.lang.String type)
Sets the common output (consecuent) of the rules in the ruleset.
|
int |
size()
Returns the size (number of rules) of the ruleset.
|
java.lang.String |
toString()
Returns a string representation of this Ruleset, containing the String representation of each Rule.
|
public void addRule(Rule r)
r
- Rule the new rulepublic keel.Algorithms.Rule_Learning.Ripper.Stats apply(MyDataset data)
data
- MyDataset the datasetpublic keel.Algorithms.Rule_Learning.Ripper.Stats apply(MyDataset data, Mask positives, Mask negatives)
data
- MyDataset the datasetpositives
- active positive instances of datanegatives
- active negative instances of datapublic double getExceptionCost(MyDataset data, Mask positives, Mask negatives)
data
- MyDataset the datasetspositives
- Mask active positive entries of datanegatives
- Mask active negative entries of datapublic double getMDL(MyDataset data, Mask positives, Mask negatives)
data
- MyDataset the datasetspositives
- Mask active positive entries of datanegatives
- Mask active negative entries of datapublic double getExceptionCost(MyDataset data)
data
- MyDataset the datasetspublic double getMDL(MyDataset data)
data
- MyDataset the datasetspublic double getExceptionCost(MyDataset data, Mask positives, Mask negatives, keel.Algorithms.Rule_Learning.Ripper.IncrementalMask rulesetMask)
data
- MyDataset the datasetspositives
- Mask active positive entries of datanegatives
- Mask active negative entries of datarulesetMask
- the combine mask of all rules in the ruleset.public double getMDL(MyDataset data, Mask positives, Mask negatives, keel.Algorithms.Rule_Learning.Ripper.IncrementalMask rulesetMask)
data
- MyDataset the datasetspositives
- Mask active positive entries of datanegatives
- Mask active negative entries of datarulesetMask
- the combine mask of all rules in the ruleset.public double getTheoryCost(MyDataset data)
data
- MyDataset the datasetpublic Rule getRule(int pos)
pos
- int position of the rule in the rulesetpublic java.lang.String getType()
public keel.Algorithms.Rule_Learning.Ripper.IncrementalMask getRulesetMask(MyDataset data)
data
- the datasetpublic void insertRule(Rule r, int pos)
r
- Rule the new rulepos
- int the position where r must be insertedpublic void removeRule(int pos)
pos
- int position of the rule in the ruleset.public void setType(java.lang.String type)
type
- String the common output (consecuent) of the rules in the ruleset.public void removeDuplicates()
public void pulish(MyDataset data, Mask positives, Mask negatives)
data
- the datasetpositives
- the positives exemplesnegatives
- the negatives exemplespublic int size()
public java.lang.String toString()
toString
in class java.lang.Object