public class LabelMetric extends Object implements EvaluationMetric<Label,LabelMetric.Context>
Modifier and Type | Class and Description |
---|---|
static class |
LabelMetric.Context
The context for a
LabelMetric is a ConfusionMatrix . |
EvaluationMetric.Average
Constructor and Description |
---|
LabelMetric(MetricTarget<Label> tgt,
String name,
ToDoubleBiFunction<MetricTarget<Label>,LabelMetric.Context> impl)
Construct a new
LabelMetric for the supplied metric target,
using the supplied function. |
Modifier and Type | Method and Description |
---|---|
double |
compute(LabelMetric.Context context)
Compute the result of this metric from the input context.
|
LabelMetric.Context |
createContext(Model<Label> model,
List<Prediction<Label>> predictions)
Creates the context this metric uses to compute it's value.
|
boolean |
equals(Object o) |
String |
getName()
The name of this metric.
|
MetricTarget<Label> |
getTarget()
The target for this metric instance.
|
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createContext, getID
public LabelMetric(MetricTarget<Label> tgt, String name, ToDoubleBiFunction<MetricTarget<Label>,LabelMetric.Context> impl)
LabelMetric
for the supplied metric target,
using the supplied function.tgt
- The metric target.name
- The name of the metric.impl
- The implementing function.public double compute(LabelMetric.Context context)
EvaluationMetric
compute
in interface EvaluationMetric<Label,LabelMetric.Context>
context
- The context to use.public MetricTarget<Label> getTarget()
EvaluationMetric
getTarget
in interface EvaluationMetric<Label,LabelMetric.Context>
public String getName()
EvaluationMetric
getName
in interface EvaluationMetric<Label,LabelMetric.Context>
public LabelMetric.Context createContext(Model<Label> model, List<Prediction<Label>> predictions)
EvaluationMetric
createContext
in interface EvaluationMetric<Label,LabelMetric.Context>
model
- The model to use.predictions
- The predictions to use.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.