<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/TimeSeriesClassifier",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents20TimeSeriesClassifierV"
  },
  "title" : "TimeSeriesClassifier"
}
-->

# TimeSeriesClassifier

```
struct TimeSeriesClassifier<Scalar, Label> where Scalar : MLShapedArrayScalar, Scalar : BinaryFloatingPoint, Label : Comparable, Label : Decodable, Label : Encodable, Label : Hashable
```

## Topics

### Creating a time series classifier

[`init(labels: Set<Label>, configuration: TimeSeriesClassifierConfiguration)`](/documentation/CreateMLComponents/TimeSeriesClassifier/init(labels:configuration:))

Creates a time series classifier.

### Inspecting a time series classifier

[`var configuration: TimeSeriesClassifierConfiguration`](/documentation/CreateMLComponents/TimeSeriesClassifier/configuration-swift.property)

The configuration.

[`var labels: Set<Label>`](/documentation/CreateMLComponents/TimeSeriesClassifier/labels)

The set of possible labels.

### Fitting a time series classifier

[`func fitted(to: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, Label>>, eventHandler: EventHandler?) async throws -> TimeSeriesClassifier<Scalar, Label>.Model`](/documentation/CreateMLComponents/TimeSeriesClassifier/fitted(to:eventHandler:))

Fits a time series classifier model to a sequence of examples.

[`func fitted(to: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, Label>>, validateOn: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, Label>>, eventHandler: EventHandler?) async throws -> TimeSeriesClassifier<Scalar, Label>.Model`](/documentation/CreateMLComponents/TimeSeriesClassifier/fitted(to:validateOn:eventHandler:))

Fits a time series classifier model to a sequence of examples.

### Supporting types

[`typealias Configuration`](/documentation/CreateMLComponents/TimeSeriesClassifier/Configuration-swift.typealias)

[`struct Model`](/documentation/CreateMLComponents/TimeSeriesClassifier/Model)

A time-series classifier model.

### Default Implementations

[UpdatableSupervisedEstimator Implementations](/documentation/CreateMLComponents/TimeSeriesClassifier/UpdatableSupervisedEstimator-Implementations)

## Relationships

### Conforms To

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

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

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

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

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

[`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)