<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/TreeClassifierModel",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents19TreeClassifierModelV"
  },
  "title" : "TreeClassifierModel"
}
-->

# TreeClassifierModel

A trained tree classifier model.

```
struct TreeClassifierModel<Label> where Label : Hashable
```

## Topics

### Getting the properties

[`var classCount: Int`](/documentation/CreateMLComponents/TreeClassifierModel/classCount)

The number of classes.

[`var featureColumnNames: [String]`](/documentation/CreateMLComponents/TreeClassifierModel/featureColumnNames)

The names of the columns containing feature values.

[`var predictionColumnName: String`](/documentation/CreateMLComponents/TreeClassifierModel/predictionColumnName)

The name of the column containing the predicted labels.

### Building a data frame

[`func buildDataFrame([ClassificationDistribution<Label>]) -> DataFrame`](/documentation/CreateMLComponents/TreeClassifierModel/buildDataFrame(_:))

Builds a data frame containing a labels column and a probability distribution column.

### Applying

[`func applied(to: DataFrame, eventHandler: EventHandler?) async throws -> DataFrame`](/documentation/CreateMLComponents/TreeClassifierModel/applied(to:eventHandler:))

Performs a classification on a data frame.

## Relationships

### Conforms To

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

[`Transformer`](/documentation/CreateMLComponents/Transformer)

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

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

[`TabularTransformer`](/documentation/CreateMLComponents/TabularTransformer)

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

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

---

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)