1 Introduction

Lotus Records wants to screen demo tracks before release. This section of the report uses ordinary least squares (OLS) regression to examine which pre-release song characteristics are associated with song_hotttnesss, the output variable of interest. We first estimate an initial model, then test three extensions (two polynomial terms and one interaction), and finally report all models in a single table and select a preferred model.

2 Data preparation

The full Million Song Dataset (MSD) is loaded, and a random subset of 20,000 songs is drawn. The subset is split 50/50 into training_data (used for model training in this section) and test_data (held out for model validation later in the A2 pipeline).

# Load the full MSD (object name: MSD)
load("MSD.RData")

# Draw a reproducible random subset of 20,000 songs
set.seed(2204)
msd_subset <- MSD[sample(nrow(MSD), 20000), ]

# Split the subset 50/50 into training and test data
train_index   <- sample(nrow(msd_subset), 0.5 * nrow(msd_subset))
training_data <- msd_subset[ train_index, ]
test_data     <- msd_subset[-train_index, ]

# Recode mode into readable labels; Minor (0) is the reference category
training_data$mode <- factor(training_data$mode, levels = c("0", "1"),
                             labels = c("Minor", "Major"))
test_data$mode     <- factor(test_data$mode, levels = c("0", "1"),
                             labels = c("Minor", "Major"))

# Free memory: the full MSD is no longer needed
rm(MSD)

The training_data contains 10,000 songs. However, only 3,038 (30.4%) have complete information on all five variables used in this section. Most of the missingness comes from the output variable song_hotttnesss (5,444 missing) and from year (4,873 missing). Because lm() uses listwise deletion by default, the models below are estimated on the complete cases only; this issue is addressed in the next stage of the report (missing data).

3 Model specification

3.1 Regression equation

The initial model predicts song hotness from four input variables:

\[ \widehat{song\_hotttnesss} = \hat{\beta}_0 + \hat{\beta}_1 \cdot tempo + \hat{\beta}_2 \cdot duration + \hat{\beta}_3 \cdot mode_{Major} + \hat{\beta}_4 \cdot year \]

where \(mode_{Major}\) equals 1 for songs in a major key and 0 for songs in a minor key (the reference category).

3.2 Choice of input variables

The input variables were chosen because they can be practically obtained before a track is released. duration and year are standard metadata attached to every digital audio file, so they are available at no cost. tempo and mode are musical characteristics that a producer or A&R staff member can determine from the demo itself, either by ear or with widely available audio software, so they would also be known when the model is used to screen new tracks.

Variables such as artist_hotttnesss and artist_familiarity were deliberately excluded. Although they are strongly correlated with song_hotttnesss, they are themselves outcome-type measures that are only known after an artist has an established audience; for a new artist they would be unknown (or would themselves need to be predicted). Including them would inflate \(R^2\) during training but make the model useless for screening new music, and would introduce multicollinearity with the output. loudness was also excluded because, while measurable, it depends heavily on mastering decisions made late in production and requires processing the audio file, so it would not be reliably available at the demo stage.

4 Initial model (m1)

m1 <- lm(song_hotttnesss ~ tempo + duration + mode + year,
         data = training_data)

Overall significance. The F-statistic is 15.80 on 4 and 3,033 degrees of freedom (p < 0.001), so the model explains significantly more variation in song hotness than an intercept-only model.

Model fit. The adjusted \(R^2\) is 1.91%, meaning the model explains only 1.91% of the variation in song_hotttnesss. This is low, which is common for a complex cultural outcome such as popularity, and it suggests that extensions to the model should be explored.

Input variables.

  • Tempo has a significant positive effect (p = 0.003). Holding other variables constant, a song that is 10 BPM faster is associated with a 0.0024 increase in hotness.
  • Duration has a significant negative effect (p < 0.001). A song that is 60 seconds longer is associated with a -0.0055 change in hotness, i.e. longer songs tend to be slightly less “hot”.
  • Mode is not significant (p = 0.876): on average, major-key songs differ from minor-key songs by only -0.0009 hotness points.
  • Year has a significant positive effect (p < 0.001). Each additional release year is associated with a 0.0020 increase in hotness (about 0.020 per decade), so more recent songs tend to be hotter.

Missing data. 6,962 of the 10,000 training observations (69.6%) were deleted due to missingness, leaving 3,038 observations. This is a large loss of information and a potential source of bias.

5 Revised models including extensions

5.1 Model 2: a “sweet spot” tempo? (m2)

There may be an optimal tempo for a popular song: a song can be too slow to engage listeners or too fast to be comfortable. To test for this curvilinear effect, a quadratic tempo term is added with I().

m2 <- lm(song_hotttnesss ~ tempo + I(tempo^2) + duration + mode + year,
         data = training_data)

The quadratic term I(tempo^2) is not significant (p = 0.175), and the linear tempo term becomes not significant once the quadratic term is included (p = 0.064). The adjusted \(R^2\) changes from 1.91% in m1 to 1.94% in m2, a difference of only 0.03 percentage points. Because the new term is not significant and adds complexity without meaningful explanatory power, there is no evidence of a tempo “sweet spot”, and this extension is not retained.

5.2 Model 3: a curvilinear effect of year (m3)

Music tastes evolve over time, so the effect of release year may not be linear. A quadratic year term is added to the initial model.

m3 <- lm(song_hotttnesss ~ tempo + duration + mode + year + I(year^2),
         data = training_data)

The quadratic term I(year^2) is significant (p = 0.001), and the adjusted \(R^2\) increases from 1.91% (m1) to 2.21% (m3). This extension is therefore retained.

