public class AnomalyMetric extends Object implements EvaluationMetric<Event,org.tribuo.anomaly.evaluation.AnomalyMetric.Context>
EvaluationMetric.Average
Constructor and Description |
---|
AnomalyMetric(MetricTarget<Event> target,
String name,
ToDoubleBiFunction<MetricTarget<Event>,org.tribuo.anomaly.evaluation.AnomalyMetric.Context> impl)
Creates an anomaly detection metric, with a specific name, using the supplied evaluation function.
|
Modifier and Type | Method and Description |
---|---|
double |
compute(org.tribuo.anomaly.evaluation.AnomalyMetric.Context context)
Compute the result of this metric from the input context.
|
org.tribuo.anomaly.evaluation.AnomalyMetric.Context |
createContext(Model<Event> model,
List<Prediction<Event>> predictions)
Creates the context this metric uses to compute it's value.
|
String |
getName()
The name of this metric.
|
MetricTarget<Event> |
getTarget()
The target for this metric instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createContext, getID
public AnomalyMetric(MetricTarget<Event> target, String name, ToDoubleBiFunction<MetricTarget<Event>,org.tribuo.anomaly.evaluation.AnomalyMetric.Context> impl)
target
- The target of the metric (i.e., the event type or an average).name
- The name of the metric.impl
- The implementation function.public double compute(org.tribuo.anomaly.evaluation.AnomalyMetric.Context context)
EvaluationMetric
compute
in interface EvaluationMetric<Event,org.tribuo.anomaly.evaluation.AnomalyMetric.Context>
context
- The context to use.public MetricTarget<Event> getTarget()
EvaluationMetric
getTarget
in interface EvaluationMetric<Event,org.tribuo.anomaly.evaluation.AnomalyMetric.Context>
public String getName()
EvaluationMetric
getName
in interface EvaluationMetric<Event,org.tribuo.anomaly.evaluation.AnomalyMetric.Context>
public org.tribuo.anomaly.evaluation.AnomalyMetric.Context createContext(Model<Event> model, List<Prediction<Event>> predictions)
EvaluationMetric
createContext
in interface EvaluationMetric<Event,org.tribuo.anomaly.evaluation.AnomalyMetric.Context>
model
- The model to use.predictions
- The predictions to use.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.