Metrics used to evaluate a regressor’s performance.


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 metrics were calculated.

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 the Model

var description: String

A text representation of this instance.

var debugDescription: String

A text representation of this instance that’s suitable for output during debugging.

var playgroundDescription: Any

A description of the instance shown in a playground.

See Also

Model Evaluation

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.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software