Package moa.classifiers.trees.iadem
Class IademVFMLNumericAttributeClassObserver
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.core.attributeclassobservers.VFMLNumericAttributeClassObserver
-
- moa.classifiers.trees.iadem.IademVFMLNumericAttributeClassObserver
-
- All Implemented Interfaces:
Configurable
,Serializable
,AttributeClassObserver
,NumericAttributeClassObserver
,IademNumericAttributeObserver
,MOAObject
,OptionHandler
public class IademVFMLNumericAttributeClassObserver extends VFMLNumericAttributeClassObserver implements IademNumericAttributeObserver, AttributeClassObserver
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
IademVFMLNumericAttributeClassObserver.Bin
-
Field Summary
Fields Modifier and Type Field Description protected List<IademVFMLNumericAttributeClassObserver.Bin>
binList
protected DoubleVector
classDist
-
Fields inherited from class moa.classifiers.core.attributeclassobservers.VFMLNumericAttributeClassObserver
numBinsOption
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description IademVFMLNumericAttributeClassObserver()
IademVFMLNumericAttributeClassObserver(int maxBins)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(double attValue, int classValue, double weight)
void
computeClassDist(double[][][] cutClassDist)
void
computeClassDistProbabilities(double[][][] cut_value_classDist_lower, double[][][] cut_value_classDist_upper, double[][] counts_cut_value, boolean withIntervalEstimates)
double[]
computeConditionalProb(ArrayList<Double> cuts, double cutValue)
ArrayList<Double[]>
computeConditionalProbPerBin(ArrayList<Double> cortes)
ArrayList<Double>
cutPointSuggestion(int numMaxIntervalos)
void
forgetAttributeClass(double attVal, int classVal, double weight)
AttributeSplitSuggestion
getBestEvaluatedSplitSuggestion(SplitCriterion criterion, double[] preSplitDist, int attIndex, boolean binaryOnly)
Gets the best split suggestion given a criterion and a class distributionlong[]
getClassDist()
IademNumericAttributeObserver
getCopy()
double
getCut(int indice)
void
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.long[]
getLeftClassDist(double corte)
long
getMaxOfValues()
long
getNumberOfCutPoints()
long
getValueCount()
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 observedprotected 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 classvoid
reset()
void
setMaxBins(int numBins)
-
Methods inherited from class moa.classifiers.core.attributeclassobservers.VFMLNumericAttributeClassObserver
observeAttributeTarget
-
Methods inherited from class moa.options.AbstractOptionHandler
copy, getCLICreationString, getOptions, getPreparedClassOption, getPurposeString, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.classifiers.core.attributeclassobservers.AttributeClassObserver
observeAttributeTarget
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
copy, getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
binList
protected List<IademVFMLNumericAttributeClassObserver.Bin> binList
-
classDist
protected DoubleVector classDist
-
-
Method Detail
-
setMaxBins
public void setMaxBins(int numBins)
- Specified by:
setMaxBins
in interfaceIademNumericAttributeObserver
-
prepareForUseImpl
protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
Description copied from class:AbstractOptionHandler
This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implementprepareForUseImpl
and notprepareForUse
sinceprepareForUse
callsprepareForUseImpl
.- Overrides:
prepareForUseImpl
in classVFMLNumericAttributeClassObserver
- Parameters:
monitor
- the TaskMonitor to userepository
- the ObjectRepository to use
-
computeClassDist
public void computeClassDist(double[][][] cutClassDist)
- Specified by:
computeClassDist
in interfaceIademNumericAttributeObserver
-
observeAttributeClass
public void observeAttributeClass(double attVal, int classVal, double weight)
Description copied from interface:AttributeClassObserver
Updates statistics of this observer given an attribute value, a class and the weight of the instance observed- Specified by:
observeAttributeClass
in interfaceAttributeClassObserver
- Overrides:
observeAttributeClass
in classVFMLNumericAttributeClassObserver
- Parameters:
attVal
- the value of the attributeclassVal
- the classweight
- the weight of the instance
-
getBestEvaluatedSplitSuggestion
public AttributeSplitSuggestion getBestEvaluatedSplitSuggestion(SplitCriterion criterion, double[] preSplitDist, int attIndex, boolean binaryOnly)
Description copied from interface:AttributeClassObserver
Gets the best split suggestion given a criterion and a class distribution- Specified by:
getBestEvaluatedSplitSuggestion
in interfaceAttributeClassObserver
- Overrides:
getBestEvaluatedSplitSuggestion
in classVFMLNumericAttributeClassObserver
- Parameters:
criterion
- the split criterion to usepreSplitDist
- the class distribution before the splitattIndex
- the attribute indexbinaryOnly
- true to use binary splits- Returns:
- suggestion of best attribute split
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Overrides:
getDescription
in classVFMLNumericAttributeClassObserver
- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
probabilityOfAttributeValueGivenClass
public double probabilityOfAttributeValueGivenClass(double attVal, int classVal)
Description copied from interface:AttributeClassObserver
Gets the probability for an attribute value given a class- Specified by:
probabilityOfAttributeValueGivenClass
in interfaceAttributeClassObserver
- Overrides:
probabilityOfAttributeValueGivenClass
in classVFMLNumericAttributeClassObserver
- Parameters:
attVal
- the attribute valueclassVal
- the class- Returns:
- probability for an attribute value given a class
-
forgetAttributeClass
public void forgetAttributeClass(double attVal, int classVal, double weight)
-
reset
public void reset()
- Specified by:
reset
in interfaceIademNumericAttributeObserver
-
getValueCount
public long getValueCount()
- Specified by:
getValueCount
in interfaceIademNumericAttributeObserver
-
getClassDist
public long[] getClassDist()
- Specified by:
getClassDist
in interfaceIademNumericAttributeObserver
-
getNumberOfCutPoints
public long getNumberOfCutPoints()
- Specified by:
getNumberOfCutPoints
in interfaceIademNumericAttributeObserver
-
getLeftClassDist
public long[] getLeftClassDist(double corte)
- Specified by:
getLeftClassDist
in interfaceIademNumericAttributeObserver
-
getCut
public double getCut(int indice)
- Specified by:
getCut
in interfaceIademNumericAttributeObserver
-
computeClassDistProbabilities
public void computeClassDistProbabilities(double[][][] cut_value_classDist_lower, double[][][] cut_value_classDist_upper, double[][] counts_cut_value, boolean withIntervalEstimates)
- Specified by:
computeClassDistProbabilities
in interfaceIademNumericAttributeObserver
-
cutPointSuggestion
public ArrayList<Double> cutPointSuggestion(int numMaxIntervalos)
- Specified by:
cutPointSuggestion
in interfaceIademNumericAttributeObserver
-
computeConditionalProbPerBin
public ArrayList<Double[]> computeConditionalProbPerBin(ArrayList<Double> cortes)
- Specified by:
computeConditionalProbPerBin
in interfaceIademNumericAttributeObserver
-
computeConditionalProb
public double[] computeConditionalProb(ArrayList<Double> cuts, double cutValue)
- Specified by:
computeConditionalProb
in interfaceIademNumericAttributeObserver
-
addValue
public void addValue(double attValue, int classValue, double weight)
- Specified by:
addValue
in interfaceIademNumericAttributeObserver
-
getMaxOfValues
public long getMaxOfValues()
- Specified by:
getMaxOfValues
in interfaceIademNumericAttributeObserver
-
getCopy
public IademNumericAttributeObserver getCopy()
- Specified by:
getCopy
in interfaceIademNumericAttributeObserver
-
-