public class IademVFMLNumericAttributeClassObserver extends VFMLNumericAttributeClassObserver implements IademNumericAttributeObserver, AttributeClassObserver
Modifier and Type | Class and Description |
---|---|
protected class |
IademVFMLNumericAttributeClassObserver.Bin |
Modifier and Type | Field and Description |
---|---|
protected List<IademVFMLNumericAttributeClassObserver.Bin> |
binList |
protected DoubleVector |
classDist |
numBinsOption
config
Constructor and Description |
---|
IademVFMLNumericAttributeClassObserver() |
IademVFMLNumericAttributeClassObserver(int maxBins) |
Modifier and Type | Method and 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 distribution
|
long[] |
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 observed
|
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
|
void |
reset() |
void |
setMaxBins(int numBins) |
observeAttributeTarget
copy, getCLICreationString, getOptions, getPreparedClassOption, getPurposeString, prepareClassOptions, prepareForUse, prepareForUse
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
observeAttributeTarget
copy, getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
measureByteSize
protected List<IademVFMLNumericAttributeClassObserver.Bin> binList
protected DoubleVector classDist
public IademVFMLNumericAttributeClassObserver()
public IademVFMLNumericAttributeClassObserver(int maxBins)
public void setMaxBins(int numBins)
setMaxBins
in interface IademNumericAttributeObserver
protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
AbstractOptionHandler
prepareForUseImpl
and not prepareForUse
since
prepareForUse
calls prepareForUseImpl
.prepareForUseImpl
in class VFMLNumericAttributeClassObserver
monitor
- the TaskMonitor to userepository
- the ObjectRepository to usepublic void computeClassDist(double[][][] cutClassDist)
computeClassDist
in interface IademNumericAttributeObserver
public void observeAttributeClass(double attVal, int classVal, double weight)
AttributeClassObserver
observeAttributeClass
in interface AttributeClassObserver
observeAttributeClass
in class VFMLNumericAttributeClassObserver
attVal
- the value of the attributeclassVal
- the classweight
- the weight of the instancepublic AttributeSplitSuggestion getBestEvaluatedSplitSuggestion(SplitCriterion criterion, double[] preSplitDist, int attIndex, boolean binaryOnly)
AttributeClassObserver
getBestEvaluatedSplitSuggestion
in interface AttributeClassObserver
getBestEvaluatedSplitSuggestion
in class VFMLNumericAttributeClassObserver
criterion
- the split criterion to usepreSplitDist
- the class distribution before the splitattIndex
- the attribute indexbinaryOnly
- true to use binary splitspublic void getDescription(StringBuilder sb, int indent)
MOAObject
AbstractMOAObject.toString
to give a string representation of the object.getDescription
in interface MOAObject
getDescription
in class VFMLNumericAttributeClassObserver
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indentpublic double probabilityOfAttributeValueGivenClass(double attVal, int classVal)
AttributeClassObserver
probabilityOfAttributeValueGivenClass
in interface AttributeClassObserver
probabilityOfAttributeValueGivenClass
in class VFMLNumericAttributeClassObserver
attVal
- the attribute valueclassVal
- the classpublic void forgetAttributeClass(double attVal, int classVal, double weight)
public void reset()
reset
in interface IademNumericAttributeObserver
public long getValueCount()
getValueCount
in interface IademNumericAttributeObserver
public long[] getClassDist()
getClassDist
in interface IademNumericAttributeObserver
public long getNumberOfCutPoints()
getNumberOfCutPoints
in interface IademNumericAttributeObserver
public long[] getLeftClassDist(double corte)
getLeftClassDist
in interface IademNumericAttributeObserver
public double getCut(int indice)
getCut
in interface IademNumericAttributeObserver
public void computeClassDistProbabilities(double[][][] cut_value_classDist_lower, double[][][] cut_value_classDist_upper, double[][] counts_cut_value, boolean withIntervalEstimates)
computeClassDistProbabilities
in interface IademNumericAttributeObserver
public ArrayList<Double> cutPointSuggestion(int numMaxIntervalos)
cutPointSuggestion
in interface IademNumericAttributeObserver
public ArrayList<Double[]> computeConditionalProbPerBin(ArrayList<Double> cortes)
computeConditionalProbPerBin
in interface IademNumericAttributeObserver
public double[] computeConditionalProb(ArrayList<Double> cuts, double cutValue)
computeConditionalProb
in interface IademNumericAttributeObserver
public void addValue(double attValue, int classValue, double weight)
addValue
in interface IademNumericAttributeObserver
public long getMaxOfValues()
getMaxOfValues
in interface IademNumericAttributeObserver
public IademNumericAttributeObserver getCopy()
getCopy
in interface IademNumericAttributeObserver
Copyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.