Class RuleSetBase
java.lang.Object
adaa.analytics.rules.logic.representation.ruleset.PredictionModel
adaa.analytics.rules.logic.representation.ruleset.RuleSetBase
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClassificationRuleSet
,RegressionRuleSet
,SurvivalRuleSet
Abstract class representing all rule-based models (classification/regression/survival).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Auxiliary class storing result of rule set significance test. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Collection of attributesprotected double
Time of growing.protected boolean
Value indicating whether rules are voting.protected Knowledge
User's knowledge.protected InductionParameters
Induction paramters.protected double
Time of pruning.Collection of rules.protected double
Time of constructing the rule set. -
Constructor Summary
ConstructorsConstructorDescriptionRuleSetBase
(IExampleSet exampleSet, boolean isVoting, InductionParameters params, Knowledge knowledge) Initializes members. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds rule to the collection.double
Calculates average rule coverage.double
Calculates average rule precision.double
Calculates average rule quality.double
Calculates number of conditions.double
Calculates number of induced conditions.calculateSignificance
(double alpha) Evaluates significance of the rule set.calculateSignificanceFDR
(double alpha) Evaluates significance of the rule set with false discovery rate correction.calculateSignificanceFWER
(double alpha) Evaluates significance of the rule set with familiy-wise error rate correction.double
GetsgrowingTime
boolean
GetsisVoting
Getsparams
double
GetspruningTime
getRules()
Getsrules
double
GetstotalTime
performPrediction
(IExampleSet exampleSet, IAttribute predictedLabel) Iterates over all examples and applies the model to them.abstract double
Applies the model to a single example and returns the predicted class value.void
setGrowingTime
(double v) SetsgrowingTime
void
setIsVoting
(boolean v) SetsisVoting
void
setPruningTime
(double v) SetspruningTime
void
setTotalTime
(double v) SetstotalTime
toString()
Generates text representation of the rule set which contains:toTable()
Methods inherited from class adaa.analytics.rules.logic.representation.ruleset.PredictionModel
apply, checkCompatibility, createPredictionAttributes, getLabel, getTrainingHeader, supportsConfidences
-
Field Details
-
ANNOTATION_TEST_REPORT
- See Also:
-
attributes
Collection of attributes -
rules
Collection of rules. -
isVoting
protected boolean isVotingValue indicating whether rules are voting. -
params
Induction paramters. -
knowledge
User's knowledge. -
totalTime
protected double totalTimeTime of constructing the rule set. -
growingTime
protected double growingTimeTime of growing. -
pruningTime
protected double pruningTimeTime of pruning.
-
-
Constructor Details
-
RuleSetBase
public RuleSetBase(IExampleSet exampleSet, boolean isVoting, InductionParameters params, Knowledge knowledge) Initializes members.- Parameters:
exampleSet
- Training set.isVoting
- Voting flag.params
- Induction parameters.knowledge
- User's knowledge.
-
-
Method Details
-
getTotalTime
public double getTotalTime()GetstotalTime
-
setTotalTime
public void setTotalTime(double v) SetstotalTime
-
getGrowingTime
public double getGrowingTime()GetsgrowingTime
-
setGrowingTime
public void setGrowingTime(double v) SetsgrowingTime
-
getPruningTime
public double getPruningTime()GetspruningTime
-
setPruningTime
public void setPruningTime(double v) SetspruningTime
-
getIsVoting
public boolean getIsVoting()GetsisVoting
-
setIsVoting
public void setIsVoting(boolean v) SetsisVoting
-
getParams
Getsparams
-
getRules
Getsrules
-
addRule
Adds rule to the collection.- Parameters:
v
- Rule to be added.
-
predict
Applies the model to a single example and returns the predicted class value.- Throws:
OperatorException
-
performPrediction
public IExampleSet performPrediction(IExampleSet exampleSet, IAttribute predictedLabel) throws OperatorException Iterates over all examples and applies the model to them.- Specified by:
performPrediction
in classPredictionModel
- Throws:
OperatorException
-
calculateConditionsCount
public double calculateConditionsCount()Calculates number of conditions.- Returns:
- Number of conditions.
-
calculateInducedCondtionsCount
public double calculateInducedCondtionsCount()Calculates number of induced conditions.- Returns:
- Number of induced conditions.
-
calculateAvgRuleCoverage
public double calculateAvgRuleCoverage()Calculates average rule coverage.- Returns:
- Average rule coverage.
-
calculateAvgRulePrecision
public double calculateAvgRulePrecision()Calculates average rule precision.- Returns:
- Average rule precision.
-
calculateAvgRuleQuality
public double calculateAvgRuleQuality()Calculates average rule quality.- Returns:
- Average rule quality.
-
calculateSignificance
Evaluates significance of the rule set.- Parameters:
alpha
- Significance level.- Returns:
- Average rules p-value and fraction of rules significant at assumed level.
-
calculateSignificanceFDR
Evaluates significance of the rule set with false discovery rate correction.- Parameters:
alpha
- Significance level.- Returns:
- Average rules p-value and fraction of rules significant at assumed level.
-
calculateSignificanceFWER
Evaluates significance of the rule set with familiy-wise error rate correction.- Parameters:
alpha
- Significance level.- Returns:
- Average rules p-value and fraction of rules significant at assumed level.
-
toString
Generates text representation of the rule set which contains:- induction parameters,
- user's knowledge (if defined),
- list of rules,
- information about coverage of the training set examples.
-
toTable
-