Contents

fitted(toWindows:validateOn:eventHandler:)

Fits a model to a sequence of annotated windows with validation.

Declaration

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

Parameters

  • input:

    A sequence of annotated windows. Each window’s shape should be [inputWindowSize, featureSize] and each annotation’s shape should be [forecastWindowSize, annotationSize].

  • validation:

    A sequence of annotated validation windows. The feature and annotation shapes should be the same as the input parameter.

  • eventHandler:

    An event handler.

Return Value

The fitted model.

See Also

Updating and fitting