Publications by rstats on Bryan Shalloway's Blog

Riddler Solutions: Pedestrian Puzzles

03.03.2020

Riddler express Riddler classic Appendix Time to center Transform grid, rotate first Transform city, pretty This post contains solutions to FiveThirtyEight’s two riddles released 2020-02-14, Riddler Express and Riddler Classic. I created a toy package animatrixr to help with some of the visualizations and computations for my solutions1. Riddl...

9495 sym R (3887 sym/14 pcs) 20 img 3 tbl

Tidy Pairwise Operations

02.06.2020

Overview I. Nest and pivot II. Expand combinations III. Filter redundancies IV. Map function(s) V. Return to normal dataframe VI. Bind back to data Functionalize Example creating & evaluating features When is this approach inappropriate? Appendix Interactions example, tidymodels Expand via join Nested tibbles Pivot and then summarise Gif for soc...

19592 sym R (8535 sym/22 pcs) 6 img

Tidy Pairwise Operations

02.06.2020

Overview I. Nest and pivot II. Expand combinations III. Filter redundancies IV. Map function(s) V. Return to normal dataframe VI. Bind back to data Functionalize Example creating & evaluating features When is this approach inappropriate? Appendix Interactions example, tidymodels Expand via join Nested tibbles Pivot and then summarise Gif for soc...

17570 sym R (11302 sym/23 pcs) 6 img

Use Flipbooks to Explain Your Code and Thought Process

23.06.2020

Learning R’s %>% Using the pipe operator (%>%) is one of my favorite things about coding in R and the tidyverse. However when it was first shown to me, I couldn’t understand what the #rstats nut describing it was so enthusiastic about. They tried to explain, “It means and then do the next operation.” When that didn’t click for me, they ...

7287 sym 6 img

Use Flipbooks to Explain Your Code and Thought Process

23.06.2020

Learning R’s %>% Using the pipe operator (%>%) is one of my favorite things about coding in R and the tidyverse. However when it was first shown to me, I couldn’t understand what the #rstats nut describing it was so enthusiastic about. They tried to explain, “It means and then do the next operation.” When that didn’t click for me, they ...

7308 sym 6 img

Short Examples of Best Practices When Writing Functions That Call dplyr Verbs

24.06.2020

Function expecting one column Functions allowing multiple columns Older approaches Appendix dplyr, the foundational tidyverse package, makes a trade-off between being easy to code in interactively at the expense of being more difficult to create functions with. The source of the trade-off is in how dplyr evaluates column names (specifically, all...

4753 sym R (1343 sym/17 pcs) 2 img

Short Examples of Best Practices When Writing Functions That Call dplyr Verbs

24.06.2020

Function expecting one column Functions allowing multiple columns Older approaches Appendix dplyr, the foundational tidyverse package, makes a trade-off between being easy to code in interactively at the expense of being more difficult to create functions with. The source of the trade-off is in how dplyr evaluates column names (specifically, all...

4753 sym R (1343 sym/17 pcs) 2 img

Linear Regression in Pricing Analysis, Essential Things to Know

16.08.2020

What influences price? Simple linear regression model Inference and challenges Violation of model assumptions The tug-of-war between colinear inputs Improving model fit, considerations Closing notes and tips Appendix Pricing challenges Future pricing posts Dataset considerations Interpretability of machine learning methods Regularization and...

27627 sym 2 img 3 tbl

Feature Engineering with Sliding Windows and Lagged Inputs

11.10.2020

Load data Feature Engineering & Data Splits Lag Based Features (Before Split, use dplyr or similar) Data Splits Other Features (After Split, use recipes) Model Specification and Training Model Evaluation Appendix Model Building with Hyperparameter Tuning Resources The new rsample::sliding_*() functions bring the windowing approaches used in sli...

14797 sym R (9854 sym/19 pcs) 4 img 1 tbl

Feature Engineering with Sliding Windows and Lagged Inputs

11.10.2020

Load data Feature Engineering & Data Splits Lag Based Features (Before Split, use dplyr or similar) Data Splits Other Features (After Split, use recipes) Model Specification and Training Model Evaluation Appendix Model Building with Hyperparameter Tuning Resources The new rsample::sliding_*() functions bring the windowing approaches used in sli...

14797 sym R (9612 sym/19 pcs) 4 img 1 tbl