% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model-explain.R
\name{tr_explain}
\alias{tr_explain}
\title{Explain a clinical prediction model}
\usage{
tr_explain(
  model,
  method = c("permutation", "shap"),
  newdata = NULL,
  observation = 1
)
}
\arguments{
\item{model}{A fitted \code{triageR_model} object from \code{tr_fit()}.}

\item{method}{Character. One of \code{"permutation"} (global variable
importance) or \code{"shap"} (SHAP values for a single prediction).}

\item{newdata}{Optional data frame to explain predictions on. If \code{NULL},
uses the training data.}

\item{observation}{Integer. Row index of the observation to explain,
only used when \code{method = "shap"}. Defaults to 1.}
}
\value{
A \code{triageR_explanation} object (list) containing the explanation
result and a plot.
}
\description{
Generates variable importance or prediction explanations for a fitted
\code{triageR_model}, using the \code{DALEX} framework under the hood.
}
\examples{
\dontrun{
tr_explain(model, method = "permutation")
tr_explain(model, method = "shap", observation = 3)
}
}
