% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nmfkc.R
\name{nmfkc.class}
\alias{nmfkc.class}
\title{Create a class (one-hot) matrix from a categorical vector}
\usage{
nmfkc.class(x)
}
\arguments{
\item{x}{A categorical vector or a factor.}
}
\value{
A binary matrix with one row per unique category and one column per observation. Each column has exactly one entry equal to 1, indicating the category of the observation.
}
\description{
\code{nmfkc.class} converts a categorical or factor vector into a class matrix
(one-hot encoded representation), where each row corresponds to a category
and each column corresponds to an observation.
}
\examples{
# Example.
Y <- nmfkc.class(iris$Species)
Y[,1:6]
}
\seealso{
\code{\link{nmfkc}}
}
