public class RegressionMetric extends Object implements EvaluationMetric<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context>
EvaluationMetric
for Regressor
s which calculates the metric based on a
the true values and the predicted values.EvaluationMetric.Average
Constructor and Description |
---|
RegressionMetric(MetricTarget<Regressor> tgt,
String name,
ToDoubleBiFunction<MetricTarget<Regressor>,org.tribuo.regression.evaluation.RegressionMetric.Context> impl)
Construct a new
RegressionMetric for the supplied metric target,
using the supplied function. |
RegressionMetric(MetricTarget<Regressor> tgt,
String name,
ToDoubleBiFunction<MetricTarget<Regressor>,org.tribuo.regression.evaluation.RegressionMetric.Context> impl,
boolean useExampleWeights)
Construct a new
RegressionMetric for the supplied metric target,
using the supplied function. |
Modifier and Type | Method and Description |
---|---|
double |
compute(org.tribuo.regression.evaluation.RegressionMetric.Context context)
Compute the result of this metric from the input context.
|
org.tribuo.regression.evaluation.RegressionMetric.Context |
createContext(Model<Regressor> model,
List<Prediction<Regressor>> predictions)
Creates the context this metric uses to compute it's value.
|
String |
getName()
The name of this metric.
|
MetricTarget<Regressor> |
getTarget()
The target for this metric instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createContext, getID
public RegressionMetric(MetricTarget<Regressor> tgt, String name, ToDoubleBiFunction<MetricTarget<Regressor>,org.tribuo.regression.evaluation.RegressionMetric.Context> impl)
RegressionMetric
for the supplied metric target,
using the supplied function. This does not use example weights.tgt
- The metric target.name
- The name of the metric.impl
- The implementing function.public RegressionMetric(MetricTarget<Regressor> tgt, String name, ToDoubleBiFunction<MetricTarget<Regressor>,org.tribuo.regression.evaluation.RegressionMetric.Context> impl, boolean useExampleWeights)
RegressionMetric
for the supplied metric target,
using the supplied function.tgt
- The metric target.name
- The name of the metric.impl
- The implementing function.useExampleWeights
- If true then the example weights are used to scale the example importance.public double compute(org.tribuo.regression.evaluation.RegressionMetric.Context context)
EvaluationMetric
compute
in interface EvaluationMetric<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context>
context
- The context to use.public MetricTarget<Regressor> getTarget()
EvaluationMetric
getTarget
in interface EvaluationMetric<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context>
public String getName()
EvaluationMetric
getName
in interface EvaluationMetric<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context>
public org.tribuo.regression.evaluation.RegressionMetric.Context createContext(Model<Regressor> model, List<Prediction<Regressor>> predictions)
EvaluationMetric
createContext
in interface EvaluationMetric<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context>
model
- The model to use.predictions
- The predictions to use.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.