Turning point. Using the estimates stored in m3:

\[ \text{Turning point} = -\frac{\hat{\beta}_{year}}{2 \times \hat{\beta}_{year^2}} = -\frac{-0.2577}{2 \times 6.519 \times 10^{-5}} \approx 1977 \]

The turning point of year is at 1977. Because the quadratic coefficient is positive, the curve is U-shaped: predicted hotness is lowest for songs released around 1977, and rises for songs released after that point. For Lotus Records this means that recent releases enjoy a strong “recency” advantage in hotness, while the model also predicts higher hotness for older catalogue songs (pre-1977) — possibly reflecting the enduring popularity of “classic” tracks that have survived in the catalogue. However, only 5.8% of the songs used in the model were released before 1980, so the left-hand side of the curve rests on few observations; it is largely a consequence of the quadratic shape and should not be over-interpreted (see Figure 2).

5.3 Model 4: does the effect of tempo depend on mode? (m4)

Tempo may matter differently for major-key (typically “bright” or “happy”) songs than for minor-key (typically “dark” or “sad”) songs. An interaction term between tempo and mode is added to the best model so far (m3) using the : operator.

m4 <- lm(song_hotttnesss ~ tempo + duration + mode + year + I(year^2) + tempo:mode,
         data = training_data)

The interaction term tempo:mode is significant (p = 0.004), and the adjusted \(R^2\) rises from 2.21% (m3) to 2.44% (m4). The quadratic year term remains significant (p = 0.003), with a turning point of 1976, very close to m3.

Interpreting the interaction. Because Minor is the reference category, the coefficient on tempo is now the effect of tempo for minor-key songs, and the interaction coefficient shows how much this effect changes for major-key songs:

  • Minor-key songs: a 10 BPM increase in tempo is associated with a 0.0057 increase in hotness.
  • Major-key songs: a 10 BPM increase in tempo is associated with a 0.0007 change in hotness (0.000571 + (-0.000497) = 0.000074 per BPM), which is close to zero.

In plain terms: a faster tempo helps minor-key songs, but makes almost no difference for major-key songs. For Lotus Records, an upbeat minor-key demo (e.g. dance or electronic tracks in a minor key) may be more promising than a slow minor-key ballad, whereas for major-key tracks tempo is not a useful screening signal. Note also that the main effect of mode has become significant (p = 0.006); it now represents the difference between major and minor songs at a tempo of 0 BPM, which is not meaningful on its own, so mode should be interpreted together with the interaction.

6 Results

Table 1 summarises all four models. Standard errors are shown in parentheses.

Table 1. OLS regression models of song_hotttnesss (training_data)
m1 m2 m3 m4
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001
Intercept -3.449533*** -3.514928*** 255.146011** 239.991842**
(0.587239) (0.589131) (80.709884) (80.785889)
Tempo (BPM) 0.000242** 0.000870+ 0.000248** 0.000571***
(0.000083) (0.000470) (0.000082) (0.000139)
Duration (sec) -0.000091*** -0.000093*** -0.000085** -0.000085**
(0.000027) (0.000027) (0.000027) (0.000027)
Major mode -0.000931 -0.000919 -0.000967 0.061653**
(0.005973) (0.005972) (0.005964) (0.022595)
Year 0.001965*** 0.001978*** -0.257726** -0.242568**
(0.000294) (0.000294) (0.081050) (0.081125)
Tempo² -0.000002
(0.000002)
Year² 0.000065** 0.000061**
(0.000020) (0.000020)
Tempo × Major mode -0.000497**
(0.000173)
Num.Obs. 3038 3038 3038 3038
R2 Adj. 0.019 0.019 0.022 0.024

7 Preferred model

The preferred model is m4, which has the highest adjusted \(R^2\) (2.44%) of the four models. Compared with the initial model (m1), it explains an additional 0.53 percentage points of variation in song_hotttnesss, and every extension it contains is statistically significant. It remains parsimonious: it uses the same four practical input variables as m1, adding only one polynomial term (year²) and one interaction (tempo × mode), each grounded in a clear theory (changing music trends over time, and the different emotional character of major and minor keys). The tempo² term from m2 was dropped because it did not improve fit, showing that adding complexity does not guarantee a better model.

Figure 1 shows the tempo × mode interaction from the preferred model, holding duration at its mean and year at its median.

Figure 1. Predicted song hotness by tempo and mode (preferred model)

Figure 1. Predicted song hotness by tempo and mode (preferred model)

Figure 2 shows the U-shaped effect of release year, holding tempo and duration at their means for minor-key songs.

Figure 2. Predicted song hotness by release year (preferred model)

Figure 2. Predicted song hotness by release year (preferred model)

8 Limitations and next steps

  1. Low explanatory power. Even the preferred model explains only 2.44% of the variation in song hotness. Popularity depends on many factors not captured here (marketing, genre, lyrics, social media exposure), so the model should be used as one screening input, not as a decision rule.
  2. Missing data. 6,962 training observations (69.6%) were dropped through listwise deletion. If songs with missing hotness or year differ systematically from complete cases, the estimates may be biased. The next stage of the report will deal with missing data (e.g. multiple imputation) so that more of the available information can be used.
  3. Measurement of inputs. tempo and mode are algorithmic estimates and may contain error, which tends to weaken estimated relationships.
  4. Model validation. All results are based on training_data only. The final stage of the A2 pipeline will use the preferred model to predict song_hotttnesss in the held-out test_data to assess how well it generalises to songs it has not seen.