This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidymodels) | |
library(rules) | |
tidymodels_prefer() | |
theme_set(theme_bw()) | |
library(doMC) | |
registerDoMC(cores = 20) | |
# ------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suppressPackageStartupMessages(library(tidymodels)) | |
library(furrr) | |
plan(multisession, workers = 20) | |
data(cells) | |
set.seed(1) | |
split <- initial_split(cells, prop = .95) | |
cell_train <- training(split) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidymodels) | |
library(patchwork) | |
library(doMC) | |
registerDoMC(cores = 20) | |
theme_set(theme_bw() + theme(legend.position = "top")) | |
# ------------------------------------------------------------------------------ | |
url <- "https://github.com/topepo/cars/raw/master/2019_07_03_city/car_data_splits.RData" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pak::pak("tidymodels/parsnip@logistic-liblinear") | |
library(AppliedPredictiveModeling) | |
library(tidymodels) | |
theme_set(theme_bw()) | |
# ------------------------------------------------------------------------------ | |
lr_pull <- function(pen, eng = "glmnet", dat, ...) { | |
logistic_reg(penalty = pen, ...) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidymodels) | |
library(plsmod) | |
library(DALEX) | |
theme_set(theme_bw()) | |
## ── Attaching packages ───────────────────────────────── tidymodels 0.1.1 ── | |
## ✓ broom 0.7.0 ✓ recipes 0.1.13 | |
## ✓ dials 0.0.8 ✓ rsample 0.0.7 | |
## ✓ dplyr 1.0.0 ✓ tibble 3.0.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @param x A prepped recipe or fitted workflow that uses a recipe. The recipe | |
#' must have used at least one `step_pca()`. | |
#' @param id A single numeric or character value that is used to pick the step | |
#' with the PCA results. If a single `step_pca()` was used, this argument is | |
#' ignored. *Note*: if used, `id` must be named. | |
#' @param ... An optional series of conditional statements used to filter the | |
#' PCA data before plotting. See Details below. | |
#' @examples | |
#' library(recipes) | |
#' library(parsnip) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ----------------------------------------------------------------------------- | |
# Simple demonstration of stacking using three models with the Ames housing data | |
## ----------------------------------------------------------------------------- | |
library(tidymodels) | |
library(rules) | |
library(doMC) | |
library(AmesHousing) | |
library(ggforce) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidymodels) | |
library(Matrix) | |
library(lobstr) | |
# ------------------------------------------------------------------------------ | |
rand_values <- function (prefix = "step", len = 3, num_vals = Inf) { | |
candidates <- c(letters, LETTERS, paste(0:9)) | |
candidates <- candidates[1:min(length(candidates), num_vals)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(janitor) | |
library(tidymodels) | |
library(plotly) | |
theme_set(theme_bw()) | |
body <- | |
read_csv("http://staff.pubhealth.ku.dk/~tag/Teaching/share/data/Bodyfat.csv") %>% | |
janitor::clean_names() %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(lubridate) | |
# ------------------------------------------------------------------------------ | |
set.seed(2427) | |
hotels <- | |
readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-11/hotels.csv') %>% | |
filter(is_canceled == 0) %>% | |
mutate( |