Package moa.classifiers.trees.iadem
Class IademGreenwaldKhannaNumericAttributeClassObserver
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.core.attributeclassobservers.GreenwaldKhannaNumericAttributeClassObserver
-
- moa.classifiers.trees.iadem.IademGreenwaldKhannaNumericAttributeClassObserver
-
- All Implemented Interfaces:
Configurable
,Serializable
,AttributeClassObserver
,NumericAttributeClassObserver
,IademNumericAttributeObserver
,MOAObject
,OptionHandler
public class IademGreenwaldKhannaNumericAttributeClassObserver extends GreenwaldKhannaNumericAttributeClassObserver implements IademNumericAttributeObserver
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class moa.classifiers.core.attributeclassobservers.GreenwaldKhannaNumericAttributeClassObserver
attValDistPerClass, numTuplesOption
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description IademGreenwaldKhannaNumericAttributeClassObserver()
IademGreenwaldKhannaNumericAttributeClassObserver(int maxTuples)
-
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> cortes, double valor)
ArrayList<Double[]>
computeConditionalProbPerBin(ArrayList<Double> cuts)
ArrayList<Double>
cutPointSuggestion(int numCortes)
long[]
getClassDist()
IademNumericAttributeObserver
getCopy()
double
getCut(int cutIndex)
long[]
getLeftClassDist(double cut)
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 observeddouble
probabilityOfAttributeValueGivenClass(double attVal, int classVal)
Gets the probability for an attribute value given a classvoid
reset()
void
setMaxBins(int numTuples)
protected long
sum(long[] arr)
-
Methods inherited from class moa.classifiers.core.attributeclassobservers.GreenwaldKhannaNumericAttributeClassObserver
getBestEvaluatedSplitSuggestion, getClassDistsResultingFromBinarySplit, getDescription, observeAttributeTarget, prepareForUseImpl
-
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
getBestEvaluatedSplitSuggestion, observeAttributeTarget
-
Methods inherited from interface moa.MOAObject
getDescription, measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
copy, getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
-
-
-
-
Method Detail
-
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 classGreenwaldKhannaNumericAttributeClassObserver
- Parameters:
attVal
- the value of the attributeclassVal
- the classweight
- the weight of the instance
-
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 classGreenwaldKhannaNumericAttributeClassObserver
- Parameters:
attVal
- the attribute valueclassVal
- the class- Returns:
- probability for an attribute value given a class
-
getMaxOfValues
public long getMaxOfValues()
- Specified by:
getMaxOfValues
in interfaceIademNumericAttributeObserver
-
addValue
public void addValue(double attValue, int classValue, double weight)
- Specified by:
addValue
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 cut)
- Specified by:
getLeftClassDist
in interfaceIademNumericAttributeObserver
-
getCut
public double getCut(int cutIndex)
- 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
-
sum
protected long sum(long[] arr)
-
cutPointSuggestion
public ArrayList<Double> cutPointSuggestion(int numCortes)
- Specified by:
cutPointSuggestion
in interfaceIademNumericAttributeObserver
-
computeConditionalProbPerBin
public ArrayList<Double[]> computeConditionalProbPerBin(ArrayList<Double> cuts)
- Specified by:
computeConditionalProbPerBin
in interfaceIademNumericAttributeObserver
-
computeConditionalProb
public double[] computeConditionalProb(ArrayList<Double> cortes, double valor)
- Specified by:
computeConditionalProb
in interfaceIademNumericAttributeObserver
-
getCopy
public IademNumericAttributeObserver getCopy()
- Specified by:
getCopy
in interfaceIademNumericAttributeObserver
-
reset
public void reset()
- Specified by:
reset
in interfaceIademNumericAttributeObserver
-
setMaxBins
public void setMaxBins(int numTuples)
- Specified by:
setMaxBins
in interfaceIademNumericAttributeObserver
-
computeClassDist
public void computeClassDist(double[][][] cutClassDist)
- Specified by:
computeClassDist
in interfaceIademNumericAttributeObserver
-
-