conf_matrix_cb: Confusion matrix callback.

View source: R/callbacks.R

conf_matrix_cbR Documentation

Confusion matrix callback.

Description

Create a confusion matrix to display under tensorboard images.

Usage

conf_matrix_cb(path_tensorboard, run_name, confMatLabels, cm_dir)

Arguments

path_tensorboard

Path to tensorboard directory or NULL. If NULL, training not tracked on tensorboard.

run_name

Name of the run. Name will be used to identify output from callbacks. If NULL, will use date as run name. If name already present, will add "_2" to name or "_{x+1}" if name ends with ⁠_x⁠, where x is some integer.

confMatLabels

Names of classes.

cm_dir

Directory that contains confusion matrix files.

Value

Keras callback, plot confusion matrix in tensorboard.

Examples


cm <- conf_matrix_cb(path_tensorboard = tempfile(), run_name = 'run_1',
                     confMatLabels = c('label_1', 'label_2'), cm_dir = tempfile())


GenomeNet/deepG documentation built on Dec. 24, 2024, 12:11 p.m.