public abstract class ImpurityCalculator
extends Object
ImpurityAggregator
, this class stores its own data and is for a specific
(node, feature, bin).Constructor and Description |
---|
ImpurityCalculator(double[] stats) |
Modifier and Type | Method and Description |
---|---|
ImpurityCalculator |
add(ImpurityCalculator other)
Add the stats from another calculator into this one, modifying and returning this calculator.
|
abstract double |
calculate()
Calculate the impurity from the stored sufficient statistics.
|
abstract ImpurityCalculator |
copy()
Make a deep copy of this
ImpurityCalculator . |
abstract long |
count()
Number of data points accounted for in the sufficient statistics.
|
abstract double |
predict()
Prediction which should be made based on the sufficient statistics.
|
double |
prob(double label)
Probability of the label given by
predict , or -1 if no probability is available. |
double[] |
stats() |
ImpurityCalculator |
subtract(ImpurityCalculator other)
Subtract the stats from another calculator from this one, modifying and returning this
calculator.
|
public double[] stats()
public abstract ImpurityCalculator copy()
ImpurityCalculator
.public abstract double calculate()
public ImpurityCalculator add(ImpurityCalculator other)
public ImpurityCalculator subtract(ImpurityCalculator other)
public abstract long count()
public abstract double predict()
public double prob(double label)
predict
, or -1 if no probability is available.