Package org.tribuo.anomaly
Class Event
java.lang.Object
org.tribuo.anomaly.Event
- All Implemented Interfaces:
Serializable
,Output<Event>
An
Output
representing either an Event.EventType.ANOMALOUS
or an
Event.EventType.EXPECTED
event.
Event trainers are allowed to throw IllegalArgumentException if they are supplied
an Event.EventType.ANOMALOUS
at training time. It's noted in the documentation if they
do support training from anomalous and expected data.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEvent
(Event.EventType type) Constructs a new event of the specified type with the default score ofDEFAULT_SCORE
.Event
(Event.EventType type, double score) Constructs a new event of the specified type and score. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Deep copy of the output up to it's immutable state.boolean
boolean
fullEquals
(Event o) Compares other to this output.double
getScore()
Get a real valued score for this label.getSerializableForm
(boolean includeConfidence) Returns "EventType" or "EventType,score=eventScore".getType()
Gets the event type.int
hashCode()
toString()
-
Field Details
-
DEFAULT_SCORE
public static final double DEFAULT_SCOREThe default score of events.- See Also:
-
-
Constructor Details
-
Event
Constructs a new event of the specified type and score.- Parameters:
type
- The event type.score
- The event score.
-
Event
Constructs a new event of the specified type with the default score ofDEFAULT_SCORE
.- Parameters:
type
- The event type.
-
-
Method Details
-
getScore
public double getScore()Get a real valued score for this label.If the score is not set then it returns
DEFAULT_SCORE
.- Returns:
- The predicted score for this label.
-
getType
Gets the event type.- Returns:
- An event type.
-
equals
-
hashCode
public int hashCode() -
fullEquals
Description copied from interface:Output
Compares other to this output. Uses all score values and the strings.- Specified by:
fullEquals
in interfaceOutput<Event>
- Parameters:
o
- Another output instance.- Returns:
- True if the other instance has value equality to this instance. False otherwise.
-
toString
-
copy
Description copied from interface:Output
Deep copy of the output up to it's immutable state. -
getSerializableForm
Returns "EventType" or "EventType,score=eventScore".- Specified by:
getSerializableForm
in interfaceOutput<Event>
- Parameters:
includeConfidence
- Include whatever confidence score the label contains, if known.- Returns:
- A String form suitable for serialization.
-