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>.ModelParameters
- 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]forNexamples whereXis the input size andYis the output size. - validation:
An annotated batch containing the validation features and annotations. The last dimension of the features must be
inputSizeand the last dimension of the annotations must beoutputSize. 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.