Learn R Programming

ggmlR (version 0.8.1)

ggml_training_history: Training history of a fitted ggml model

Description

Returns the per-epoch loss / accuracy curve recorded during ggml_fit, in a tidy data frame. This is the standard accessor for the loss curve; it works on a raw sequential/functional model or on a fitted parsnip engine object (e.g. from extract_fit_engine()).

Usage

ggml_training_history(object, format = c("wide", "long"), ...)

Value

A data frame (tibble if tibble is installed). Wide columns:

epoch, train_loss, train_accuracy, and

val_loss / val_accuracy when a validation split was used. Returns NULL with a warning if the model has no recorded history (e.g. not yet fitted).

Arguments

object

A fitted ggml_sequential_model, ggml_functional_model or ggmlr_parsnip_model.

format

"wide" (default) returns one row per epoch with one column per metric. "long" returns one row per (epoch, metric) with columns epoch, metric (e.g. "loss"/"accuracy"), split ("train"/"val") and value — convenient for ggplot2 faceting.

...

Unused; for extensibility.

See Also

ggml_model_backend