Learn R Programming

SEMdeep (version 1.1.1)

trainingReport: Training history evaluation of a DNN model

Description

Display a (r,c) panel history plot from SEMdnn() output, with x = number of epochs, y = training loss for each MLP model and bootstrap sample, if nboot > 0.

Usage

trainingReport(object, size = NULL, r = 2, c = 2, ...)

Value

Invisibly returns a data.frame of the training loss history.

Arguments

object

A model fitting object from SEMdnn() function.

size

number of the multiple plots (default, size = NULL: all training MLP for each bootstrap sample are visualized).

r

number of rows of the plot layout (default, r = 2).

c

number of columns of the plot layout (default, c = 2).

...

Currently ignored.

Author

Mario Grassi mario.grassi@unipv.it

Details

The training history plot can provide an indication about the training of the model, such as: (i) its speed of convergence over epochs (slope), (ii) whether the model may have already converged (plateau of the line), (iii) whether the mode may be over-learning the training data (inflection for validation line), and more.

Examples

Run this code

# \donttest{
if (torch::torch_is_installed()){

# Load Sachs data (pkc)
ig<- sachs$graph
data<- sachs$pkc
data<- transformData(data)$data
group<- sachs$group

#...with train-test (0.5-0.5) samples
set.seed(123)
train<- sample(1:nrow(data), 0.5*nrow(data))

dnn <- SEMdnn(ig, data[train, ], algo = "layerwise",
              hidden = 10, link = "relu", loss = "mse",
              validation = 0.2, nboot = 0, epochs = 32)

tr <- trainingReport(dnn); tr
}
# }

Run the code above in your browser using DataLab