Package org.tribuo.anomaly
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>
An
MutableOutputInfo
object for Event
s.
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:
-
Field Summary
Fields inherited from class org.tribuo.anomaly.AnomalyInfo
anomalyCount, expectedCount, unknownCount
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the OutputInfo, removing all things it's observed.copy()
Generates a copy of this OutputInfo, including it's mutability.static MutableAnomalyInfo
deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.void
Records an output value or statistics thereof.Methods inherited from class org.tribuo.anomaly.AnomalyInfo
equals, generateImmutableOutputInfo, generateMutableOutputInfo, getAnomalyCount, getDomain, getEventCount, getExpectedCount, getUnknownCount, hashCode, outputCountsIterable, serialize, size, toReadableString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tribuo.OutputInfo
generateImmutableOutputInfo, generateMutableOutputInfo, getDomain, getUnknownCount, outputCountsIterable, size, toReadableString
Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
-
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 themessage
.
-
observe
Description copied from interface:MutableOutputInfo
Records an output value or statistics thereof.- Specified by:
observe
in interfaceMutableOutputInfo<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 interfaceMutableOutputInfo<Event>
-
copy
Description copied from interface:OutputInfo
Generates a copy of this OutputInfo, including it's mutability.- Specified by:
copy
in interfaceOutputInfo<Event>
- Specified by:
copy
in classAnomalyInfo
- Returns:
- A copy of the OutputInfo.
-