---
title: "applied(to:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/lineartimeseriesforecaster/model/applied(to:eventhandler:)"
---

# applied(to:eventHandler:)

Performs a prediction on a shaped array of features.

## Declaration

```swift
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

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 property.

## Discussion

Discussion This method uses a sliding window to chunk the input features into inputWindowSize elements every stride elements. If you want to use a different windowing strategy, use applied(toWindow:eventHandler:).

## See Also

### Applying the model

- [applied(toWindow:eventHandler:)](createmlcomponents/lineartimeseriesforecaster/model/applied(towindow:eventhandler:).md)
