Interface Impurity
- All Superinterfaces:
Serializable
,scala.Serializable
public interface Impurity
extends scala.Serializable
Trait for calculating information gain.
This trait is used for
(a) setting the impurity parameter in
Strategy
(b) calculating impurity values from sufficient statistics.-
Method Summary
-
Method Details
-
calculate
double calculate(double[] counts, double totalCount) 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
double calculate(double count, double sum, double sumSquares) information calculation for regression- Parameters:
count
- number of instancessum
- sum of labelssumSquares
- summation of squares of the labels- Returns:
- information value, or 0 if count = 0
-