Package org.tribuo.anomaly
Class AnomalyFactory
java.lang.Object
org.tribuo.anomaly.AnomalyFactory
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>
,Serializable
,OutputFactory<Event>
A factory for generating events.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconstructInfoForExternalModel
(Map<Event, Integer> mapping) Creates anImmutableOutputInfo
from the supplied mapping.Generates the appropriateMutableOutputInfo
so the output values can be tracked by aDataset
or other aggregate.<V> Event
generateOutput
(V label) Parses theV
and generates the appropriateOutput
value.Gets anEvaluator
suitable for measuring performance of predictions for the Output subclass.Returns the singleton unknown output of type T which can be used for prediction time examples.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.OutputFactory
generateOutputs
-
Field Details
-
UNKNOWN_EVENT
The unknown event. Used at inference time. -
EXPECTED_EVENT
The expected event. Used for things which are not anomalous. -
ANOMALOUS_EVENT
The anomalous event. It's anomalous.
-
-
Constructor Details
-
AnomalyFactory
public AnomalyFactory()
-
-
Method Details
-
generateOutput
Description copied from interface:OutputFactory
Parses theV
and generates the appropriateOutput
value.Most implementations call toString on the label before parsing it, but this is not required.
- Specified by:
generateOutput
in interfaceOutputFactory<Event>
- Type Parameters:
V
- The type of the input value.- Parameters:
label
- An input value.- Returns:
- The parsed Output as an instance of
T
.
-
getUnknownOutput
Description copied from interface:OutputFactory
Returns the singleton unknown output of type T which can be used for prediction time examples.- Specified by:
getUnknownOutput
in interfaceOutputFactory<Event>
- Returns:
- An unknown output.
-
generateInfo
Description copied from interface:OutputFactory
Generates the appropriateMutableOutputInfo
so the output values can be tracked by aDataset
or other aggregate.- Specified by:
generateInfo
in interfaceOutputFactory<Event>
- Returns:
- The appropriate subclass of
MutableOutputInfo
initialised to zero.
-
constructInfoForExternalModel
Description copied from interface:OutputFactory
Creates anImmutableOutputInfo
from the supplied mapping. Requires that the mapping is dense in the integers [0,mapping.size()) and each mapping is unique.This call is used to import external models, and should not be used for other purposes.
- Specified by:
constructInfoForExternalModel
in interfaceOutputFactory<Event>
- Parameters:
mapping
- The mapping to use.- Returns:
- The appropriate subclass of
ImmutableOutputInfo
with a single observation of each element.
-
getEvaluator
Description copied from interface:OutputFactory
Gets anEvaluator
suitable for measuring performance of predictions for the Output subclass.Evaluator
instances are thread safe and immutable, and commonly this is a singleton stored in theOutputFactory
implementation.- Specified by:
getEvaluator
in interfaceOutputFactory<Event>
- Returns:
- An evaluator.
-
getProvenance
- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>
-