Package org.tribuo.regression.evaluation
Class RegressionEvaluator
java.lang.Object
org.tribuo.evaluation.AbstractEvaluator<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context,RegressionEvaluation,RegressionMetric>
org.tribuo.regression.evaluation.RegressionEvaluator
- All Implemented Interfaces:
Evaluator<Regressor,
RegressionEvaluation>
public final class RegressionEvaluator
extends AbstractEvaluator<Regressor,org.tribuo.regression.evaluation.RegressionMetric.Context,RegressionEvaluation,RegressionMetric>
A
Evaluator
for multi-dimensional regression using Regressor
s.
If the dataset contains an unknown Regressor (as generated by RegressionFactory.getUnknownOutput()
)
then the evaluate methods will throw IllegalArgumentException
with an appropriate message.
-
Constructor Summary
ConstructorDescriptionBy default, don't use example weights.RegressionEvaluator
(boolean useExampleWeights) Construct an evaluator. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.tribuo.regression.evaluation.RegressionMetric.Context
createContext
(Model<Regressor> model, List<Prediction<Regressor>> predictions) Create the context needed for evaluation.protected RegressionEvaluation
createEvaluation
(org.tribuo.regression.evaluation.RegressionMetric.Context context, Map<MetricID<Regressor>, Double> results, EvaluationProvenance provenance) Create an evaluation for the given resultsprotected Set<RegressionMetric>
createMetrics
(Model<Regressor> model) Creates the appropriate set of metrics for this model, by querying for it'sOutputInfo
.Methods inherited from class org.tribuo.evaluation.AbstractEvaluator
computeResults, evaluate, evaluate, evaluate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tribuo.evaluation.Evaluator
createOnlineEvaluator, evaluate
-
Constructor Details
-
RegressionEvaluator
public RegressionEvaluator()By default, don't use example weights. -
RegressionEvaluator
public RegressionEvaluator(boolean useExampleWeights) Construct an evaluator.Will weight the examples if requested.
- Parameters:
useExampleWeights
- Set to true to use the example weights to adjust the importance of the predictions.
-
-
Method Details
-
createMetrics
Description copied from class:AbstractEvaluator
Creates the appropriate set of metrics for this model, by querying for it'sOutputInfo
.- Specified by:
createMetrics
in classAbstractEvaluator<Regressor,
org.tribuo.regression.evaluation.RegressionMetric.Context, RegressionEvaluation, RegressionMetric> - Parameters:
model
- The model to inspect.- Returns:
- The set of metrics.
-
createContext
protected org.tribuo.regression.evaluation.RegressionMetric.Context createContext(Model<Regressor> model, List<Prediction<Regressor>> predictions) Description copied from class:AbstractEvaluator
Create the context needed for evaluation. The context might store global properties or cache computation.- Specified by:
createContext
in classAbstractEvaluator<Regressor,
org.tribuo.regression.evaluation.RegressionMetric.Context, RegressionEvaluation, RegressionMetric> - Parameters:
model
- the model that will be evaluatedpredictions
- the predictions that will be evaluated- Returns:
- the context for this model and its predictions
-
createEvaluation
protected RegressionEvaluation createEvaluation(org.tribuo.regression.evaluation.RegressionMetric.Context context, Map<MetricID<Regressor>, Double> results, EvaluationProvenance provenance) Description copied from class:AbstractEvaluator
Create an evaluation for the given results- Specified by:
createEvaluation
in classAbstractEvaluator<Regressor,
org.tribuo.regression.evaluation.RegressionMetric.Context, RegressionEvaluation, RegressionMetric> - Parameters:
context
- the context that was used to compute these resultsresults
- the resultsprovenance
- the provenance of the results (including information about the model and dataset)- Returns:
- the evaluation
-