Methods for Supervised Filtering of Predictors
OTHER License
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
The goal of filterdb is to ...
You can install the development version of filterdb like so:
require(pak)
pak::pak("topepo/filterdb")
#| results: hide
#| message: false
#| warning: false
library(filterdb)
library(dplyr)
library(modeldata)
data(ames)
ames$Sale_Price <- log10(ames$Sale_Price)
ames_scores <-
importance_metrics(
ames %>% select(-Sale_Price),
y = ames %>% select(Sale_Price),
methods = c("corr_rank", "imp_rf", "max_diff")
)
ames_scores
results <- tidy(ames_scores)
results
head(results$corr_rank)
results %>%
filter(corr_rank < 1/3 & max_diff >= 0.4) %>%
slice_max(imp_rf, n = 5)
Please note that the filterdb project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.