fitted(to:eventHandler:)
Fits a linear regressor model to a sequence of annotated features.
Declaration
func fitted(to input: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, MLShapedArray<Scalar>>>, eventHandler: EventHandler? = nil) async throws -> MultivariateLinearRegressor<Scalar>.ModelParameters
- input:
A sequence of examples used for fitting the regressor. For faster processing, instead of passing a sequence of shaped arrays, consider passing a single shaped array containing all the training examples. For example instead of passing
Nshaped arrays with shape[M], pass a single shaped array with shape[N, M]. See Fitted(to:validateon:eventhandler:) 82szq. - eventHandler:
An event handler. This method reports mean squared errors.
Return Value
The fitted linear regressor model.