Contents

fitted(to:eventHandler:)

Fits a model to a sequence of examples.

Declaration

func fitted(to input: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, MLShapedArray<Scalar>>>, eventHandler: EventHandler? = nil) async throws -> LinearTimeSeriesForecaster<Scalar>.Model

Parameters

  • input:

    A sequence of annotated features. Each feature’s shape should be [featureSize] and each annotation’s shape should be [annotationSize]. This method divides the input sequence into windows.

  • eventHandler:

    An event handler.

Return Value

The fitted model.

Discussion

This method uses a sliding window to chunk the input features into features of inputWindowSize elements and annotations of forecastWindowSize elements. If you want to use a different windowing strategy, use fitted(toWindows:eventHandler:).

See Also

Updating and fitting