Levels of Abstraction in Django

by on July 1, 2014 in Uncategorized

I’m currently building an forecasting tool using Django, which has led to some interesting explorations of the levels of abstractions Django uses.

The nice thing about Django is it provides multiple levels of abstraction, depending on level of complexity and need for performance.

You can filtering and fetch related objects natively in Django with less clunkiness that SQL WHERE and JOIN clauses. You can append SQL clauses to a Django query with raw() and extra(). Or you can just drop into straight SQL where necessary.

The programmer’s task, then, is to figure out which level of abstraction is appropriate, in order to use the right toolkit.

For each use case, we’ll ask, in essence, whether the screwdriver in our pocket is going to work — or whether we have to walk to our car and lug out the power drill.

Continue reading

Guest post over at Ribbonfarm

by on December 5, 2013 in Uncategorized

In addition to this blog, I’m guest blogging over at Ribbonfarm; Venkat just published my first post, Algorithmic Governance and the Ghost in the Machine. Hopefully the community over there can further stir the juices.

The piece explores a distinction that I’ve been mulling over for a while about the legibility — basically, opacity or transparency from the outside — of data science vs. economics algorithms.

Data science-y algorithms are often pretty opaque (think Google search) where economics-y algorithms are usually pretty transparent (think of the kidney-matching algorithms pioneered by Roth et al.).

Bridging Economics and Data Science

by on August 12, 2013 in Undergraduate

As a Stanford undergraduate, I decided to major in economics because clever uses of data were always in the air.

One of my professors hand-classified 10,000 records from a 19th century industrial fair, finding an incredible story about how patent laws influenced the course of European tech innovation. A classic paper in the field constructed a 10,000-year time-series of lighting efficiency (watts/lumen) as an alternate estimate of GDP growth.

After reading enough papers, I realized something: the key to success is in cleverly selecting, finding, or creating a data source that answers a particular question.

Afterwards, econometric tools (regression, etc) are used, to squeeze statistical significance out of a relatively small, standardized data set. Reinhard and Rogoff performed their now-infamous analysis in an Excel spreadsheet.

When I graduated, the questions had changed, but the fundamental tools of analysis remained constant.

Continue reading