Package org.tribuo

Interface Output<T extends Output<T>>

All Superinterfaces:
Serializable
All Known Subinterfaces:
Classifiable<T>
All Known Implementing Classes:
ClusterID, Event, Label, MultiLabel, Regressor, Regressor.DimensionTuple

public interface Output<T extends Output<T>> extends Serializable
Output is the root interface for the supported prediction types.

It's subclassed in each of the modules:

  • Label for multi-class classification
  • MultiLabel for multi-label classification
  • ClusterID for clustering
  • Regressor for regression
  • Event for anomaly detection
Equals and hashcode are defined to only look at the strings stored in an Output, not any score values. For equality that takes into account the scores, use fullEquals(T).
  • Method Summary

    Modifier and Type
    Method
    Description
    Deep copy of the output up to it's immutable state.
    boolean
    fullEquals(T other)
    Compares other to this output.
    getSerializableForm(boolean includeConfidence)
    Generates a String suitable for writing to a csv or json file.
  • Method Details

    • copy

      T copy()
      Deep copy of the output up to it's immutable state.
      Returns:
      A copy of the output.
    • getSerializableForm

      String getSerializableForm(boolean includeConfidence)
      Generates a String suitable for writing to a csv or json file.
      Parameters:
      includeConfidence - Include whatever confidence score the label contains, if known.
      Returns:
      A String representation of this Output.
    • fullEquals

      boolean fullEquals(T other)
      Compares other to this output. Uses all score values and the strings.
      Parameters:
      other - Another output instance.
      Returns:
      True if the other instance has value equality to this instance. False otherwise.