[R] Allow passing data.frame to SHAP (#10744)

This commit is contained in:
david-cortes
2024-09-02 13:44:12 +02:00
committed by GitHub
parent ec8cfb3267
commit f52f11e1d7
5 changed files with 101 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ xgb.plot.shap(
)
}
\arguments{
\item{data}{The data to explain as a \code{matrix} or \code{dgCMatrix}.}
\item{data}{The data to explain as a \code{matrix}, \code{dgCMatrix}, or \code{data.frame}.}
\item{shap_contrib}{Matrix of SHAP contributions of \code{data}.
The default (\code{NULL}) computes it from \code{model} and \code{data}.}

View File

@@ -30,7 +30,7 @@ xgb.plot.shap.summary(
)
}
\arguments{
\item{data}{The data to explain as a \code{matrix} or \code{dgCMatrix}.}
\item{data}{The data to explain as a \code{matrix}, \code{dgCMatrix}, or \code{data.frame}.}
\item{shap_contrib}{Matrix of SHAP contributions of \code{data}.
The default (\code{NULL}) computes it from \code{model} and \code{data}.}