Proof That I'm Right- A Definitive Data Science Blog
    About     Archive     Feed

The Science of One-Hit Wonders!

See the one-hit wonder repo for the code and slides for this project!

The Question

For my last project, I explored the science behind one-hit wonders, or artists who only are only known for one song; think of songs like The Macarena, Come On Eileen, or, more recently, The Harlem Shake!

Since the beginning of Metis, I knew I wanted to do some sort of project with music and use the Spotify API, which provides numerical representations of the audio qualities of any song on Spotify (e.g. how danceable it is, the tempo, its loudness). As a pop music enthusiast, I was particularly interested in one-hit wonders because the phenomenon seemed pretty random! With the help of natural language processing and classification techniques, I wanted to see whether I could show if one-hit wonders weren’t a completely random phenomenon and figure out their ingredients.

The Ketchup Song!

For this project, I defined a one-hit wonder as an artist who only had one song reach the Billboard top 40. This definition comes from one-hit wonder expert and music journalist Wayne Jancik, the author of The Billboard Book of One-Hit Wonders, and seems to be the most common definition used in music literature. With this definition and a lovely dataset of the Billboard weekly Hot 100, I was off to the races!

Feature Engineering

After a lot of data cleaning, I did data manipulation to find songs that were eligible to be a one-hit wonder, or, in other words, an artist’s first song to reach the Billboard top 40. I then added in data via the Spotify API, including the genres of the artist (e.g. hip hop, pop) and the aforementioned audio features. I also added in the song’s lyrics, producers, and writers via the Genius API.

After performing some data validation, we had 1500 songs in our dataset, 48% of which were one-hit wonders, which I thought of as surprisingly high! Alas, it is better to have one hit wonder-ed than to never have one hit wonder-ed at all, right? :thinking:

I really wanted to incorporate some of the natural language processing techniques I picked up at Metis, so I performed some feature engineering around the lyrics of songs. I used VADER to perform sentiment analysis, leveraged spaCy for named entity recognition (e.g. is the song using more specific language as opposed to more vague language or cliches), measured the reading difficulty of the lyrics using the Flesch Reading Ease, and quantified the variety of words in the lyrics through a custom metric.

