Package org.tribuo

Interface ImmutableOutputInfo<T extends Output<T>>

All Superinterfaces:
Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer,T>>, OutputInfo<T>, Serializable
All Known Implementing Classes:
ImmutableAnomalyInfo, ImmutableClusteringInfo, ImmutableLabelInfo, ImmutableMultiLabelInfo, ImmutableRegressionInfo

public interface ImmutableOutputInfo<T extends Output<T>> extends OutputInfo<T>, Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer,T>>
An OutputInfo that is fixed, and contains an id number for each valid output.

In the case of real valued outputs, the id number represents the dimension.

  • Method Details

    • getID

      int getID(T output)
      Return the id number associated with this output, or -1 if the output is unknown.
      Parameters:
      output - An output
      Returns:
      A non-negative integer if the output is known, or -1 if the output is unknown.
    • getOutput

      T getOutput(int id)
      Returns the output associated with this id, or null if the id is unknown.
      Parameters:
      id - A non-negative integer.
      Returns:
      An output object or null if it's unknown.
    • getTotalObservations

      long getTotalObservations()
      Returns the total number of observed outputs seen by this ImmutableOutputInfo.
      Returns:
      The number of observed outputs.
    • domainAndIDEquals

      default boolean domainAndIDEquals(ImmutableOutputInfo<T> other)
      Checks if the domain is the same as the other output info's domain, and that each element is mapped to the same id number.

      Note the default behaviour will be removed in a future major release, and should be overridden for performance reasons in all implementing classes.

      Parameters:
      other - The output info to compare.
      Returns:
      True if the domains and ids are the same.