<!--
{
  "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 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components",
      "CreateMLComponents"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents26LinearTimeSeriesForecasterV5ModelV"
  },
  "title" : "LinearTimeSeriesForecaster.Model"
}
-->

# LinearTimeSeriesForecaster.Model

A linear time-series forecasting model.

```
struct Model
```

## Overview> Note: Only `Float` and `Double` are currently supported as the Scalar type.

## Topics

### Inspecting the model

[`var annotationSize: Int`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/annotationSize)

The number of annotations per sample.

[`var bias: MLShapedArray<Scalar>?`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/bias)

The bias coefficients.

[`var featureSize: Int`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/featureSize)

The number of features per sample.

[`var forecastWindowSize: Int`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/forecastWindowSize)

The number of prediction samples.

[`var inputWindowSize: Int`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/inputWindowSize)

The number of input samples.

[`var stride: Int`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/stride)

The number of samples between windows.

[`var weight: MLShapedArray<Scalar>`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/weight)

The linear coefficients.

### Applying the model

[`func applied(to:eventHandler:)`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/applied(to:eventHandler:))

Performs a prediction on a shaped array of features.

[`func applied(toWindow: MLShapedArray<Scalar>, eventHandler: EventHandler?) async throws -> MLShapedArray<Scalar>`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/applied(toWindow:eventHandler:))

Performs a prediction on a window of input features.

### Exporting the model

[`func export(to: URL) throws`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/export(to:))

Exports this transformer as a CoreML model package.

[`func export(to: URL, metadata: ModelMetadata) throws`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/export(to:metadata:))

Exports this transformer as a CoreML model package with user-supplied metadata.

### Default Implementations

[TemporalTransformer Implementations](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/TemporalTransformer-Implementations)

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)