conference talk

Did Big Data Fail Us in the Presidential Election?

At's Demystifing AI conference, I gave (what was supposed to be) a lightning talk on Big Data and the Presidential Election. The awesomely engaged audience kept it going for well over time, and I came out of it with great insights and thoughts to put down in a blog post. 


What appealed to the audience was my 'post-mortem' approach, a name that I find deliciously macabre. The goal of the approach is to look at a project after the fact and analyze it's successes and failures at every step of the way. In this case, I looked at the presidential election, and called the 'project' of predicting the outcome a 'failure' in our astounding inability to predict that Donald Trump would win more Electoral College votes than Hillary Clinton. Let's unpack the discussion, slide by slide. 

SLIDE 1: Big Data Failed Us This Election

The premise of the talk. What we know is that not a single major poll was able to accurately predict the outcome of this election. In fact, we failed SPECTACULARLY. 

Worth understanding is we have standalone polls - like Gallup- groups who conduct their own polling, and we have metapolls, which are amalgamations of other polls, such as RealClearPolitics. This is an important distinction, because the former are responsible for executing their own surveys and locating their own samples, while the latter is an aggregate that relies on an 'ensemble' of polls. 

Also worth note is that this election was supposed to be the launch of Votecastr, which was supposed to provide real-time, and accurate, insights into the election outcome. This also failed to accurately predict the outcome. 

As a result, there has been a lot of post-election big data backlash, some of the more dramatic headlines being the inspiration for this talk's title. Let's unpack why. 

SLIDE 2: Our Understanding of Big Data Failed Us This Election

Even within the polling community, there was inconsistent prediction. The New York Times Upshot model, for example, gave Clinton ~85% chance of winning, while FiveThirtyEight gave her a ~72% chance. That's a pretty big difference. 

Let's look deeper. While the polls all agreed that she would win, they disagreed on the methodology to predict how. Most publicly, Nate Silver got into a heated battle with Huffington Post on his use of trend adjustment, which HuffPo called "changing the results of polls to fit what he thinks the polls are, rather than simply entering the poll numbers into his model and crunching them." 


Rather than taking a simple average -- like RealClearPolitics does -- Silver’s model weights polls by his team’s assessment of their quality, and also performs several “adjustments” to account for things like the partisanship of a pollster or the trend lines across different polls. Yet other models take historical trend into account, and demographic shifts. There is no clear consensus on a 'best' model.

SLIDE 3: Our Explanation of Big Data Failed Us This Election

Talking data to media outlets is a dangerous game of telephone. In my opinion, it is the data scientist's responsibility to be as clear as possible and as unambiguous as possible on the true meaning of their model. What is the error margin? What is the degree of confidence? What does a "75% chance" mean (hint, it doesn't mean that there is a guarantee of winning).

Of course, this is sometimes at odds with current trends of clickbait journalism. "Clinton win likely with a 62 to 89 percent probability" is not as eye-catching or click-inducing as "Clinton 90% likely to win." What to some may be semantics is to us the meat of the discussion.  

As scientists, we got caught up with selling precision. Polls are notoriously flawed, and predictive models that result from polls have a wide margin. At best, we over-reported how good our models were, at worst, people used that margin of error to their advantage. 

SLIDE 4: Our Understanding Of How We Collect Big Data Failed Us This Election

Polling, as I mentioned above, is notoriously flawed. As a masters student (about a decade ago!) I sat in on many discussions and panels about declining response rates, sample biases, the rise of do-not-call lists and how to get people to tell the truth in polls. The share of households that agreed to participate in a telephone survey by the Pew Research Center dropped to 14 percent by 2012 from 43 percent in 1997. This was before the contention and mistrust sown by the current social and political climate.

Long story short, these problems have (some) methodological workarounds, but are far from solved. In fact, some of them are worse. Depending on where you lived, there may be strong incentive to lie about your vote to align with your region's preference. 

