public class GiniCalculator extends ImpurityCalculator
GiniAggregator
, this class stores its own data and is for a specific
(node, feature, bin).Constructor and Description |
---|
GiniCalculator(double[] stats) |
Modifier and Type | Method and Description |
---|---|
double |
calculate()
Calculate the impurity from the stored sufficient statistics.
|
GiniCalculator |
copy()
Make a deep copy of this
ImpurityCalculator . |
long |
count()
Number of data points accounted for in the sufficient statistics.
|
double |
predict()
Prediction which should be made based on the sufficient statistics.
|
double |
prob(double label)
Probability of the label given by
predict . |
String |
toString() |
add, stats, subtract
public GiniCalculator copy()
ImpurityCalculator
.copy
in class ImpurityCalculator
public double calculate()
calculate
in class ImpurityCalculator
public long count()
count
in class ImpurityCalculator
public double predict()
predict
in class ImpurityCalculator
public double prob(double label)
predict
.prob
in class ImpurityCalculator
public String toString()
toString
in class Object