GISRUK II: Spatially-Encouraged Spectral Clustering

Apr 4, 2018 - 2 minutes
This paper culminates a bit of work I’ve started on since seeing a talk by Phil Chodrow on a paper that eventually became his quite interesting NAS paper paper on segregation and entropy surfaces. I was intrigued by the prospect of using spectral clustering for constrained clustering problems. Specifically, I’d known that affinity matrix clustering could be adapted to constrained contexts ever since reading about hierarchical ward clustering, but I hadn’t seen a really convincing method that showed me how I could work this out for a general affinity-matrix clustering method. Read more ...

Mpl Is Just Fine

Mar 18, 2018 - 1 minutes
I’ve been using matplotlib for nearly 5 years at least once a week. I’m still learning things that exist within the pylab interface… not the most ideal UX. For instance, I just learned about plt.axvline, which I could use to draw vertical lines in my code instead of what I usually use, plt.vlines(coordinate_list, *plt.gca().get_ylim()), but it’s not as general as plt.vlines since it actually plots a rectangle. Still, though, for most of what I do (which is a single vertical line for drawing specific axes/time breaks in a plot) it’s easier. Read more ...

Annoscatter

Mar 12, 2018 - 1 minutes
I found this function super useful in my dissertation and more generally in my work. What it does is take x,y coordinates and a set of strings and annotates a scatterplot using those labels. For example, here’s a figure from my dissertation where I use it to annotate a plot of regression leverage by year. I jitter the points a little to provide legibility to the text labels, but basically it’s just a call like annoscatter(df. Read more ...