check_features {shapr} | R Documentation |
Checks that two extracted feature lists have exactly the same properties
Description
Checks that two extracted feature lists have exactly the same properties
Usage
check_features(f_list_1, f_list_2, use_1_as_truth = T)
Arguments
f_list_1 , f_list_2 |
List. As extracted from either |
use_1_as_truth |
Logical. If TRUE, |
Value
List. The f_list_1
is returned as inserted if there all check are carried out. If some info is
missing from f_list_1
, the function continues consistency checking using f_list_2
and returns that.
Author(s)
Martin Jullum
Examples
# Load example data
if (requireNamespace("MASS", quietly = TRUE)) {
data("Boston", package = "MASS")
# Split data into test- and training data
x_train <- data.table::as.data.table(head(Boston))
x_train[, rad := as.factor(rad)]
data_features <- get_data_specs(x_train)
model <- lm(medv ~ lstat + rm + rad + indus, data = x_train)
model_features <- get_model_specs(model)
check_features(model_features, data_features)
}