Class MeanSquaredError

java.lang.Object
org.tribuo.regression.rtree.impurity.MeanSquaredError
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, RegressorImpurity

public class MeanSquaredError extends Object implements RegressorImpurity
Measures the mean squared error over a set of inputs.

Used to calculate the impurity of a regression node.

  • Constructor Details

    • MeanSquaredError

      public MeanSquaredError()
  • Method Details

    • impurity

      public double impurity(float[] targets, float[] weights)
      Description copied from interface: RegressorImpurity
      Calculates the impurity based on the supplied weights and targets.
      Specified by:
      impurity in interface RegressorImpurity
      Parameters:
      targets - The targets.
      weights - The weights.
      Returns:
      The impurity.
    • impurityTuple

      public RegressorImpurity.ImpurityTuple impurityTuple(int[] indices, int indicesLength, float[] targets, float[] weights)
      Description copied from interface: RegressorImpurity
      Calculates the weighted impurity of the targets specified in the indices array.
      Specified by:
      impurityTuple in interface RegressorImpurity
      Parameters:
      indices - The indices in the targets and weights arrays.
      indicesLength - The number of values to use in indices.
      targets - The regression targets.
      weights - The example weights.
      Returns:
      A tuple containing the impurity and the used weight sum.
    • impurityTuple

      public RegressorImpurity.ImpurityTuple impurityTuple(List<int[]> indices, float[] targets, float[] weights)
      Description copied from interface: RegressorImpurity
      Calculates the weighted impurity of the targets specified in all the indices arrays.
      Specified by:
      impurityTuple in interface RegressorImpurity
      Parameters:
      indices - The indices in the targets and weights arrays.
      targets - The regression targets.
      weights - The example weights.
      Returns:
      A tuple containing the impurity and the used weight sum.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProvenance

      public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>