get_data_classes | R Documentation |
When predicting from a model, it is often important for the new_data
to
have the same classes as the original data used to fit the model.
get_data_classes()
extracts the classes from the original training data.
get_data_classes(data)
data |
A data frame or matrix. |
A named list. The names are the column names of data
and the values are
character vectors containing the class of that column.
get_data_classes(iris)
get_data_classes(as.matrix(mtcars))
# Unlike .MFclass(), the full class
# vector is returned
data <- data.frame(col = ordered(c("a", "b")))
.MFclass(data$col)
get_data_classes(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.