Package moa.classifiers.rules.core
Class Rule
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.classifiers.rules.core.Rule
-
- All Implemented Interfaces:
Serializable
,MOAObject
public class Rule extends AbstractMOAObject
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Rule.Builder
-
Field Summary
Fields Modifier and Type Field Description protected AbstractAMRules
amRules
protected RuleActiveLearningNode
learningNode
protected List<RuleSplitNode>
nodeList
protected int
ruleNumberID
-
Constructor Summary
Constructors Constructor Description Rule(Rule.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
computeError(Instance instance)
protected void
debug(String string, int level)
Rule.Builder
getBuilder()
double
getCurrentError()
void
getDescription(StringBuilder sb, int indent)
MOA GUI outputlong
getInstancesSeen()
RuleActiveLearningNode
getLearningNode()
getLearningNode Method This is the way to pass info for other classes.List<RuleSplitNode>
getNodeList()
double[]
getPrediction(Instance instance)
double[]
getPrediction(Instance instance, int mode)
int
getRuleNumberID()
boolean
isAnomaly(Instance instance, double uniVariateAnomalyProbabilityThreshold, double multiVariateAnomalyProbabilityThreshold, int numberOfInstanceesForAnomaly)
boolean
isCovering(Instance inst)
String
printRule()
void
setBuilder(Rule.Builder builder)
void
setLearningNode(RuleActiveLearningNode learningNode)
void
setNodeList(List<RuleSplitNode> nodeList)
void
setRuleNumberID(int ruleNumberID)
void
split()
double[]
statisticsOtherBranchSplit()
boolean
tryToExpand(double splitConfidence, double tieThreshold)
Try to Expand method.boolean
updatePageHinckleyTest(double error)
void
updateStatistics(Instance instance)
-
Methods inherited from class moa.AbstractMOAObject
copy, copy, measureByteSize, measureByteSize, toString
-
-
-
-
Field Detail
-
nodeList
protected List<RuleSplitNode> nodeList
-
learningNode
protected RuleActiveLearningNode learningNode
-
ruleNumberID
protected int ruleNumberID
-
amRules
protected AbstractAMRules amRules
-
-
Constructor Detail
-
Rule
public Rule(Rule.Builder builder)
-
-
Method Detail
-
getRuleNumberID
public int getRuleNumberID()
-
setRuleNumberID
public void setRuleNumberID(int ruleNumberID)
-
getLearningNode
public RuleActiveLearningNode getLearningNode()
getLearningNode Method This is the way to pass info for other classes. Implements getLearningNode() in class RuleActiveLearningNode- Returns:
-
setLearningNode
public void setLearningNode(RuleActiveLearningNode learningNode)
-
getNodeList
public List<RuleSplitNode> getNodeList()
-
getInstancesSeen
public long getInstancesSeen()
-
setNodeList
public void setNodeList(List<RuleSplitNode> nodeList)
-
isCovering
public boolean isCovering(Instance inst)
-
getDescription
public void getDescription(StringBuilder sb, int indent)
MOA GUI output- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
updateStatistics
public void updateStatistics(Instance instance)
-
tryToExpand
public boolean tryToExpand(double splitConfidence, double tieThreshold)
Try to Expand method.- Parameters:
splitConfidence
-tieThreshold
-- Returns:
-
split
public void split()
-
statisticsOtherBranchSplit
public double[] statisticsOtherBranchSplit()
-
printRule
public String printRule()
-
debug
protected void debug(String string, int level)
-
isAnomaly
public boolean isAnomaly(Instance instance, double uniVariateAnomalyProbabilityThreshold, double multiVariateAnomalyProbabilityThreshold, int numberOfInstanceesForAnomaly)
-
computeError
public double computeError(Instance instance)
-
updatePageHinckleyTest
public boolean updatePageHinckleyTest(double error)
-
getPrediction
public double[] getPrediction(Instance instance, int mode)
-
getPrediction
public double[] getPrediction(Instance instance)
-
getBuilder
public Rule.Builder getBuilder()
-
setBuilder
public void setBuilder(Rule.Builder builder)
-
getCurrentError
public double getCurrentError()
-
-