Kevin McElwee
Machine Learning Engineer | Data Journalist
Resume & Contact

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 full-time building machine learning models that increase efficiency on the electrical grid.

I graduated Princeton in 2018 with a degree in Musicology (most of my quantitative experience comes from a three-year stint in the Physics Department), and I have worked as a software engineer, data scientist, and journalist.

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 is helping utilities save money. If you're a journalist, here are my news apps, analyses, and investigations. 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.

Projects

  • Show All
  • Research
  • Journalism
  • Fun

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.
Tools used: Python (Pandas web-scraping), HTML query strings

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.
Tools used: Illustrator, Twitter API

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

Tools used: Illustrator, Spotify API

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.
Tools used: Selenium (Python web scraper)
The website WhoPaysWriters.com 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...
A tool to monitor the House's spending habits
(Project in progress)

Tools used: HTML, CSS, jQuery
Use this database to calculate quarterly turnover, suspicious activity, and other administrative trends from the members of the House with this database.

This website breaks down the House Expenditure data from the Sunlight Foundation and ProPublica. It's easy to compare different representatives' administrative habits, scan through their spending summaries, and sort their detailed expenses.

Go to the database.
Visualizing the Russia investigation’s timeline
A graphic that shows you more than you’ll ever need to know about the Mueller investigation.
April 25, 2019

Tools used: HTML, CSS, jQuery

The PBS NewsHour made a comprehensive spreadsheet of every major event concerning the Russia investigation. Spreadsheets are always straightforward and useful; however, after years of data, the NewsHour timeline has quickly become difficult to parse. I’ve created a simple tool that helps place all 450+ events onto a single, easy-to-read page.

View the graphic
Read more...
An algorithm for multiplicative persistence research.
How we can expand our search limits, orders of magnitude faster than the naïve approach.
Tools used: Cloud-based computing (Digital Ocean), Illustrator

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.
Tools used: Tensorflow/Keras, Linear Programming

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

Read more in Towards Data Science...
TSP
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.
Tools used: scikit-learn

Bots to brighten the Twitter hellscape.
Mindfulness Bot

Follow a bot that repeatedly asks, “Do you want to be on Twitter right now?”

Follow @BotMindfulness.
Read more in Future Vision...


Cuteness Bot

Tools used: Heroku, Reddit API, Twitter API

Follow a bot that posts the cutest content from Reddit.

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

Want LGBT rights? This is where to focus.
Data suggest that progress is most feasible in these key states.
March 22, 2019

Twenty-nine states allow employers or landlords to discriminate based on sexual orientation or gender identity. While progress at the federal level has halted, many states are prepared to grow LGBT protections. Follow my analysis of polling data and legislature makeup to see where civil rights organizations should focus their resources.

Read more...
Tony's
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.
Read more...
Guessing gender with Wikipedia
If you’re trying to add a male/female column to a spreadsheet of notable people, Wikipedia may offer a quick fix.
Wikipedia doesn’t include gender in its API, but a simple heuristic may be a quick fix if you’re trying to add a male/female column to a spreadsheet of notable people. Simply counting the number masculine and feminine pronouns in a person’s Wikipedia page seems to be a surprisingly accurate method.
Read more...
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.
Helpful Twitter bots!
Mindfulness Bot
Follow a bot that repeatedly asks, “Do you want to be on Twitter right now?”
Follow @BotMindfulness.
Read more in Future Vision...


Cuteness Bot
Follow a bot that posts the cutest content from Reddit.
Follow @reddit_says_aww.
Read more in The Startup...
Want LGBT rights? This is where to focus.
Data suggest that progress is most feasible in these key states.
March 22, 2019
Twenty-nine states allow employers or landlords to discriminate based on sexual orientation or gender identity. While progress at the federal level has halted, many states are prepared to grow LGBT protections. Follow my analysis of polling data and legislature makeup to see where civil rights organizations should focus their resources.
Read more...
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.
Read more...
Guessing gender with Wikipedia
If you’re trying to add a male/female column to a spreadsheet of notable people, Wikipedia may offer a quick fix.
Wikipedia doesn’t include gender in its API, but a simple heuristic may be a quick fix if you’re trying to add a male/female column to a spreadsheet of notable people. Simply counting the number masculine and feminine pronouns in a person’s Wikipedia page seems to be a surprisingly accurate method.
Read more...
Visualizing the Russia investigation’s timeline
A graphic that shows you more than you’ll ever need to know about the Mueller investigation.
April 25, 2019
The PBS NewsHour made a comprehensive spreadsheet of every major event concerning the Russia investigation. Spreadsheets are always straightforward and useful; however, after years of data, the NewsHour timeline has quickly become difficult to parse. I’ve created a simple tool that helps place all 450+ events onto a single, easy-to-read page.
View the graphic
Read more...
An algorithm for multiplicative persistence research.
How we can expand our search limits, orders of magnitude faster than the naïve approach.
Read more...
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.
Using neural nets to predict tomorrow’s electric consumption
The smallest error can lose utilities thousands of dollars in a single day. Neural networks can help make sure that doesn’t happen.
Advances in deep learning can offer utilities an incredibly accurate picture of the next day’s energy consumption. The Open Modeling Framework (OMF) and I have used neural networks to create a day-ahead load forecasting model that can be easily implemented to inform dispatch decisions.
Read more in Towards Data Science...
A tool to monitor the House's spending habits
(Project in progress)
Use this database to calculate quarterly turnover, suspicious activity, and other administrative trends from the members of the House with this database.
This website breaks down the House Expenditure data from the Sunlight Foundation and ProPublica. It's easy to compare different representatives' administrative habits, scan through their spending summaries, and sort their detailed expenses.
Go to the database.
Where to pitch, based on data from the website, Who Pays Writers?
In partnership with the Columbia Journalism Review.
The website WhoPaysWriters.com 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...
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.
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...
Stories I helped write
Let's pretend my support was incredibly influential.
Exploring science and tech
Select stories from my time at Princeton as a science writer.
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...