Learn R Programming

MLwrap (version 0.1.0)

plot_loss_curve: 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)

Value

analysis_object

Arguments

analysis_object

Fitted analysis_object with 'fine_tuning()'.

Examples

Run this code

# 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)) {

  # \donttest{

  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)

  # }

}

Run the code above in your browser using DataLab