Contents

fitted(to:validateOn:eventHandler:)

Fits a linear regressor model to a sequence of examples.

Declaration

func fitted<Input, Validation>(to input: Input, validateOn validation: Validation, eventHandler: EventHandler? = nil) async throws -> LinearRegressorModel<Scalar> where Input : Sequence, Validation : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Scalar>, Validation.Element == AnnotatedFeature<MLShapedArray<Scalar>, Scalar>

Parameters

  • input:

    A sequence of examples used for fitting the regressor.

  • validation:

    A sequence of examples used for validating the fitted regressor.

  • eventHandler:

    An event handler. This method reports maximum error and root-mean-square error metrics.

Return Value

The fitted linear regressor model.

See Also

Fitting