--- a +++ b/man/conf_matrix_cb.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/callbacks.R +\name{conf_matrix_cb} +\alias{conf_matrix_cb} +\title{Confusion matrix callback.} +\usage{ +conf_matrix_cb(path_tensorboard, run_name, confMatLabels, cm_dir) +} +\arguments{ +\item{path_tensorboard}{Path to tensorboard directory or \code{NULL}. If \code{NULL}, training not tracked on tensorboard.} + +\item{run_name}{Name of the run. Name will be used to identify output from callbacks. If \code{NULL}, will use date as run name. +If name already present, will add \code{"_2"} to name or \code{"_{x+1}"} if name ends with \verb{_x}, where \code{x} is some integer.} + +\item{confMatLabels}{Names of classes.} + +\item{cm_dir}{Directory that contains confusion matrix files.} +} +\value{ +Keras callback, plot confusion matrix in tensorboard. +} +\description{ +Create a confusion matrix to display under tensorboard images. +} +\examples{ +\dontshow{if (reticulate::py_module_available("tensorflow")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +cm <- conf_matrix_cb(path_tensorboard = tempfile(), run_name = 'run_1', + confMatLabels = c('label_1', 'label_2'), cm_dir = tempfile()) +\dontshow{\}) # examplesIf} +}