public class QuantileCalculator
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
QuantileCalculator(weka.core.Instances header,
double[] quantiles)
Constructor
|
Modifier and Type | Method and Description |
---|---|
double |
getQuantile(java.lang.String attName,
double quantileToGet)
Get a specific quantile for the named attribute
|
double[] |
getQuantiles(java.lang.String attName)
Get the computed quantiles for the named attribute
|
void |
setHistogramMap(java.util.Map<java.lang.Integer,NumericAttributeBinData> initializedHistData)
Set a map of initialized numeric histogram data to be updated for each
incoming row/instance
|
void |
update(weka.core.Instance inst)
Perform an update using the supplied instance
|
void |
update(java.lang.String[] row,
java.lang.String missingValue)
Perform an update using an instance represented as an array of string
values
|
public QuantileCalculator(weka.core.Instances header, double[] quantiles)
header
- the header of the dataset to processquantiles
- an array of quantiles to compute for each numeric
attributepublic void setHistogramMap(java.util.Map<java.lang.Integer,NumericAttributeBinData> initializedHistData)
initializedHistData
- a map of NumericAttributeBinData that has been
initialized. Keyed by attribute indexpublic void update(java.lang.String[] row, java.lang.String missingValue) throws java.lang.Exception
row
- the row to update withmissingValue
- the missing value stringjava.lang.Exception
- if a problem occurspublic void update(weka.core.Instance inst) throws java.lang.Exception
inst
- the instance to update withjava.lang.Exception
- if a problem occurspublic double[] getQuantiles(java.lang.String attName) throws java.lang.Exception
attName
- the attribute to get the current computed quantiles forjava.lang.Exception
- if a problem occurspublic double getQuantile(java.lang.String attName, double quantileToGet) throws java.lang.Exception
attName
- the name of the attribute to get a quantile forquantileToGet
- the specific quantile to getjava.lang.Exception
- if a problem occurs