plot_loss_curve: Plot Neural Network Loss Curve

View source: R/plotting_utils.R

plot_loss_curveR Documentation

Plot Neural Network Loss Curve

Description

Plots the training loss curve of the Neural Network model on the validation set. This plot can be used for underfitting / overfitting diagnostics.

Usage

plot_loss_curve(analysis_object)

Arguments

analysis_object

Fitted analysis_object with 'fine_tuning()'.

Value

analysis_object

Examples


# Note: For obtaining the loss curve plot the user needs to
# complete till the fine_tuning( ) function of the MLwrap pipeline.

if (requireNamespace("torch", quietly = TRUE)) {

  

  wrap_object <- preprocessing(df = sim_data,
                             formula = psych_well ~ depression + emot_intel + resilience,
                             task = "regression")
  wrap_object <- build_model(wrap_object, "Neural Network")
  wrap_object <- fine_tuning(wrap_object, "Bayesian Optimization")

  # And then, you can obtain the loss curve plot.

  plot_loss_curve(wrap_object)

  

}


MLwrap documentation built on Aug. 8, 2025, 6:43 p.m.