Class MutableAnomalyInfo

java.lang.Object
org.tribuo.anomaly.AnomalyInfo
org.tribuo.anomaly.MutableAnomalyInfo
All Implemented Interfaces:
Serializable, MutableOutputInfo<Event>, OutputInfo<Event>, ProtoSerializable<org.tribuo.protos.core.OutputDomainProto>

public final class MutableAnomalyInfo extends AnomalyInfo implements MutableOutputInfo<Event>
An MutableOutputInfo object for Events.

Counts the number of Event.EventType.ANOMALOUS, Event.EventType.EXPECTED and Event.EventType.UNKNOWN outputs observed. The unknown output is invalid at training time, and used as a prediction time sentinel (similarly to other Tribuo prediction tasks).

Anomaly detection has a fixed domain, so it will throw IllegalArgumentException if you somehow modify the Event.EventType enum to add a new value.

See Also:
  • Method Details

    • deserializeFromProto

      public static MutableAnomalyInfo deserializeFromProto(int version, String className, com.google.protobuf.Any message) throws com.google.protobuf.InvalidProtocolBufferException
      Deserialization factory.
      Parameters:
      version - The serialized object version.
      className - The class name.
      message - The serialized data.
      Returns:
      The deserialized object.
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - If the protobuf could not be parsed from the message.
    • observe

      public void observe(Event output)
      Description copied from interface: MutableOutputInfo
      Records an output value or statistics thereof.
      Specified by:
      observe in interface MutableOutputInfo<Event>
      Parameters:
      output - The observed output.
    • clear

      public void clear()
      Description copied from interface: MutableOutputInfo
      Clears the OutputInfo, removing all things it's observed.
      Specified by:
      clear in interface MutableOutputInfo<Event>
    • copy

      public MutableAnomalyInfo copy()
      Description copied from interface: OutputInfo
      Generates a copy of this OutputInfo, including it's mutability.
      Specified by:
      copy in interface OutputInfo<Event>
      Specified by:
      copy in class AnomalyInfo
      Returns:
      A copy of the OutputInfo.