Package org.tribuo.anomaly
Class ImmutableAnomalyInfo
java.lang.Object
org.tribuo.anomaly.AnomalyInfo
org.tribuo.anomaly.ImmutableAnomalyInfo
- All Implemented Interfaces:
Serializable
,Iterable<com.oracle.labs.mlrg.olcut.util.Pair<Integer,
,Event>> ImmutableOutputInfo<Event>
,OutputInfo<Event>
,ProtoSerializable<org.tribuo.protos.core.OutputDomainProto>
An
ImmutableOutputInfo
object for Event
s.
The ids are predefined for Event
in the Event class itself.
- 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 TypeMethodDescriptioncopy()
Generates a copy of this OutputInfo, including it's mutability.static ImmutableAnomalyInfo
deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.boolean
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.int
Return the id number associated with this output, or -1 if the output is unknown.getOutput
(int id) Returns the output associated with this id, or null if the id is unknown.long
Returns the total number of observed outputs seen by this ImmutableOutputInfo.iterator()
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 java.lang.Iterable
forEach, spliterator
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 ImmutableAnomalyInfo 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
.
-
getID
Description copied from interface:ImmutableOutputInfo
Return the id number associated with this output, or -1 if the output is unknown.- Specified by:
getID
in interfaceImmutableOutputInfo<Event>
- Parameters:
output
- An output- Returns:
- A non-negative integer if the output is known, or -1 if the output is unknown.
-
getOutput
Description copied from interface:ImmutableOutputInfo
Returns the output associated with this id, or null if the id is unknown.- Specified by:
getOutput
in interfaceImmutableOutputInfo<Event>
- Parameters:
id
- A non-negative integer.- Returns:
- An output object or null if it's unknown.
-
getTotalObservations
public long getTotalObservations()Description copied from interface:ImmutableOutputInfo
Returns the total number of observed outputs seen by this ImmutableOutputInfo.- Specified by:
getTotalObservations
in interfaceImmutableOutputInfo<Event>
- Returns:
- The number of observed outputs.
-
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.
-
iterator
-
domainAndIDEquals
Description copied from interface:ImmutableOutputInfo
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.
- Specified by:
domainAndIDEquals
in interfaceImmutableOutputInfo<Event>
- Parameters:
other
- The output info to compare.- Returns:
- True if the domains and ids are the same.
-