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, subtractpublic GiniCalculator copy()
ImpurityCalculator.copy in class ImpurityCalculatorpublic double calculate()
calculate in class ImpurityCalculatorpublic long count()
count in class ImpurityCalculatorpublic double predict()
predict in class ImpurityCalculatorpublic double prob(double label)
predict.prob in class ImpurityCalculatorpublic String toString()
toString in class Object