In other words - GIGO, or garbage in, garbage out. If our data going into our models was flawed, our analyses coming out are not trustworthy. 

SLIDE 5: We Failed Big Data This Election

There was a great post-election quote by Erik Brynjolfsson along the lines of "if you understand how models work, you weren't surprised by this election" - apologies that I can't find the source. He was referring to understanding that a probability isn't a certainty, but it globally applies to this election as a prediction project. 

Ultimately, if we understand this as a data science project, we failed on all counts: 

- we failed to bring in good data that we had faith in
- we failed to build a model that was accurate and delivered good results
- we failed to validate our model
- we failed to communicate our results properly to our audience

What is our takeaway? Humility and introspection. We are only as good as the models we build and the quality of work we produce. 

Pain Free Data Science: Recommender Systems and how to Perfect Them

Coming off a data science buzz from Open Data Science Conference (ODSC) in Santa Clara.  I was a huge fan of the crowd that was there. Genuinely curious people with very substantive questions. We had some wonderful conversation, and I appreciate the insight and thought a lot of my colleagues are putting into their work.  I was invited for two talks: one 4-hour training session on Data Science 101, and a 45-minute talk on recommendation systems. 

The goal of my talk was to go through the thought process and critical thinking in developing a recommender system and refining the model. My slides are below, and pretty self-explanatory. What I wanted to talk about were some of the great followup questions and emails I got, particularly around developing a baseline and normalizing your data. 

There are a lot of tutorials about how to execute a basic recommendation system, but few on how to refine them. Let's assume you've built out your recommendation system, and are able to validate. One way of measuring validity is by a basic root means squared error (RMSE) measure. I won't get into the debate on whether it's a *good* error measurement or not, but let's say it's the one we use. Here's an article on Data Science Central about it, if you're so inclined.

What you will likely find is an okay model that has more error than you'd like. That is, your model is good, but not great, at predicting what your audience wants. Normalization is a great first step (and in some cases, the most impactful step) in fine-tuning your model. Normalization will be the most effective if you have a very diverse group of users or items, and/or you do not have many data points per item/user. In data science speak, both contribute to your variance. 

Normalization is one way to approach this problem. The idea is to create a baseline for 'normal' and then produce an offset for that item or user. The theory is that each user and item can vary from the expectation. Think about it this way - some people are just naturally more cheerful or more grumpy. In terms of items, some items are just perceived better or worse than others - for example, there is a huge cult of Mac that will just love every Apple branded product. Brand recognition will impact an item's perception even before the rating happens.

Normalization is a fairly easy process. For all users, get some mid-range (probably median) rating value across all users. For all products, get some sort of median rating value across all products. So you'll come out with "people tend to rate products at 3.5 on average" or "products tend to get a 3.5 rating on average".

Next, take the median score for each user across all products, and the median score for all ratings for a products. Yes, that means you will need some min number of ratings per product and per user, so this will work if you have more data. You'll come out with "user x tends to rate products at a 3.8" or "product x tends to have a rating of 3.3". 

Third, you subtract the score from the baseline to get the offset. In my example above User x would have an offset of 3.5 - 3.8 = -0.3, and product x would have an offset of 3.5 - 3.3= 0.2. 

To implement, you take your predicted value from your model - so that's a user/item prediction in your matrix - and add in the offset. Let's say I predicted that User x would give a rating of 4.0 to product x in my naive model. With normalization, I would contribute my offset and arrive at <4.0 - 0.3 + 0.2> = 3.9. My actual predicted value for User x reviewing Product x is 3.9. 

Of course this nuance has even further nuance. It's a bit hand-wavy to say 'baseline is average across all users or products.' There may be category specific characteristics that are a better way to develop a baseline. For example, maybe a new laptop should be judged against the baseline of all laptops, and not all products. This is particularly important if you're, say Amazon and have everything from crayons to chandeliers. 

Normalization is just one of many ways to refine your model, and I talk about others in the presentation. I'll also post the video from my talk when it's posted.