View source: R/preprocess_data.R
check_features | R Documentation |
Checks that two extracted feature lists have exactly the same properties
check_features(f_list_1, f_list_2, use_1_as_truth = T)
f_list_1, f_list_2 |
List. As extracted from either |
use_1_as_truth |
Logical. If TRUE, |
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.
Martin Jullum
# 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.