public class Entropy extends Object implements Impurity
entropy
during
binary classification.Constructor and Description |
---|
Entropy() |
Modifier and Type | Method and Description |
---|---|
static double |
calculate(double[] counts,
double totalCount)
:: DeveloperApi ::
information calculation for multiclass classification
|
static double |
calculate(double count,
double sum,
double sumSquares)
:: DeveloperApi ::
variance calculation
|
static org.apache.spark.mllib.tree.impurity.Entropy$ |
instance()
Get this impurity instance.
|
static double |
log2(double x) |
public static double log2(double x)
public static double calculate(double[] counts, double totalCount)
counts
- Array[Double] with counts for each labeltotalCount
- sum of counts for all labelspublic static double calculate(double count, double sum, double sumSquares)
count
- number of instancessum
- sum of labelssumSquares
- summation of squares of the labelspublic static org.apache.spark.mllib.tree.impurity.Entropy$ instance()