Contents

fitted(to:validateOn:eventHandler:)

Fits a linear regressor model to shaped arrays of features and annotations.

Declaration

func fitted(to input: AnnotatedBatch<Scalar>, validateOn validation: AnnotatedBatch<Scalar>?, eventHandler: EventHandler? = nil) async throws -> MultivariateLinearRegressor<Scalar>.Model

Parameters

  • input:

    An annotated batch containing the features and annotations. The last dimension of the features is the model’s input size and the last dimension of the annotations is the model’s output size. All the leading dimensions of the features must match all leading dimensions of the annotations. For example, the feature shape can be [N, X] and the annotation shape can be [N, Y] for N examples where X is the input size and Y is the output size.

  • validation:

    An annotated batch containing the validation features and annotations. The last dimension of the features must be inputSize and the last dimension of the annotations must be outputSize. All the leading dimensions of the features must match all leading dimensions of the annotations.

  • eventHandler:

    An event handler. This method reports the mean squared errors.

Return Value

The fitted model.

See Also

Fitting