Inspiration

Using comprehensive data from the U.S. Social Security Administration (SSA) on the number of babies born with certain names from 1880-2024, I wanted to understand social trends in the popularity of certain baby names.

This was personally interesting to me as I've noticed that vintage sounding names like Sylvie or Mabel seem to be more common among friends with children, while the names of my generation feel less common. So the question became could I use some kind of generational effect to explain name popularity.

What it does

First, the notebook loads up the SSA data on counts of babies born by sex and name and ranks the names. Because the raw number of names chosen has increased over time, many times throughout the notebook I refer to a ranking that is normalized to the number of options in a given year. The notebook has interactive visualizations to look at the popularity of a chosen name over time, as well as the popularity of names in a selected decade. Finally, I built a classification model using a random forest to dig into whether generational features could be helpful in forecasting the top names.

How we built it

The AI feature I used extensively was the threads where I could chat with an LLM agent to prototype code changes. I used this tool to iterate on my random forest model, to speed up the loading of my data, to convert slow Python code into SQL, and to generate text summaries of model outputs.

Challenges we ran into

My first attempt at modeling popularity involved formulating my prediction problem as: given this year's ranking of a name (and a bunch of other features about it), could we predict whether that name will be in the top 25 next year?

This version of the model said that (by far) the most important feature in that prediction problem was a name's current rank. In other words, you can build a pretty good classifier if you just assume that next year's rank would be its current rank. Though this is probably true. The model had good accuracy. It felt rather uninteresting, so I reformulated the problem using decade rankings, in hopes that it might capture generational effects (more on this in "What we learned").

Accomplishments that we're proud of

It was interesting to learn a bit about how to "vibe code" with an LLM coding assistant. I wanted to explore some more visualizations beyond what the SSA does on their website, and was excited about try to build a classification model on time series data.

What we learned

After reformulating my prediction problems with data by decade, I still failed to capture any generational impacts. It's possible that there are many other factors driving trends in baby names and these wash out the generational impacts I tried to investigate, or it's possible I didn't do enough feature engineering to capture changes in name ranking, or maybe it's just hard to predict naming conventions at this scale.

What's next for Forecasting this decade's top baby names

This was a bit of a one-off exploration for me. If I had more time, I would take feature engineering further (considering some of the learnings above) and explore different modeling options (e.g., modeling the rank vs in top N or not). I guess in terms of what's next, let's revisit this notebook in 15 years to see if this model got it right! 😆

Share this project:

Updates

Submission history