MOA 12.03
Real Time Analytics for Data Streams
moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver Class Reference

Class for observing the class data distribution for a numeric attribute using a binary tree. More...

Inheritance diagram for moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver:
Collaboration diagram for moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver:

List of all members.

Classes

class  Node

Public Member Functions

void observeAttributeClass (double attVal, int classVal, double weight)
 Updates statistics of this observer given an attribute value, a class and the weight of the instance observed.
double probabilityOfAttributeValueGivenClass (double attVal, int classVal)
 Gets the probability for an attribute value given a class.
AttributeSplitSuggestion getBestEvaluatedSplitSuggestion (SplitCriterion criterion, double[] preSplitDist, int attIndex, boolean binaryOnly)
 Gets the best split suggestion given a criterion and a class distribution.
void getDescription (StringBuilder sb, int indent)
 Returns a string representation of this object.

Protected Member Functions

AttributeSplitSuggestion searchForBestSplitOption (Node currentNode, AttributeSplitSuggestion currentBestOption, double[] actualParentLeft, double[] parentLeft, double[] parentRight, boolean leftChild, SplitCriterion criterion, double[] preSplitDist, int attIndex)
void prepareForUseImpl (TaskMonitor monitor, ObjectRepository repository)
 This method describes the implementation of how to prepare this object for use.

Protected Attributes

Node root = null

Detailed Description

Class for observing the class data distribution for a numeric attribute using a binary tree.

This observer monitors the class distribution of a given attribute. Used in naive Bayes and decision trees to monitor data statistics on leaves.

Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
Version:
Revision:
7

Definition at line 41 of file BinaryTreeNumericAttributeClassObserver.java.


Member Function Documentation

AttributeSplitSuggestion moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.getBestEvaluatedSplitSuggestion ( SplitCriterion  criterion,
double[]  preSplitDist,
int  attIndex,
boolean  binaryOnly 
)

Gets the best split suggestion given a criterion and a class distribution.

Parameters:
criterionthe split criterion to use
preSplitDistthe class distribution before the split
attIndexthe attribute index
binaryOnlytrue to use binary splits
Returns:
suggestion of best attribute split

Implements moa.classifiers.core.attributeclassobservers.AttributeClassObserver.

Definition at line 108 of file BinaryTreeNumericAttributeClassObserver.java.

Here is the call graph for this function:

void moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.getDescription ( StringBuilder  sb,
int  indent 
)

Returns a string representation of this object.

Used in AbstractMOAObject.toString to give a string representation of the object.

Parameters:
sbthe stringbuilder to add the description
indentthe number of characters to indent

Implements moa.MOAObject.

Definition at line 170 of file BinaryTreeNumericAttributeClassObserver.java.

void moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.observeAttributeClass ( double  attVal,
int  classVal,
double  weight 
)

Updates statistics of this observer given an attribute value, a class and the weight of the instance observed.

Parameters:
attValthe value of the attribute
classValthe class
weightthe weight of the instance

Implements moa.classifiers.core.attributeclassobservers.AttributeClassObserver.

Definition at line 89 of file BinaryTreeNumericAttributeClassObserver.java.

Here is the call graph for this function:

void moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.prepareForUseImpl ( TaskMonitor  monitor,
ObjectRepository  repository 
) [protected, virtual]

This method describes the implementation of how to prepare this object for use.

All classes that extends this class have to implement prepareForUseImpl and not prepareForUse since prepareForUse calls prepareForUseImpl.

Parameters:
monitorthe TaskMonitor to use
repositorythe ObjectRepository to use

Implements moa.options.AbstractOptionHandler.

Definition at line 175 of file BinaryTreeNumericAttributeClassObserver.java.

double moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.probabilityOfAttributeValueGivenClass ( double  attVal,
int  classVal 
)

Gets the probability for an attribute value given a class.

Parameters:
attValthe attribute value
classValthe class
Returns:
probability for an attribute value given a class

Implements moa.classifiers.core.attributeclassobservers.AttributeClassObserver.

Definition at line 101 of file BinaryTreeNumericAttributeClassObserver.java.

AttributeSplitSuggestion moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.searchForBestSplitOption ( Node  currentNode,
AttributeSplitSuggestion  currentBestOption,
double[]  actualParentLeft,
double[]  parentLeft,
double[]  parentRight,
boolean  leftChild,
SplitCriterion  criterion,
double[]  preSplitDist,
int  attIndex 
) [protected]

Definition at line 115 of file BinaryTreeNumericAttributeClassObserver.java.

Referenced by moa.classifiers.core.attributeclassobservers.BinaryTreeNumericAttributeClassObserver.getBestEvaluatedSplitSuggestion().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations