% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_explain.R
\name{tabnet_explain}
\alias{tabnet_explain}
\alias{tabnet_explain.default}
\alias{tabnet_explain.tabnet_fit}
\alias{tabnet_explain.tabnet_pretrain}
\alias{tabnet_explain.model_fit}
\title{Interpretation metrics from a TabNet model}
\usage{
tabnet_explain(object, new_data)

\method{tabnet_explain}{default}(object, new_data)

\method{tabnet_explain}{tabnet_fit}(object, new_data)

\method{tabnet_explain}{tabnet_pretrain}(object, new_data)

\method{tabnet_explain}{model_fit}(object, new_data)
}
\arguments{
\item{object}{a TabNet fit object}

\item{new_data}{a data.frame to obtain interpretation metrics.}
}
\value{
Returns a list with
\itemize{
\item \code{M_explain}: the aggregated feature importance masks as detailed in
TabNet's paper.
\item \code{masks} a list containing the masks for each step.
}
}
\description{
Interpretation metrics from a TabNet model
}
\examples{
\dontshow{if (torch::torch_is_installed()) withAutoprint(\{ # examplesIf}

set.seed(2021)

n <- 256
x <- data.frame(
  x = rnorm(n),
  y = rnorm(n),
  z = rnorm(n)
)

y <- x$x

fit <- tabnet_fit(x, y, epochs = 10,
                  num_steps = 1,
                  batch_size = 512,
                  attention_width = 1,
                  num_shared = 1,
                  num_independent = 1)


 ex <- tabnet_explain(fit, x)

\dontshow{\}) # examplesIf}
}
