% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/EvaluateCrcBiomeScreen.R
\name{EvaluateCrcBiomeScreen}
\alias{EvaluateCrcBiomeScreen}
\title{Evaluate the performance of model predictions}
\usage{
EvaluateCrcBiomeScreen(
  predictions,
  true_labels,
  TrueLabel = NULL,
  TaskName = "ModelEvaluation",
  PlotAUC = FALSE,
  outdir = tempdir()
)
}
\arguments{
\item{predictions}{A data frame or matrix of model predictions, typically
containing probability scores for each class.}

\item{true_labels}{A character vector or factor of the true class labels.}

\item{TrueLabel}{The positive class label, for example \code{"CRC"}, used for
ROC-AUC calculation and threshold-based classification.}

\item{TaskName}{A character string used to label the output files.}

\item{PlotAUC}{A logical value indicating whether to plot the ROC curve.}

\item{outdir}{The output directory where plots will be saved. The default is
\code{tempdir()}.}
}
\value{
A list containing prediction probabilities, ROC curve, AUC, F1 score,
balanced accuracy, precision, recall, confusion matrix, and predicted
classes.
}
\description{
This function evaluates classification performance from prediction
probabilities and true labels. It is designed for evaluating predictions
generated by \code{PredictCrcBiomeScreen()} or other external prediction
workflows.
}
\details{
The output structure is aligned with the evaluation results produced by
\code{EvaluateModel()}, including ROC-AUC, F1 score, balanced accuracy,
precision, recall, and the confusion matrix.
}
\examples{
# Fake prediction probabilities for 4 samples and 2 classes
pred <- data.frame(
  control = c(0.8, 0.3, 0.7, 0.2),
  CRC     = c(0.2, 0.7, 0.3, 0.8)
)

# True class labels
labels <- factor(c("control", "CRC", "control", "CRC"))

# Evaluate performance using CRC as the positive class
result <- EvaluateCrcBiomeScreen(
  predictions = pred,
  true_labels = labels,
  TrueLabel = "CRC",
  PlotAUC = FALSE
)

result$AUC
result$BalancedAccuracy
result$conf.matrix
}
