public class NominalAttributeClassObserver extends AbstractOptionHandler implements DiscreteAttributeClassObserver
Modifier and Type | Field and Description |
---|---|
AutoExpandVector<DoubleVector> |
attValDistPerClass |
protected double |
missingWeightObserved |
protected double |
totalWeightObserved |
classOptionNamesToPreparedObjects, options
Constructor and Description |
---|
NominalAttributeClassObserver() |
Modifier and Type | Method and Description |
---|---|
AttributeSplitSuggestion |
getBestEvaluatedSplitSuggestion(SplitCriterion criterion,
double[] preSplitDist,
int attIndex,
boolean binaryOnly)
Gets the best split suggestion given a criterion and a class distribution
|
double[][] |
getClassDistsResultingFromBinarySplit(int valIndex) |
double[][] |
getClassDistsResultingFromMultiwaySplit(int maxAttValsObserved) |
void |
getDescription(StringBuilder sb,
int indent)
Returns a string representation of this object.
|
int |
getMaxAttValsObserved() |
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
|
void |
observeAttributeTarget(double attVal,
double target) |
protected void |
prepareForUseImpl(TaskMonitor monitor,
ObjectRepository repository)
This method describes the implementation of how to prepare this object for use.
|
double |
probabilityOfAttributeValueGivenClass(double attVal,
int classVal)
Gets the probability for an attribute value given a class
|
double |
totalWeightOfClassObservations() |
double |
weightOfObservedMissingValues() |
copy, discoverOptionsViaReflection, getCLICreationString, getOptions, getPreparedClassOption, getPreparedClassOption, getPurposeString, prepareClassOptions, prepareForUse, prepareForUse
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
copy, getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
measureByteSize
protected double totalWeightObserved
protected double missingWeightObserved
public AutoExpandVector<DoubleVector> attValDistPerClass
public void observeAttributeClass(double attVal, int classVal, double weight)
AttributeClassObserver
observeAttributeClass
in interface AttributeClassObserver
attVal
- the value of the attributeclassVal
- the classweight
- the weight of the instancepublic double probabilityOfAttributeValueGivenClass(double attVal, int classVal)
AttributeClassObserver
probabilityOfAttributeValueGivenClass
in interface AttributeClassObserver
attVal
- the attribute valueclassVal
- the classpublic double totalWeightOfClassObservations()
public double weightOfObservedMissingValues()
public AttributeSplitSuggestion getBestEvaluatedSplitSuggestion(SplitCriterion criterion, double[] preSplitDist, int attIndex, boolean binaryOnly)
AttributeClassObserver
getBestEvaluatedSplitSuggestion
in interface AttributeClassObserver
criterion
- the split criterion to usepreSplitDist
- the class distribution before the splitattIndex
- the attribute indexbinaryOnly
- true to use binary splitspublic int getMaxAttValsObserved()
public double[][] getClassDistsResultingFromMultiwaySplit(int maxAttValsObserved)
public double[][] getClassDistsResultingFromBinarySplit(int valIndex)
public void getDescription(StringBuilder sb, int indent)
MOAObject
AbstractMOAObject.toString
to give a string representation of the object.getDescription
in interface MOAObject
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indentprotected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
AbstractOptionHandler
prepareForUseImpl
and not prepareForUse
since
prepareForUse
calls prepareForUseImpl
.prepareForUseImpl
in class AbstractOptionHandler
monitor
- the TaskMonitor to userepository
- the ObjectRepository to usepublic void observeAttributeTarget(double attVal, double target)
observeAttributeTarget
in interface AttributeClassObserver
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.