get_data_specs | R Documentation |
Fetches feature information from a given data set
get_data_specs(x)
x |
data.frame or data.table. The data to extract feature information from. |
This function is used to extract the feature information to be checked against the corresponding information extracted from the model and other data sets. The function is only called internally
A list with the following elements:
character vector with the feature names to compute Shapley values for
a named character vector with the labels as names and the class types as elements
a named list with the labels as names and character vectors with the factor levels as elements (NULL if the feature is not a factor)
Martin Jullum
# Load example data
## Not run:
data("airquality")
airquality <- airquality[complete.cases(airquality), ]
# Split data into test- and training data
x_train <- head(airquality, -3)
x_explain <- tail(airquality, 3)
# Split data into test- and training data
x_train <- data.table::as.data.table(head(airquality))
x_train[, Temp := as.factor(Temp)]
shapr:::get_data_specs(x_train)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.