% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{to_categorical}
\alias{to_categorical}
\title{Converts a class vector (integers) to binary class matrix.}
\usage{
to_categorical(y, num_classes = NULL)
}
\arguments{
\item{y}{Class vector to be converted into a matrix (integers from 0 to num_classes).}

\item{num_classes}{Total number of classes.}
}
\value{
A binary matrix representation of the input.
}
\description{
Converts a class vector (integers) to binary class matrix.
}
\details{
E.g. for use with \code{\link[=loss_categorical_crossentropy]{loss_categorical_crossentropy()}}.
}
