Skip to contents

The single unified training entry point. Runs the iterative optimiser declared in the model spec, recording the loss at each epoch and the gradient norm at each step, and returns a trained-model object.

Usage

morie_ml_train(model, x, y, verbose = FALSE)

Arguments

model

A morie_ml_model specification.

x

Predictor matrix or data.frame (numeric columns used).

y

Response vector (0/1 for logistic).

verbose

Print per-epoch progress (default FALSE). Progress can thus be suppressed while warnings/errors are retained.

Value

A morie_ml_fit object (or the untrained spec if model$nofit), carrying weights, loss_path, grad_norm, converged, and the input metadata.

Examples

m <- morie_ml_model("linear", optimizer = "gd", epochs = 100)
fit <- morie_ml_train(m, mtcars[c("hp", "wt")], mtcars$mpg)