Package moa.classifiers.rules.core
Class RuleActiveLearningNode
- 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
-
- All Implemented Interfaces:
Serializable
,MOAObject
- Direct Known Subclasses:
RuleActiveRegressionNode
public abstract class RuleActiveLearningNode extends HoeffdingTree.ActiveLearningNode
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 AbstractAMRules
amRules
protected boolean[]
attributesMask
protected AttributeSplitSuggestion
bestSuggestion
protected boolean
changeDetection
protected DoubleVector
nodeStatistics
protected int
numAttributesSelected
protected Rule
owner
protected PageHinkleyTest
pageHinckleyTest
protected int
predictionFunction
protected int
splitIndex
protected double[]
statisticsBranchSplit
protected double[]
statisticsNewRuleActiveLearningNode
protected double[]
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 RuleActiveLearningNode()
RuleActiveLearningNode(double[] initialClassObservations)
Create a new RuleActiveLearningNodeRuleActiveLearningNode(Rule.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double
computeError(Instance instance)
static double
computeHoeffdingBound(double range, double confidence, double n)
double
computeProbability(double mean, double sd, double value)
protected void
debug(String string, int level)
AutoExpandVector<AttributeClassObserver>
getAttributeObservers()
AttributeSplitSuggestion
getBestSuggestion()
abstract double
getCurrentError()
long
getInstancesSeen()
abstract int
getLearnerToUse(Instance instance, int predictionMode)
DoubleVector
getNodeStatistics()
double[]
getPrediction(Instance instance)
abstract double[]
getPrediction(Instance instance, int predictionMode)
abstract double[]
getSimplePrediction()
int
getSplitIndex()
double[]
getStatisticsBranchSplit()
double[]
getStatisticsNewRuleActiveLearningNode()
double[]
getStatisticsOtherBranchSplit()
abstract void
initialize(RuleActiveLearningNode oldLearningNode)
abstract boolean
isAnomaly(Instance instance, double uniVariateAnomalyProbabilityThreshold, double multiVariateAnomalyProbabilityThreshold, int numberOfInstanceesForAnomaly)
abstract void
learnFromInstance(Instance inst)
void
learnFromInstance(Instance inst, HoeffdingTree ht)
protected AttributeClassObserver
newNumericClassObserver()
void
setBestSuggestion(AttributeSplitSuggestion bestSuggestion)
void
setSplitIndex(int splitIndex)
void
setStatisticsBranchSplit(double[] statisticsBranchSplit)
void
setStatisticsNewRuleActiveLearningNode(double[] statisticsNewRuleActiveLearningNode)
void
setStatisticsOtherBranchSplit(double[] statisticsOtherBranchSplit)
abstract boolean
tryToExpand(double splitConfidence, double tieThreshold)
boolean
updateChangeDetection(double error)
boolean
updatePageHinckleyTest(double error)
void
updateStatistics(Instance instance)
-
Methods inherited from class moa.classifiers.trees.HoeffdingTree.ActiveLearningNode
calcByteSize, disableAttribute, getBestSplitSuggestions, getWeightSeen, 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
-
pageHinckleyTest
protected PageHinkleyTest pageHinckleyTest
-
predictionFunction
protected int predictionFunction
-
changeDetection
protected boolean changeDetection
-
owner
protected Rule owner
-
attributesMask
protected boolean[] attributesMask
-
numAttributesSelected
protected int numAttributesSelected
-
nodeStatistics
protected DoubleVector nodeStatistics
-
amRules
protected AbstractAMRules amRules
-
bestSuggestion
protected AttributeSplitSuggestion bestSuggestion
-
splitIndex
protected int splitIndex
-
statisticsNewRuleActiveLearningNode
protected double[] statisticsNewRuleActiveLearningNode
-
statisticsBranchSplit
protected double[] statisticsBranchSplit
-
statisticsOtherBranchSplit
protected double[] statisticsOtherBranchSplit
-
-
Constructor Detail
-
RuleActiveLearningNode
public RuleActiveLearningNode(double[] initialClassObservations)
Create a new RuleActiveLearningNode
-
RuleActiveLearningNode
public RuleActiveLearningNode()
-
RuleActiveLearningNode
public RuleActiveLearningNode(Rule.Builder builder)
-
-
Method Detail
-
learnFromInstance
public abstract void learnFromInstance(Instance inst)
-
learnFromInstance
public void learnFromInstance(Instance inst, HoeffdingTree ht)
- Overrides:
learnFromInstance
in classHoeffdingTree.ActiveLearningNode
-
newNumericClassObserver
protected AttributeClassObserver newNumericClassObserver()
-
updateStatistics
public void updateStatistics(Instance instance)
-
getAttributeObservers
public AutoExpandVector<AttributeClassObserver> getAttributeObservers()
-
debug
protected void debug(String string, int level)
-
getPrediction
public double[] getPrediction(Instance instance)
-
getPrediction
public abstract double[] getPrediction(Instance instance, int predictionMode)
-
getLearnerToUse
public abstract int getLearnerToUse(Instance instance, int predictionMode)
-
computeError
public abstract double computeError(Instance instance)
-
updatePageHinckleyTest
public boolean updatePageHinckleyTest(double error)
-
getInstancesSeen
public long getInstancesSeen()
-
isAnomaly
public abstract boolean isAnomaly(Instance instance, double uniVariateAnomalyProbabilityThreshold, double multiVariateAnomalyProbabilityThreshold, int numberOfInstanceesForAnomaly)
-
computeProbability
public double computeProbability(double mean, double sd, double value)
-
getSplitIndex
public int getSplitIndex()
-
setSplitIndex
public void setSplitIndex(int splitIndex)
-
getBestSuggestion
public AttributeSplitSuggestion getBestSuggestion()
-
setBestSuggestion
public void setBestSuggestion(AttributeSplitSuggestion bestSuggestion)
-
getStatisticsBranchSplit
public double[] getStatisticsBranchSplit()
-
setStatisticsBranchSplit
public void setStatisticsBranchSplit(double[] statisticsBranchSplit)
-
getStatisticsNewRuleActiveLearningNode
public double[] getStatisticsNewRuleActiveLearningNode()
-
setStatisticsNewRuleActiveLearningNode
public void setStatisticsNewRuleActiveLearningNode(double[] statisticsNewRuleActiveLearningNode)
-
getStatisticsOtherBranchSplit
public double[] getStatisticsOtherBranchSplit()
-
setStatisticsOtherBranchSplit
public void setStatisticsOtherBranchSplit(double[] statisticsOtherBranchSplit)
-
tryToExpand
public abstract boolean tryToExpand(double splitConfidence, double tieThreshold)
-
computeHoeffdingBound
public static double computeHoeffdingBound(double range, double confidence, double n)
-
initialize
public abstract void initialize(RuleActiveLearningNode oldLearningNode)
-
getSimplePrediction
public abstract double[] getSimplePrediction()
-
getNodeStatistics
public DoubleVector getNodeStatistics()
-
updateChangeDetection
public boolean updateChangeDetection(double error)
-
getCurrentError
public abstract double getCurrentError()
-
-