Interface Impurity

All Superinterfaces:
Serializable

public interface Impurity extends 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

    Modifier and Type
    Method
    Description
    double
    calculate(double[] counts, double totalCount)
    information calculation for multiclass classification
    double
    calculate(double count, double sum, double sumSquares)
    information calculation for regression
  • Method Details

    • calculate

      double calculate(double[] counts, double totalCount)
      information calculation for multiclass classification
      Parameters:
      counts - Array[Double] with counts for each label
      totalCount - 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 instances
      sum - sum of labels
      sumSquares - summation of squares of the labels
      Returns:
      information value, or 0 if count = 0