Description Usage Arguments Examples
View source: R/logistic-reg-featx.R
Creates a feature extractor function
1 | make_extract_features(x, n_comp = 5)
|
x |
a |
n_comp |
the number of components to keep |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library("dplyr")
library("stats")
data("states")
# assume that the input consists entirely of features, and no NAs
train_x <- states %>%
filter(year < 2010) %>%
select(-starts_with("dv_"), -gwcode, -year) %>%
filter(complete.cases(.))
test_x <- states %>%
filter(year > 2009) %>%
select(-starts_with("dv_"), -gwcode, -year) %>%
filter(complete.cases(.))
featx <- make_extract_features(train_x)
featx(train_x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.