org.apache.spark.mllib.tree.impurity
Class Gini
Object
org.apache.spark.mllib.tree.impurity.Gini
- All Implemented Interfaces:
- java.io.Serializable, Impurity
public class Gini
- extends Object
- implements Impurity
:: Experimental ::
Class for calculating the
Gini impurity
during binary classification.
- See Also:
- Serialized Form
Constructor Summary |
Gini()
|
Method Summary |
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.Gini$ |
instance()
Get this impurity instance. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Gini
public Gini()
calculate
public static double calculate(double[] counts,
double totalCount)
- :: DeveloperApi ::
information calculation for multiclass classification
- Parameters:
counts
- Array[Double] with counts for each labeltotalCount
- sum of counts for all labels
- Returns:
- information value, or 0 if totalCount = 0
calculate
public static double calculate(double count,
double sum,
double sumSquares)
- :: DeveloperApi ::
variance calculation
- Parameters:
count
- number of instancessum
- sum of labelssumSquares
- summation of squares of the labels
- Returns:
- information value, or 0 if count = 0
instance
public static org.apache.spark.mllib.tree.impurity.Gini$ instance()
- Get this impurity instance.
This is useful for passing impurity parameters to a Strategy in Java.
- Returns:
- (undocumented)