public final class AnomalyFactory extends Object implements OutputFactory<Event>
Modifier and Type | Class and Description |
---|---|
static class |
AnomalyFactory.AnomalyFactoryProvenance
Provenance for
AnomalyFactory . |
Modifier and Type | Field and Description |
---|---|
static Event |
ANOMALOUS_EVENT
The anomalous event.
|
static Event |
EXPECTED_EVENT
The expected event.
|
static Event |
UNKNOWN_EVENT
The unknown event.
|
Constructor and Description |
---|
AnomalyFactory() |
Modifier and Type | Method and Description |
---|---|
ImmutableOutputInfo<Event> |
constructInfoForExternalModel(Map<Event,Integer> mapping)
Creates an
ImmutableOutputInfo from the supplied mapping. |
MutableOutputInfo<Event> |
generateInfo()
Generates the appropriate
MutableOutputInfo so the
output values can be tracked by a Dataset or other
aggregate. |
<V> Event |
generateOutput(V label)
Parses the
V and generates the appropriate Output value. |
Evaluator<Event,AnomalyEvaluation> |
getEvaluator()
Gets an
Evaluator suitable for measuring performance of predictions for the Output subclass. |
OutputFactoryProvenance |
getProvenance() |
Event |
getUnknownOutput()
Returns the singleton unknown output of type T which can be used for prediction time examples.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateOutputs, validateMapping
public static final Event UNKNOWN_EVENT
public static final Event EXPECTED_EVENT
public static final Event ANOMALOUS_EVENT
public <V> Event generateOutput(V label)
OutputFactory
V
and generates the appropriate Output
value.
Most implementations call toString on the label before parsing it, but this is not required.
generateOutput
in interface OutputFactory<Event>
V
- The type of the input value.label
- An input value.T
.public Event getUnknownOutput()
OutputFactory
getUnknownOutput
in interface OutputFactory<Event>
public MutableOutputInfo<Event> generateInfo()
OutputFactory
MutableOutputInfo
so the
output values can be tracked by a Dataset
or other
aggregate.generateInfo
in interface OutputFactory<Event>
MutableOutputInfo
initialised to zero.public ImmutableOutputInfo<Event> constructInfoForExternalModel(Map<Event,Integer> mapping)
OutputFactory
ImmutableOutputInfo
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.
constructInfoForExternalModel
in interface OutputFactory<Event>
mapping
- The mapping to use.ImmutableOutputInfo
with a single observation of each element.public Evaluator<Event,AnomalyEvaluation> getEvaluator()
OutputFactory
Evaluator
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 the OutputFactory
implementation.
getEvaluator
in interface OutputFactory<Event>
public OutputFactoryProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.