Class RegressionMetric
java.lang.Object
org.tribuo.regression.evaluation.RegressionMetric
- All Implemented Interfaces:
- EvaluationMetric<Regressor, org.tribuo.regression.evaluation.RegressionMetric.Context>
public class RegressionMetric
extends Object
implements EvaluationMetric<Regressor, org.tribuo.regression.evaluation.RegressionMetric.Context>
A 
EvaluationMetric for Regressors which calculates the metric based on a
 the true values and the predicted values.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.tribuo.evaluation.metrics.EvaluationMetricEvaluationMetric.Average
- 
Constructor SummaryConstructorsConstructorDescriptionRegressionMetric(MetricTarget<Regressor> tgt, String name, ToDoubleBiFunction<MetricTarget<Regressor>, org.tribuo.regression.evaluation.RegressionMetric.Context> impl) Construct a newRegressionMetricfor 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 newRegressionMetricfor the supplied metric target, using the supplied function.
- 
Method SummaryModifier and TypeMethodDescriptiondoublecompute(org.tribuo.regression.evaluation.RegressionMetric.Context context) Compute the result of this metric from the input context.org.tribuo.regression.evaluation.RegressionMetric.ContextcreateContext(Model<Regressor> model, List<Prediction<Regressor>> predictions) Creates the context this metric uses to compute it's value.getName()The name of this metric.The target for this metric instance.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tribuo.evaluation.metrics.EvaluationMetriccreateContext, getID
- 
Constructor Details- 
RegressionMetricpublic RegressionMetric(MetricTarget<Regressor> tgt, String name, ToDoubleBiFunction<MetricTarget<Regressor>, org.tribuo.regression.evaluation.RegressionMetric.Context> impl) Construct a newRegressionMetricfor the supplied metric target, using the supplied function. This does not use example weights.- Parameters:
- tgt- The metric target.
- name- The name of the metric.
- impl- The implementing function.
 
- 
RegressionMetricpublic RegressionMetric(MetricTarget<Regressor> tgt, String name, ToDoubleBiFunction<MetricTarget<Regressor>, org.tribuo.regression.evaluation.RegressionMetric.Context> impl, boolean useExampleWeights) Construct a newRegressionMetricfor the supplied metric target, using the supplied function.- Parameters:
- 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.
 
 
- 
- 
Method Details- 
computepublic double compute(org.tribuo.regression.evaluation.RegressionMetric.Context context) Description copied from interface:EvaluationMetricCompute the result of this metric from the input context.- Specified by:
- computein interface- EvaluationMetric<Regressor, org.tribuo.regression.evaluation.RegressionMetric.Context>
- Parameters:
- context- The context to use.
- Returns:
- The value of the metric.
 
- 
getTargetDescription copied from interface:EvaluationMetricThe target for this metric instance.- Specified by:
- getTargetin interface- EvaluationMetric<Regressor, org.tribuo.regression.evaluation.RegressionMetric.Context>
- Returns:
- The metric target.
 
- 
getNameDescription copied from interface:EvaluationMetricThe name of this metric.- Specified by:
- getNamein interface- EvaluationMetric<Regressor, org.tribuo.regression.evaluation.RegressionMetric.Context>
- Returns:
- The name.
 
- 
createContextpublic org.tribuo.regression.evaluation.RegressionMetric.Context createContext(Model<Regressor> model, List<Prediction<Regressor>> predictions) Description copied from interface:EvaluationMetricCreates the context this metric uses to compute it's value.- Specified by:
- createContextin interface- EvaluationMetric<Regressor, org.tribuo.regression.evaluation.RegressionMetric.Context>
- Parameters:
- model- The model to use.
- predictions- The predictions to use.
- Returns:
- The metric context.
 
 
-