Articles
-
Rothko: A Set of Color Palettes for R
March 3, 2021
Rothko is a set of color palettes for R in the form of an R package. It follows directly from Karthik Ram’s wesanderson package, but instead using color palettes derived from Mark Rothko’s paintings. I did this with ImageMagick, but there’s many websites out there that will do the same thing.
It’s simple to install, and has options for both continuous and discrete data. Install it using
devtools::install_github("mmerrittsmith/rothko")
.The palettes are named after the paintings they are derived from, and this leads to some having rather long names like “Violet, Black, Orange, Yellow on White and Red”. Others are named simply “Unitled 1949”. My personal favorites are shown below.
rothko_palette("Number 10")
rothko_palette("Light Cloud, Dark Cloud")
rothko_palette("Number 16")
You can use these palettes in the same way that you would use any palette in R, for example as an argument to
scale_fill_gradientn
. -
George H. Bush:Mikhail Gorbachev :: Magnus Carlsen:Fabiano Caruana
December 15, 2018
Chess for geopolitics is an overworked metaphor. It seems to be capturing the way in which geopolitics is a game played by the people in high towers, combining a war from the tactictal to the operational to the strategic with a staring contest between two equavalently equipped opponents. Leaving aside the many aspects of geopolitics that are emphatically not well reflected in chess, I don’t find even these aspects to be universally available in geopolitics. However, in the specific case of the Cold War, maybe it’s not so bad.
-
Partial Dependence Plots in Python
December 2, 2018
In writing my undergrad thesis on wealth inequality and using various techniques for predicting it, I found myself disappointed that there was no simple method in Python’s scikit-learn to generate partial dependence plots for random forests. The ability to create partial dependence plots for gradient boosted regressors exists, so why not for random forests, or anything else for that matter? In this post, I’ll discuss partial dependence plots, what they are, how they’re useful in ensemble methods, and dive into the state of the art for partial dependence plots in Python.