<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLBoostedTreeClassifier",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML23MLBoostedTreeClassifierV"
  },
  "title" : "MLBoostedTreeClassifier"
}
-->

# MLBoostedTreeClassifier

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

```
struct MLBoostedTreeClassifier
```

## Overview

A boosted tree classifier combines several [`MLDecisionTreeClassifier`](/documentation/CreateML/MLDecisionTreeClassifier) models (a technique known as *ensemble
learning*) by training each model to correct the errors of the preceding model.

This model is useful for handling numerical and categorical features, but is less suitable for sparse data such as
text.

## Topics

### Training a boosted tree classifier asynchronously

[`static train(trainingData:targetColumn:featureColumns:parameters:sessionParameters:)`](/documentation/CreateML/MLBoostedTreeClassifier/train(trainingData:targetColumn:featureColumns:parameters:sessionParameters:))

Trains a boosted tree classifier.

[`static makeTrainingSession(trainingData:targetColumn:featureColumns:parameters:sessionParameters:)`](/documentation/CreateML/MLBoostedTreeClassifier/makeTrainingSession(trainingData:targetColumn:featureColumns:parameters:sessionParameters:))

Creates or restores a training session.

[`static func resume(MLTrainingSession<MLBoostedTreeClassifier>) throws -> MLJob<MLBoostedTreeClassifier>`](/documentation/CreateML/MLBoostedTreeClassifier/resume(_:))

Resumes a training session from the last checkpoint if available.

[`static func restoreTrainingSession(sessionParameters: MLTrainingSessionParameters) throws -> MLTrainingSession<MLBoostedTreeClassifier>`](/documentation/CreateML/MLBoostedTreeClassifier/restoreTrainingSession(sessionParameters:))

Restores an existing training session.

### Creating a boosted tree classifier from a checkpoint

[`init(checkpoint: MLCheckpoint) throws`](/documentation/CreateML/MLBoostedTreeClassifier/init(checkpoint:))

Creates a boosted tree classifier from a checkpoint.

### Training a boosted tree classifier synchronously

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

Creates a boosted tree classifier.

[`var targetColumn: String`](/documentation/CreateML/MLBoostedTreeClassifier/targetColumn)

The name of the column you selected at initialization to define which categories the classifier predicts.

[`var featureColumns: [String]`](/documentation/CreateML/MLBoostedTreeClassifier/featureColumns)

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

### Evaluating a boosted tree classifier

[`func evaluation(on:)`](/documentation/CreateML/MLBoostedTreeClassifier/evaluation(on:))

Evaluates the classifier on the provided labeled data.

[`var trainingMetrics: MLClassifierMetrics`](/documentation/CreateML/MLBoostedTreeClassifier/trainingMetrics)

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

[`var validationMetrics: MLClassifierMetrics`](/documentation/CreateML/MLBoostedTreeClassifier/validationMetrics)

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

### Testing a boosted tree classifier

[`func predictions(from:)`](/documentation/CreateML/MLBoostedTreeClassifier/predictions(from:))

Predicts a column of labels for the given testing data.

### Saving a boosted tree classifier

[`func write(to: URL, metadata: MLModelMetadata?) throws`](/documentation/CreateML/MLBoostedTreeClassifier/write(to:metadata:))

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

[`func write(toFile: String, metadata: MLModelMetadata?) throws`](/documentation/CreateML/MLBoostedTreeClassifier/write(toFile:metadata:))

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

### Inspecting a boosted tree classifier

[`var model: MLModel`](/documentation/CreateML/MLBoostedTreeClassifier/model)

The Core ML model.

[`struct ModelParameters`](/documentation/CreateML/MLBoostedTreeClassifier/ModelParameters-swift.struct)

Parameters that affect the process of training a model.

[`let modelParameters: MLBoostedTreeClassifier.ModelParameters`](/documentation/CreateML/MLBoostedTreeClassifier/modelParameters-swift.property)

The underlying parameters used when training the model.

### Describing a boosted tree classifier

[`var description: String`](/documentation/CreateML/MLBoostedTreeClassifier/description)

A text representation of the boosted tree classifier.

[`var debugDescription: String`](/documentation/CreateML/MLBoostedTreeClassifier/debugDescription)

A text representation of the boosted tree classifier that’s suitable for
output during debugging.

[`var playgroundDescription: Any`](/documentation/CreateML/MLBoostedTreeClassifier/playgroundDescription)

A description of the boosted tree classifier shown in a playground.

### Default Implementations

[CustomDebugStringConvertible Implementations](/documentation/CreateML/MLBoostedTreeClassifier/CustomDebugStringConvertible-Implementations)

[CustomPlaygroundDisplayConvertible Implementations](/documentation/CreateML/MLBoostedTreeClassifier/CustomPlaygroundDisplayConvertible-Implementations)

[CustomStringConvertible Implementations](/documentation/CreateML/MLBoostedTreeClassifier/CustomStringConvertible-Implementations)

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Escapable`](/documentation/Swift/Escapable)

[`Copyable`](/documentation/Swift/Copyable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomPlaygroundDisplayConvertible`](/documentation/Swift/CustomPlaygroundDisplayConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

---

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)