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 TypeClassDescriptionclassAuxiliary class storing result of rule set significance test. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCollection of attributesprotected doubleTime of growing.protected booleanValue indicating whether rules are voting.protected KnowledgeUser's knowledge.protected InductionParametersInduction paramters.protected doubleTime of pruning.Collection of rules.protected doubleTime of constructing the rule set. -
Constructor Summary
ConstructorsConstructorDescriptionRuleSetBase(IExampleSet exampleSet, boolean isVoting, InductionParameters params, Knowledge knowledge) Initializes members. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds rule to the collection.doubleCalculates average rule coverage.doubleCalculates average rule precision.doubleCalculates average rule quality.doubleCalculates number of conditions.doubleCalculates 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.doubleGetsgrowingTimebooleanGetsisVotingGetsparamsdoubleGetspruningTimegetRules()GetsrulesdoubleGetstotalTimeperformPrediction(IExampleSet exampleSet, IAttribute predictedLabel) Iterates over all examples and applies the model to them.abstract doubleApplies the model to a single example and returns the predicted class value.voidsetGrowingTime(double v) SetsgrowingTimevoidsetIsVoting(boolean v) SetsisVotingvoidsetPruningTime(double v) SetspruningTimevoidsetTotalTime(double v) SetstotalTimetoString()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:
performPredictionin 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
-