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
#' Check to see if a repo has remote dependencies. | |
#' @param repos A character vector of repos to query (e.g. `tidyverse/dplyr`). | |
#' @param hard_depend Should only depends and imports be included in the query. | |
#' Using `FALSE` will include suggests and others. | |
#' @details Packages listed in `Config/Needs/*` will not be returned. | |
#' Requires dplyr, pak, and purrr. | |
#' @return A tibble with columns for the repo and any github repos that are | |
#' listed as dependencies. | |
#' @examples | |
#' tests <- paste0("tidymodels/", c("broom", "parsnip", "recipes")) |
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) | |
tidymodels_prefer() | |
theme_set(theme_bw()) | |
library(doMC) | |
registerDoMC(cores = 20) | |
# ------------------------------------------------------------------------------ | |
data(ad_data) |
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)] |