Package moa.classifiers.rules.core
Class RuleActiveRegressionNode
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.classifiers.trees.HoeffdingTree.Node
-
- moa.classifiers.trees.HoeffdingTree.LearningNode
-
- moa.classifiers.trees.HoeffdingTree.ActiveLearningNode
-
- moa.classifiers.rules.core.RuleActiveLearningNode
-
- moa.classifiers.rules.core.RuleActiveRegressionNode
-
- All Implemented Interfaces:
Serializable
,MOAObject
public class RuleActiveRegressionNode extends RuleActiveLearningNode
A modified ActiveLearningNode that uses a Perceptron as the leaf node model, and ensures that the class values sent to the attribute observers are not truncated to ints if regression is being performed- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Perceptron
perceptron
protected TargetMean
targetMean
-
Fields inherited from class moa.classifiers.rules.core.RuleActiveLearningNode
amRules, attributesMask, bestSuggestion, changeDetection, nodeStatistics, numAttributesSelected, owner, pageHinckleyTest, predictionFunction, splitIndex, statisticsBranchSplit, statisticsNewRuleActiveLearningNode, statisticsOtherBranchSplit
-
Fields inherited from class moa.classifiers.trees.HoeffdingTree.ActiveLearningNode
attributeObservers, isInitialized, weightSeenAtLastSplitEvaluation
-
Fields inherited from class moa.classifiers.trees.HoeffdingTree.Node
observedClassDistribution
-
-
Constructor Summary
Constructors Constructor Description RuleActiveRegressionNode()
RuleActiveRegressionNode(double[] initialClassObservations)
RuleActiveRegressionNode(Rule.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
computeError(Instance instance)
double
computeSD(double squaredVal, double val, double size)
double
computeSD(double squaredVal, double val, long size)
protected void
debuganomaly(Instance instance, double uni, double multi, double probability)
AttributeSplitSuggestion[]
getBestSplitSuggestions(SplitCriterion criterion)
double
getCurrentError()
int
getLearnerToUse(Instance instance, int predMode)
double
getNormalizedPrediction(Instance instance)
Perceptron
getPerceptron()
double[]
getPrediction(Instance instance, int predictionMode)
double[]
getSimplePrediction()
TargetMean
getTargetMean()
double
getWeightSeen()
void
initialize(RuleActiveLearningNode oldLearningNode)
boolean
isAnomaly(Instance instance, double uniVariateAnomalyProbabilityThreshold, double multiVariateAnomalyProbabilityThreshold, int numberOfInstanceesForAnomaly)
void
learnFromInstance(Instance inst)
void
setPerceptron(Perceptron perceptron)
void
setTargetMean(TargetMean targetMean)
boolean
tryToExpand(double splitConfidence, double tieThreshold)
void
updateStatistics(Instance instance)
-
Methods inherited from class moa.classifiers.rules.core.RuleActiveLearningNode
computeHoeffdingBound, computeProbability, debug, getAttributeObservers, getBestSuggestion, getInstancesSeen, getNodeStatistics, getPrediction, getSplitIndex, getStatisticsBranchSplit, getStatisticsNewRuleActiveLearningNode, getStatisticsOtherBranchSplit, learnFromInstance, newNumericClassObserver, setBestSuggestion, setSplitIndex, setStatisticsBranchSplit, setStatisticsNewRuleActiveLearningNode, setStatisticsOtherBranchSplit, updateChangeDetection, updatePageHinckleyTest
-
Methods inherited from class moa.classifiers.trees.HoeffdingTree.ActiveLearningNode
calcByteSize, disableAttribute, getBestSplitSuggestions, getWeightSeenAtLastSplitEvaluation, setWeightSeenAtLastSplitEvaluation
-
Methods inherited from class moa.classifiers.trees.HoeffdingTree.Node
calcByteSizeIncludingSubtree, calculatePromise, describeSubtree, filterInstanceToLeaf, getClassVotes, getDescription, getObservedClassDistribution, getObservedClassDistributionAtLeavesReachableThroughThisNode, isLeaf, observedClassDistributionIsPure, subtreeDepth
-
Methods inherited from class moa.AbstractMOAObject
copy, copy, measureByteSize, measureByteSize, toString
-
-
-
-
Field Detail
-
perceptron
protected Perceptron perceptron
-
targetMean
protected TargetMean targetMean
-
-
Constructor Detail
-
RuleActiveRegressionNode
public RuleActiveRegressionNode(double[] initialClassObservations)
-
RuleActiveRegressionNode
public RuleActiveRegressionNode()
-
RuleActiveRegressionNode
public RuleActiveRegressionNode(Rule.Builder builder)
-
-
Method Detail
-
getPerceptron
public Perceptron getPerceptron()
-
setPerceptron
public void setPerceptron(Perceptron perceptron)
-
getTargetMean
public TargetMean getTargetMean()
-
setTargetMean
public void setTargetMean(TargetMean targetMean)
-
updateStatistics
public void updateStatistics(Instance instance)
- Overrides:
updateStatistics
in classRuleActiveLearningNode
-
getPrediction
public double[] getPrediction(Instance instance, int predictionMode)
- Specified by:
getPrediction
in classRuleActiveLearningNode
-
getNormalizedPrediction
public double getNormalizedPrediction(Instance instance)
-
getLearnerToUse
public int getLearnerToUse(Instance instance, int predMode)
- Specified by:
getLearnerToUse
in classRuleActiveLearningNode
-
computeSD
public double computeSD(double squaredVal, double val, double size)
-
computeSD
public double computeSD(double squaredVal, double val, long size)
-
computeError
public double computeError(Instance instance)
- Specified by:
computeError
in classRuleActiveLearningNode
-
isAnomaly
public boolean isAnomaly(Instance instance, double uniVariateAnomalyProbabilityThreshold, double multiVariateAnomalyProbabilityThreshold, int numberOfInstanceesForAnomaly)
- Specified by:
isAnomaly
in classRuleActiveLearningNode
-
debuganomaly
protected void debuganomaly(Instance instance, double uni, double multi, double probability)
-
initialize
public void initialize(RuleActiveLearningNode oldLearningNode)
- Specified by:
initialize
in classRuleActiveLearningNode
-
getSimplePrediction
public double[] getSimplePrediction()
- Specified by:
getSimplePrediction
in classRuleActiveLearningNode
-
tryToExpand
public boolean tryToExpand(double splitConfidence, double tieThreshold)
- Specified by:
tryToExpand
in classRuleActiveLearningNode
-
learnFromInstance
public void learnFromInstance(Instance inst)
- Specified by:
learnFromInstance
in classRuleActiveLearningNode
-
getBestSplitSuggestions
public AttributeSplitSuggestion[] getBestSplitSuggestions(SplitCriterion criterion)
-
getWeightSeen
public double getWeightSeen()
- Overrides:
getWeightSeen
in classHoeffdingTree.ActiveLearningNode
-
getCurrentError
public double getCurrentError()
- Specified by:
getCurrentError
in classRuleActiveLearningNode
-
-