<!--
{
  "availability" : [
    "macOS: 10.14.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLRegressor",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML11MLRegressorO"
  },
  "title" : "MLRegressor"
}
-->

# MLRegressor

A model you train to estimate continuous values.

```
enum MLRegressor
```

## Overview

Use an [`MLRegressor`](/documentation/CreateML/MLRegressor) to estimate continuous values like price, time, or temperature.

A regressor differs from a classifier because it can predict output values not seen during the training process. By
contrast, a classifier can only classify input into the categories you provide in the training data.

For example, when estimating housing prices on Mars, a regressor can interpolate between the examples to estimate
prices not seen during training. The figure below shows a linear regressor for Mars real-estate prices similar to
the <doc://com.apple.documentation/documentation/CoreML/integrating-a-core-ml-model-into-your-app> sample.

![A graph showing housing prices for mars with a linear regressor used to create a continuous estimation between](images/com.apple.createml/MLRegressor-1@2x.png)

In this case, there are no data points with three solar panels, but the regressor can make an informed prediction
about the housing price.

When you create an [`MLRegressor`](/documentation/CreateML/MLRegressor), Create ML inspects your data and automatically chooses a specific regressor
(see *Supporting Regressor Types*).

## Topics

### Creating and training a regressor

[`init(trainingData:targetColumn:featureColumns:)`](/documentation/CreateML/MLRegressor/init(trainingData:targetColumn:featureColumns:))

Creates a regressor.

[`targetColumn`](/documentation/CreateML/MLRegressor/targetColumn)

The name of the column you selected at initialization to define which feature the regressor predicts.

[`featureColumns`](/documentation/CreateML/MLRegressor/featureColumns)

The names of the columns you selected at initialization to train the regressor.

### Evaluating a regressor

[`evaluation(on:)`](/documentation/CreateML/MLRegressor/evaluation(on:))

Evaluates the classifier on the provided labeled data.

[`trainingMetrics`](/documentation/CreateML/MLRegressor/trainingMetrics)

Measurements of the regressor’s performance on the training data set.

[`validationMetrics`](/documentation/CreateML/MLRegressor/validationMetrics)

Measurements of the regressor’s performance on the validation data set.

### Testing a regressor

[`predictions(from:)`](/documentation/CreateML/MLRegressor/predictions(from:))

### Saving a regressor

[`write(to:metadata:)`](/documentation/CreateML/MLRegressor/write(to:metadata:))

Exports a Core ML model file for use in your app.

[`write(toFile:metadata:)`](/documentation/CreateML/MLRegressor/write(toFile:metadata:))

Exports a Core ML model file for use in your app.

### Describing a regressor

[`model`](/documentation/CreateML/MLRegressor/model)

The underlying Core ML model stored in memory.

[`description`](/documentation/CreateML/MLRegressor/description)

A text representation of the regressor.

[`debugDescription`](/documentation/CreateML/MLRegressor/debugDescription)

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

[`playgroundDescription`](/documentation/CreateML/MLRegressor/playgroundDescription)

A description of the regressor shown in a playground.

### Regressor cases

[`MLRegressor.linear(_:)`](/documentation/CreateML/MLRegressor/linear(_:))

A regressor that estimates the target as a linear function of the features.

[`MLRegressor.decisionTree(_:)`](/documentation/CreateML/MLRegressor/decisionTree(_:))

A regressor that estimates the target by learning rules to split the data.

[`MLRegressor.boostedTree(_:)`](/documentation/CreateML/MLRegressor/boostedTree(_:))

A regressor based on a collection of decision trees combined with gradient boosting.

[`MLRegressor.randomForest(_:)`](/documentation/CreateML/MLRegressor/randomForest(_:))

A regressor based on a collection of decision trees trained on subsets of the data.

### Supporting regressor types

[`MLLinearRegressor`](/documentation/CreateML/MLLinearRegressor)

A regressor that estimates the target as a linear function of the features.

[`MLDecisionTreeRegressor`](/documentation/CreateML/MLDecisionTreeRegressor)

A regressor that estimates the target by learning rules to split the data.

[`MLRandomForestRegressor`](/documentation/CreateML/MLRandomForestRegressor)

A regressor based on a collection of decision trees trained on subsets of the data.

[`MLBoostedTreeRegressor`](/documentation/CreateML/MLBoostedTreeRegressor)

A regressor based on a collection of decision trees combined with gradient boosting.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)