Blog Archives

pcLasso: a new method for sparse regression

January 13, 2019
By
pcLasso: a new method for sparse regression

I’m excited to announce that my first package has been accepted to CRAN! The package pcLasso implements principal components lasso, a new method for sparse regression which I’ve developed with Rob Tibshirani and Jerry Friedman. In this post, I will … Continue reading →

Read more »

A deep dive into glmnet: offset

January 9, 2019
By
A deep dive into glmnet: offset

I’m writing a series of posts on various function options of the glmnet function (from the package of the same name), hoping to give more detail and insight beyond R’s documentation. In this post, we will look at the offset … Continue reading →

Read more »

Using emojis as scatterplot points

December 27, 2018
By
Using emojis as scatterplot points

Recently I wanted to learn how to use emojis as points in a scatterplot points. It seems like the emojifont package is a popular way to do it. However, I couldn’t seem to get it to work on my machine … Continue reading →

Read more »

All the (NBA) box scores you ever wanted

December 18, 2018
By
All the (NBA) box scores you ever wanted

In this previous post, I showed how one can scrape top-level NBA game data from BasketballReference.com. In the post after that, I demonstrated how to scrape play-by-play data for one game. After writing those posts, I thought to myself: why … Continue reading →

Read more »

Recreating the NBA lead tracker graphic

December 13, 2018
By
Recreating the NBA lead tracker graphic

For each NBA game, nba.com has a really nice graphic which tracks the point differential between the two teams throughout the game. Here is the lead tracker graphic for the game between the LA Clippers and the Phoenix Suns on … Continue reading →

Read more »

Scraping NBA game data from basketball-reference.com

December 11, 2018
By
Scraping NBA game data from basketball-reference.com

I’m a casual NBA fan: I don’t have time to watch the games but enjoy viewing the highlights on Instagram/Youtube (especially Shaqtin’ A Fool!); I sometimes read game articles and analyses (e.g. Blogtable). Apart from the game being an amazing … Continue reading →

Read more »

A deep dive into glmnet: standardize

November 15, 2018
By
A deep dive into glmnet: standardize

I’m writing a series of posts on various function options of the glmnet function (from the package of the same name), hoping to give more detail and insight beyond R’s documentation. In this post, we will focus on the standardize … Continue reading →

Read more »

A deep dive into glmnet: penalty.factor

November 13, 2018
By
A deep dive into glmnet: penalty.factor

The glmnet function (from the package of the same name) is probably the most used function for fitting the elastic net model in R. (It also fits the lasso and ridge regression, since they are special cases of elastic net.) … Continue reading →

Read more »

Getting started Stamen maps with ggmap

October 25, 2018
By
Getting started Stamen maps with ggmap

Spatial visualizations really come to life when you have a real map as a background. In R, ggmap is the package that you’ll want to use to get these maps. In what follows, we’ll demonstrate how to use ggmap with … Continue reading →

Read more »

Obtaining the number of components from cross validation of principal components regression

October 14, 2018
By
Obtaining the number of components from cross validation of principal components regression

Principal components (PC) regression is a common dimensionality reduction technique in supervised learning. The R lab for PC regression in James et al.’s Introduction to Statistical Learning is a popular intro for how to perform PC regression in R: it is … Continue reading →

Read more »

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)