Class RegressionInfo

java.lang.Object
org.tribuo.regression.RegressionInfo
All Implemented Interfaces:
Serializable, OutputInfo<Regressor>
Direct Known Subclasses:
ImmutableRegressionInfo, MutableRegressionInfo

public abstract class RegressionInfo extends Object implements OutputInfo<Regressor>
The base class for regression information using Regressors.

Stores the observed min, max, mean and variance for each dimension.

See Also:
  • Field Details

    • maxMap

      protected Map<String,com.oracle.labs.mlrg.olcut.util.MutableDouble> maxMap
    • minMap

      protected Map<String,com.oracle.labs.mlrg.olcut.util.MutableDouble> minMap
    • meanMap

      protected Map<String,com.oracle.labs.mlrg.olcut.util.MutableDouble> meanMap
    • sumSquaresMap

      protected Map<String,com.oracle.labs.mlrg.olcut.util.MutableDouble> sumSquaresMap
    • countMap

      protected Map<String,com.oracle.labs.mlrg.olcut.util.MutableLong> countMap
    • overallCount

      protected long overallCount
    • unknownCount

      protected int unknownCount
  • Method Details

    • getUnknownCount

      public int getUnknownCount()
      Description copied from interface: OutputInfo
      Returns the number of unknown Output instances (generated by OutputFactory.getUnknownOutput()) that this OutputInfo has seen.
      Specified by:
      getUnknownCount in interface OutputInfo<Regressor>
      Returns:
      The number of unknown outputs observed.
    • getDomain

      public Set<Regressor> getDomain()
      Returns a set containing a Regressor for each dimension with the minimum value observed.
      Specified by:
      getDomain in interface OutputInfo<Regressor>
      Returns:
      A set of Regressors, each with one active dimension.
    • getMin

      public double getMin(String name)
      Gets the minimum value this RegressionInfo has seen, or NaN if it's not seen anything.
      Parameters:
      name - The dimension to check.
      Returns:
      The minimum value for that dimension.
    • getMax

      public double getMax(String name)
      Gets the maximum value this RegressionInfo has seen, or NaN if it's not seen that dimension.
      Parameters:
      name - The dimension to check.
      Returns:
      The maximum value for that dimension.
    • getMean

      public double getMean(String name)
      Gets the mean value this RegressionInfo has seen, or NaN if it's not seen that dimension.
      Parameters:
      name - The dimension to check.
      Returns:
      The mean value for that dimension.
    • getVariance

      public double getVariance(String name)
      Gets the variance this RegressionInfo has seen, or NaN if it's not seen that dimension.
      Parameters:
      name - The dimension to check.
      Returns:
      The variance for that dimension.
    • size

      public int size()
      The number of dimensions this OutputInfo has seen.
      Specified by:
      size in interface OutputInfo<Regressor>
      Returns:
      The number of dimensions this OutputInfo has seen.
    • generateImmutableOutputInfo

      public ImmutableOutputInfo<Regressor> generateImmutableOutputInfo()
      Description copied from interface: OutputInfo
      Generates an ImmutableOutputInfo which has a copy of the data in this OutputInfo, but also has id values and is immutable.
      Specified by:
      generateImmutableOutputInfo in interface OutputInfo<Regressor>
      Returns:
      An immutable copy of this OutputInfo.
    • generateMutableOutputInfo

      public MutableOutputInfo<Regressor> generateMutableOutputInfo()
      Description copied from interface: OutputInfo
      Generates a mutable copy of this OutputInfo.
      Specified by:
      generateMutableOutputInfo in interface OutputInfo<Regressor>
      Returns:
      A mutable copy of this OutputInfo.
    • copy

      public abstract RegressionInfo copy()
      Description copied from interface: OutputInfo
      Generates a copy of this OutputInfo, including it's mutability.
      Specified by:
      copy in interface OutputInfo<Regressor>
      Returns:
      A copy of the OutputInfo.
    • outputCountsIterable

      public Iterable<com.oracle.labs.mlrg.olcut.util.Pair<String,Long>> outputCountsIterable()
      Description copied from interface: OutputInfo
      An Iterable over the possible outputs and the number of times they were observed.

      Provides similar functionality to an iterator over the entrySet of a Map, though this is a copy of the data and immutable.

      Specified by:
      outputCountsIterable in interface OutputInfo<Regressor>
      Returns:
      Lambda wrapping an iterator over Pairs.