<!--
{
  "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/applied(to:eventHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents26LinearTimeSeriesForecasterV5ModelV7applied2to12eventHandler6CoreML13MLShapedArrayVyxGAL_yAA5EventVYbcSgtYaKF::OverloadGroup"
  },
  "title" : "applied(to:eventHandler:)"
}
-->

# applied(to:eventHandler:)

Performs a prediction on a shaped array of features.

```
func applied(to input: MLShapedArray<Scalar>, eventHandler: EventHandler? = nil) async throws -> MLShapedArray<Scalar>
```

## Parameters

`input`

An shaped array of features. The shape must be `[N, featureSize]` where `N` is the length of the
sequence, which must be at least `inputWindowSize`.

`eventHandler`

An event handler.

## Return Value

A shaped array of predictions with shape `[M, forecastWindowSize, annotationSize]` where `M`
is the number of predictions based on the input sequence length and the [`stride`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/stride) property.

## Discussion

This method uses a sliding window to chunk the input features into [`inputWindowSize`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/inputWindowSize) elements every
[`stride`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/stride) elements. If you want to use a different windowing strategy, use
[`applied(toWindow:eventHandler:)`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/Model/applied(toWindow:eventHandler:)).

---

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)