I Try (to make good features for my model!

I also wanted to compare the potential one-hit wonders to the music landscape at the time of the song’s release. To avoid data leakage, I compared each one hit wonder to the previous year’s top 100 songs via the Billboard year-end charts. These year-end charts are based off a song’s position and longevity on the weekly charts from the entire year. I used a dataset that already had the lyrics of the top songs. After adding in audio features and genres via Spotify’s API, I developed three metrics to measure how similar a song was to other music popular at the time!

  • Genre score, or genre popularity. This is defined as a count of how many songs’ artists from the year-end chart from the prior year had the same genre as the one-hit wonder’s artist (e.g. the potential one hit wonder was country and 15 songs on the prior year’s year-end charts were country, so the genre score is 15 points). I only looked at the genre with the highest score if the song’s artist had multiple genres.

  • Lyric distance, or how the lyrics of the song compare to the prior year’s top 100. I got a bit creative with this after clustering/DBScan wasn’t returning great results; I performed PCA on the TFIDF vectorizer of the songs from the prior year, then calculated the euclidean distance of the one-hit wonder’s from the center/average. The higher the lyric distance, the more unique a song’s lyrics are relative to other popular songs at the time.

  • Feature distance, or how the audio features compare to the prior year’s top 100. I used scaling and euclidean distance with the audio features to see if the production of the song was very different from the current music landspace.

Modeling

Now, it’s time for the most satisfying part of the data science process- modeling!

This is what I imagine sci-kit learn looks like

Throughout this process, I tried a bunch of classification models: logistic regression with lasso and/or ridge regularization, linear SVM, random forests, KNN, XGBoost, and a neural network with 2 hidden layers.

Optimizing the F-score, the neural network worked best (see scores from the test set below after I did some threshold tuning). All of the linear models also performed strongly. I then dove into finding out the ingredients of a one-hit wonder, or, in data science term, feature importance. For this, I used the logistic regression.

Metric Score
F-Score 0.71
Recall 0.88
Precision 0.60
AUC 0.73
Accuracy 0.66

Results

And the moment you’ve all been waiting for: the ingredients of a one-hit wonder! Below are the most important and statistically significant features that increase the song’s probability of being a one-hit wonder!

  • Relatively poor performance on the Billboard weekly charts. This finding is quite intuitive; if a song’s peak position is closer to 40 than to 1 and the song wasn’t on the weekly charts for a long period of time, it’s more likely going to be a one-hit wonder.
    • Let’s look at How You Remind Me by Nickelback! The song was on the weekly charts for 49 weeks and peaked at number one, decreasing the Nickelback’s chance of being a one-hit wonder.
    • On the other hand, let’s look at Irish girl group B Witched and their surprisingly racy first single C’est La Vie (I hadn’t heard the song since 1999- the things I can pick up on now!). The song peaked at number 9, but was only on the chart for 15 weeks; for a top ten song, this is a pretty short stay on the charts, so the song was more likely to be a one-hit wonder.

  • If an artist is featured on the song! I think this is also intuitive- if there’s a featured artist, it’s more difficult to say who drove the song’s success.
    • As an example, think of American Boy by Estelle ft. Kanye West or Latch by Disclosure ft. Sam Smith!
  • If the lyrics are similar to other popular songs at the time. This was a surprising finding to me! When I think of one-hit wonders, I think of songs with odd lyrics (e.g. The Macarena, I’m Too Sexy, Barbie Girl, etc). These songs may be the exception, but in general, the more unorthodox the lyrics, the lower chance a song is going to be a one-hit wonder.
    • An example of a song that had a low lyric distance score (aka it was similar to other songs released at the time) is What Is Love by Haddaway. If you look at the lyrics, you can see they’re a bit generic (but undeniably catchy).

  • If the genre of the artist isn’t popular at the song’s time of release.
    • Let’s look at Ho Hey by The Lumineers. Released in 2012, The Lumineers are a folk/rock group. Only two songs’ artists in 2011’s year-end top 100 songs had these genres, increasing the song’s probability of being a one-hit wonder!
  • If the song was released in the 2010s. My initial thought on this had to do with the shift in how we consume music over the past 20 years, from radio and CDs, to digital purchases, and, finally, to streaming. In addition, Billboard has been tweaking how they count streams in their rankings throughout the 2010s! My hypothesis is that all these changes have contributed to one-hit wonders being more likely in the 2010s, but I have to do a bit more research!

Me (as LaToya Jackson) investigating the 2010s!

  • Lastly, some genres were more likely to be one-hit wonders than others! Artists categorized as R&B a relatively higher chance of being a one-hit wonder, while Country and Hip Hop artists were the least likely to be one-hit wonders.

2006 R&B one-hit wonder Me & U by Cassie

Farewell!

I hope you enjoyed my analysis, and the next time you ponder why that artist you loved from a few years ago hasn’t had much success lately, consider these findings! Finally, I’ll leave you with some of my favorite one-hit wonders :dancer:

Groove is In The Heart by Deee-Lite

Oops (Oh My) by Tweet ft Missy Elliott

Trends in Online Dating!

See the OkCupid NLP repo for the code and slides for this project!

The Question

My first exposure to data science was through OkTrends, a blog by OkCupid. OkCupid is a dating website that focuses on compatibility between users via answers to multiple choice questions. I loved the concept of using data to analyze human behavior, particularly in the high stakes world of dating! As a result, when it came time to choose a project to utilize NLP (Natural Language Processing) techniques and I stumbled upon an OkCupid dataset with lots of text features, I knew exactly what to do.

Being single and having an upcoming birthday, I wanted to see how dating changed with age; my guess was that users had more concrete, serious relationship goals as they got older, but I was curious to see how self-presentation changed. In addition, since I had spare time and the framework could easily be applied to other demographic information, I explored how dating profiles changed with sex and how profiles changed with pet preference. :cat2:

The Data

The dataset consisted of 60,000 OkCupid profiles from users in the San Francisco Bay Area, scraped in June 2012. The dataset had basic demographic information like age, gender, education level, but also some quirkier features, like pet preferences and zodiac sign. Most importantly, the dataset had the text of the users’ profiles! OkCupid profiles are broken out into sections, where users respond to different prompts. For an example of what this looks like, see my “OkCupid profile” below.

I chose to focus on a handful of sections that I thought would be most insightful: Self-Summary, I’m Really Good At, What People First Notice About Me, I Spend A Lot Of Time Thinking About, and Message Me If. Each section has its own purpose; for example, I’m Really Good At shows what users value the most about themselves, What People First Notice About Me, in my opinion, is a reflection of what users first notice about other people, and Message Me If is a concise section to show what you’re looking for from the website and a relationship!

The data itself wasn’t too bad to deal with. I had to use a lot of regex tools to get rid of HTML tags, links, punctuation, and some strange formatting, but it was pretty straightforward! I also used lots of standard NLP techniques like lemmatization and part-of-speech tagging. I did have to perform some undersampling, as there was a large gender imbalance in the dataset that changed with age; it was 60/40 male/female overall, but the gap greatly decreased with age. Since I was modelling on age, I didn’t want age to just be a proxy for gender, so undersampling really helped!

Modeling

Now, it’s time for the most satisfying part of the data science process- modeling!

This is what I imagine sci-kit learn looks like

For this project, I performed topic modeling via NMF (Non-negative Matrix Factorization) to understand the themes in the profiles and to see how the presence of these themes changed with age.

I also used a metric derived from Scattertext called the scaled F-score. This score is a measurement of how unique a term is to a specific category and how commonly it is used within that category. For example, for profiles for users aged 18-25, ‘Mario Kart’ is seen more much often compared to profiles of other age groups. In addition, ‘Mario Kart’ is used very frequently out of the all terms used in profiles for users aged 18-25. As a result, ‘Mario Kart’ will have a high F-score for users aged 18-25!

The F-score will range from -1 to 1. An F-score closer to -1 or 1 indicates that the term is more unique to a particular group and is used often, while a score closer to 0 indicates that the term isn’t specific to any group and/or isn’t used frequently. If you’re curious about the math behind the F-score, feel free to reference this!

Results for Age

Let’s start with looking at how dating changes with age. For age, I categorized users into two age groups: 18 to 29 and 30+. In our data set, 30 was the median age. Terms with a score closer to -1 are more likely to be associated with the 18 to 29 age group while terms with a score closer to 1 are more likely to be associated with the 30+ age group. Also, I’m aware that the graphs are a bit garish, but I was excited about Pride month!! :rainbow:

  • Age- Message Me If

  • Older users seem to be looking for more serious relationships

  • Age- I’m Really Good At Trending

  • There a transition from fun skills to more practical and nurture-driven skills with age

  • Age- I’m Really Good At

  • Once again, we see a transition from fun skills and hobbies to social and practical skills

  • Age- What People First Notice About Me

  • As users get older, they seem to notice personality attributes more often, as opposed to physical attributes

In all honesty, this exercise made me a bit less scared of dating as I get older! The differences I found between age groups also explained, in part, how the dating app market has formed, with apps like Tinder appealing to a younger audience and other services like Match.com appealing to an older audience. Each app serves different needs and priorities, with younger audiences being more physically driven and adventurous and older audiences looking for more emotional intelligence and substantial relationships.

Results for Pets

Now, on a lighter note, let’s shift our focus to terms most associated with dog and cat people! Someone like myself, who likes both cats and dogs, would not be included in this data; only users who showed positive feelings towards either dogs or cats were included.

  • Cat people show more interest in science and culture, dog people seem more athletic, traditional, and social

Results for Sex

I found these results to be a bit stereotypical, but I still think they’re worth sharing! Note, in 2012, when the data was collected, OkCupid only had two options for sex: male and female. Today, OkCupid has many more options.

  • Sex- What People First Notice About Me

  • Females tend to write about both physical attributes and personality; males are much more likely to write about physical features (including eyelashes?)

  • Sex- I’m Really Good At

  • Parallel parking and hula hoop?

  • Sex- I Spend A Lot Of Time Thinking About

  • Males seem to be more grandiose- see ‘jack (of all) trades’ and ‘fix anything’ in prior set of graphs and ‘life universe’ here

Farewell!

I hope you enjoyed my analysis and, as always, feel free to reach out if you have any thoughts or questions!