Kevin McElwee
Machine Learning Engineer | Data Journalist

Hello there!

I am optimistic about the possibilities of applied mathematics, particularly machine learning, to inform debate and serve the public good. I currently work at Princeton University in the Center for Digital Humanities, helping professors and students develop their data-driven research projects. Before Princeton, I worked in the energy sector, building machine learning models that increase efficiency on the electrical grid.

I'm always open to helping organizations and journalists with their technical projects! I'm currently doing business as Brown Analytics, LLC. If you're a non-profit or business, check out how my research has helped utilities save money. If you're a journalist, here are my news apps, analyses, and traditional clips. Here's my algorithm research for the CS-inclined. And I'm actively looking for opportunities to volunteer my technical skills to non-profits supporting LGBT rights.

Feel free to reach out for more information! My email is kevinrmcelwee at gmail.


  • Show All
  • Research
  • Journalism
  • Fun
Introduction to Twitter Scraping and Analysis with Python

A collection of web scraping case studies, exercises, tutorials, and resources for the 2021 FSI summer course Humanistic Approaches to Media and Data.

View seminar site

The Fortune 100 & Black Lives Matter
A dataset of Fortune 100 tweets during BLM protests reveals corporate America's awkward relationship with social justice.

Check out the project's website here.

Explore a database of the most popular “Florida Man” headlines.
The web app uses parsed headlines from the most highly rated Florida Man subreddit posts of all time.

For almost a decade, “Florida Man” has been a mainstay antihero of internet culture. Headlines like “Florida man too fat for jail” and “Florida man steals dinosaur bones” are easy fodder for meme-ification. In early 2013, “Florida Man” was canonized on Twitter with @_FloridaMan and on Reddit with the r/FloridaMan subreddit. And after seven years of retweeting and upvoting, we can gather the most popular headlines to see what makes a “Florida Man” headline successful.

Check out the web app here. And check out the data analysis here.

Predicting AIDS-Preventive Behavior of Latina Adoelscents: A Test of the Theory of Planned Behavior and Acculturation

A Tired Cliché: Half of Princeton theses use a colon in their title.
In some departments, the number is as high as 85 percent.

Almost every Princeton graduate — from Senator Ted Cruz to Supreme Court Justice Elena Kagan, actress Brooke Shields to Chair of the Federal Reserve Jerome Powell — has written a senior thesis. All these graduates have also used a titular idiom that plagues nearly half of Princeton theses: the colon.

Read more in Towards Data Science...

Fake-follower calculators misinform users, journalists with dubious statistics.
The third-party Twitter apps aren’t built to be used on accounts with millions of followers. Of course, that’s what users did anyway.

Fake-follower calculators, especially a platform called Twitter Audit, have been cited by a number of news outlets, including The Telegraph, Vanity Fair, and the Columbia Journalism Review. But these platform’s statistical techniques are far from rigorous for large accounts.

Read more in Towards Data Science...

The 2020 candidates on Spotify
What can Spotify data tell us about how some presidential campaigns are targeting voters?
August 5, 2019

Lizzo is one thing The Democratic Party can agree on. Three 2020 candidates have integrated Spotify into their campaigns: Senator Kamala Harris, Senator Kirsten Gillibrand, and Mayor Pete Buttigieg. In their playlists, she’s featured more than any other artist, and only she and Aretha Franklin appear on all three.

While it’s easy to notice Lizzo in each playlist, we can use Spotify’s datasets to reveal less obvious trends. Spotify makes a track’s popularity, stylistic information, and other metadata publicly available—data which can be useful in understanding not only the audience each candidate is targeting, but also how the candidate wants to be seen by that audience.

Read more in Towards Data Science...
Where to pitch, based on data from the website, Who Pays Writers?
In partnership with the Columbia Journalism Review.

The website was founded in 2012 as a public, anonymous forum for freelancers to share their experiences working for publications. An analysis of the site's data confirmed some of our presumptions about freelancing: it can be hard to make a living simply writing. But it also revealed that pay is going up at a greater rate than inflation, that the publications with the biggest names don’t always treat their freelancers the best, and that contracts, in a multi-platform era, are getting a lot more complex.

Read the full article in the Columbia Journalism Review...
An algorithm for multiplicative persistence research.
How we can expand our search limits, orders of magnitude faster than the naĂŻve approach.
Does Scrabble Need To Be Fixed?
An experiment in controlling how much of Scrabble is luck.

Joshua Lewis, a Ph.D. candidate at the University of California, San Diego, conducted a statistical study to show that there are "lucky" tiles in Scrabble, and suggested updated values. I conducted my own tests to see if Lewis’ values really make Scrabble more fair in practice. In short, they don't.

Read the full article in Nautilus Magazine...

Read yet another article about Scrabble luck in Nautilus Magazine...

Check out my Scrabble luck calculator.

Using neural nets to make the electrical grid more efficient
The smallest error can lose utilities thousands of dollars in a single day. Deep learning can help make sure that doesn’t happen.

I've developed a three-part guide to peak shaving with neural networks.

A traveling salesperson heuristic in NlogN time
By repurposing a common machine learning algorithm, we can get a fast solution to a notoriously difficult problem.
Bots to brighten the Twitter hellscape.
Mondrianify Bot

(Currently in development.) A twitter reply bot that transforms images into paintings by Piet Mondrian

Follow @PietMondrianAI.

Cuteness Bot

Follow a bot that posts the cutest content from Reddit.

Follow @reddit_says_aww.
Read more in The Startup...

Restaurant & Pizzeria
6 in 10 New Jersey residents live near a “Tony’s” pizza.
And yes, they’re independently owned.
Tying together multiple sources of data, I estimate the number of New Jersey citizens within a 5 mile delivery radius of every Tony's pizzeria.
Tracking migration of Princeton University alumni
Though conflicted, small-town University students are fleeing to cities
January 26, 2018

Each year, the University enrolls around five or six students from Kansas, four or five from Kentucky, and three or four from Idaho. However, five years after graduation, no one from the Class of 2012 has returned to any of those states. Nearly a quarter of the Class of 2012 is living in New York City.

Read the full article in The Daily Princetonian...
Reporting from Moscow
The Kremlin and opposition leaders are vying for Russia’s youth vote
December 6, 2017

Four waves of protest — in March, June, October and November of 2017 — brought thousands of Russians into the streets to oppose Russian President Vladimir Putin and a corrupt Russian government. The citizens fueling these protests? Mostly young people.

Read the full article in The GroundTruth Project...

Where are the US and Russia finding common ground? Low Earth Orbit
August 17, 2017

Americans and Russians working on the International Space Station tend to turn a blind eye to terrestrial snafus that divide their respective countries.

Read the full article in The GroundTruth Project...
Exploring science and tech
Select stories from my time at Princeton as a science writer.