Metrics used to evaluate a regressor’s performance.


struct MLRegressorMetrics


To understand how your regressor can be expected to perform, you start by looking at its maximumError. This is a high-level metric indicates your model’s worst case performance. To get an idea for how your model will perform on average, look at the rootMeanSquaredError. In both cases, you want to minimize the value and therefore the error.


Understanding the Model

var maximumError: Double

The largest absolute difference between the expected values and the model's predicted values during testing or training.

var rootMeanSquaredError: Double

A common metric used to determine the deviation between correct and predicted values.

Handling Errors

var isValid: Bool

A Boolean value indicating whether the regressor model was able to calculate metrics.

var error: Error?

The underlying error present when the metrics are invalid.

Creating Metrics

init(maximumError: Double, rootMeanSquaredError: Double)

Creates regressor metrics describing the quality of your model.

Describing Metrics

var description: String

A text representation of the regressor metrics.

var debugDescription: String

A text representation of the regressor metrics that’s suitable for output during debugging.

var playgroundDescription: Any

A description of the regressor metrics shown in a playground.

See Also

Model Accuracy

Improving Your Model’s Accuracy

Use metrics to tune the performance of your machine learning model.

struct MLClassifierMetrics

Metrics used to evaluate a classifier’s performance.