Keywords

1 Introduction

In music industry, the main service media has been rapidly shifted from tangible devices such as magnetic tape and optical disc media (CD and DVD) to intangibles. It heavily relies on online music streaming service as one major source of revenue. Due to its trend-sensitive nature, user experience and reputation are keys to be successful in the music streaming service market. Traditional music streaming service provides keyword-based search to users which is straightforward to find songs and artists in their mind or memory. However, it limits its service within users’ expectation and prior knowledge where it leaves non-expert users inaccessible to a large portion of service. It often fails to create a new experience that exposes users to the songs that they have never heard of, yet are enjoyable to them.

To overcome the limitations, personalized recommendation has been proposed [46]. It finds out user’s preference of music from user historical behavior or service consumption pattern assuming that a user group who consume the same patterns of music has a higher change to have a similar music preference than the other group who consume different types of music. It often captures a useful insight of service consumption pattern and broadens the opportunities in music streaming market.

However, it somehow ignores that users’ music preference might change as their emotions change over time. Emotion reflects various factors such as weather condition, personal relationship, work-related matters, and social issues. Emotions are also latent factors that affect which type of music user prefer at that moment which may fluctuate irregularly.

Based on the assumption, we attempt to derive the latent emotion factors from historical weather data and daily music chart. Specifically, we co-analyze K-pop daily chart from online music streaming service and Korean weather history for the last few years, assuming that the latent emotion factors collaboratively affect music preference and are affected by the weather condition. According to IFPI 2014 annual report [1], South Korea has the 8th largest music market in terms of total retail value. The climate in Korea is relatively uniform across regions and consistently changes as season changes from spring to winter.

The key contributions of our study are summarized as follows.

  1. 1.

    We characterize K-pop music streaming service industry and Korean weather by analyzing historical records of music chart and weather.

  2. 2.

    We reveal correlations between weather condition and music preference pattern.

  3. 3.

    We devise a model that recommends songs and artists based on latent emotion factors. The emotion factors are inferred from weather condition using collaborative filtering method.

  4. 4.

    Through comprehensive tests and validations, we show the emotion-aware recommendation system noticeably outperform the baseline model that always recommends the most popular music.

2 Preliminary Study

2.1 Dataset Description

We have obtained the dataset from Weather Underground and Bugs Music Chart [2, 3]. Bugs Music, a popular K-pop music streaming web-sites, provides various music chart daily and weekly. The chart provides a list of top 100 songs with artist most frequently enjoyed on each day.

The main Bugs music chart counts all population who subscribes their music streaming service. However, the main chart tends to be influenced strongly by the fandom culture of K-pop which makes the chart skewed toward songs that are performed by a boy band or girl band and songs newly released. Figure 1(a) shows the probability density of how many days each song takes to rank in the chart after song release date during the period from 2012 to 2015. About 65 % of songs in the chart are released within a month. Songs that older than one year take place less than 7 %. Moreover, 35 out of top 100 artists who ranked in most frequently during the period are either a boy band or girl band. We expect this mitigates the effect of weather condition and its related emotion factors.

Fig. 1.
figure 1

Number of days after song release for the songs in Bugs Music Chart

On the other hand, the Bugs Music provides another type of daily chart called “Mania Chart” that only counts top 2 % of users who use their music streaming service most often. It also removes songs not older than 1 year, which helps disentangle the new song impact from relation between music preference and weather effect. As shown in Fig. 1(b), it took a song about 6.5 years to rank in the Mania Chart on average. Furthermore, boy bands and girl bands take only about 10 % of portion in the chart. For the rest of this paper, we only use “Mania Chart” as daily music chart data.

For the historical weather data, we have retrieved daily temperature (min, max, and average), humidity (min, max, and average), dew point, air pressure, wind speed (min, max, and average), visibility, and weather events (rain, fog, snow, and thunderstorm) from 2012 to 2015 from Weather Underground [2]. Furthermore, we added up 3 more weather variables of wind chill, heat index, and discomfort index that indicate coldness, heat, and discomfort more directly related to human feeling [79]. It consists of weather parameters of Seoul, the capital city of South Korea that account for 1/4 of total population of Korea where the weather is relatively uniform across its regions.

For the next two Sects. 2.2 and 2.3, we overview the two datasets to understand general characteristics of Korean weather and K-pop music market before proceeding to recommendation models.

2.2 Weather Data Analysis

Figure 2 illustrates daily temperature change from 2012 to 2015 in Korea. The temperature goes up around 30 °C in summer and drops to 0 ~ –10° in winter. As in Figs. 3 and 4 rainfall is concentrated during summer season hence increase the humidity and discomfort level combined with high temperature.

Fig. 2.
figure 2

Daily average temperature from 2012 to 2015 (Color figure online)

Fig. 3.
figure 3

Seasonal discomfort level and humidity (Color figure online)

Fig. 4.
figure 4

Average monthly rainy days in Seoul (2012–2015) (Color figure online)

With that said, it is expected that songs that compensate the displeasure feeling of hot and humid weather will be preferred during the summer season whereas different types of music will be preferred in other seasons.

2.3 Music Chart Analysis

Figure 5 shows a list of song titles that appears most frequently in the Mania Chart from 2012 to 2015. We expect the music preference may differ in accordance with weather condition. To reveal the correlation, we define event preference index as follows:

Fig. 5.
figure 5

Top 20 song titles of Mania Chart (2012–2015)

Given weather event W, the preference index of song Si is

$$ {\text{p}}_{{{\text{index}}\left( {{\text{X}}, {\text{W}}} \right)}} \equiv {{{\text{P}}\left({{\text{X }}\left| {\,{\text{W}}} \right.} \right)} \mathord{\left/{\vphantom {{{\text{P}}\left({{\text{X }}\left| {\,{\text{W}}} \right.} \right)} {{\text{P}}\left({{\text{X }}\left| {\, {\sim} {\text{W}}} \right.} \right)}}} \right. \kern-0pt} {{\text{P}}\left({{\text{X }}\left| {\, {\sim}{\text{W}}} \right.} \right)}} $$

where X denotes an event that the song Si shows up in the chart. \( {\text{P}}\left( {{\text{X }}\left| {\,{\text{W}}} \right.} \right) \) and \( {\text{P}}\left( {{\text{X }}\left| {\, {\sim} {\text{W}}} \right.} \right) \) can be calculated from the Mania Chart dataset. If p index value for a song over event “Rain” is near to 1.0, it implies the songs preference is marginally affected by the event. If the value is larger than 1.0, say 2.0, then the song is considered to be twice more preferred on a rainy day than other day. Values near to zero mean the song would not be listened on a rainy day on the contrary.

Figure 6 shows top 20 songs with highest p index value on Rain and Snow event that appear to be different with the list in Fig. 5. On a rainy day, songs that tell mostly loneliness after break-up are found to be preferred. Songs in a romantic mood tends to be listened more on snowy days. This infers that emotion factors make an impact on user’s music preference. We will proceed into deeper study on this correlation in the later sections.

Fig. 6.
figure 6

Songs preferable on Rain and Snow events

3 Methodology

3.1 Hypothesis

We suppose that latent emotion factors are affected by weather conditions and affect favorite music kinds. Hence, it is prudent to test the hypothesis by predicting preferable music based on weather condition and comparing the predicted music with the actual music chart. Furthermore, we took a deeper look at our recommendation model to comprehend the factors in it.

3.2 Preprocessing

We only consider songs that showed up in the music chart more than 50 times to build our model, which are 628 songs out of 9422. For the rest, we assumed that they do not have enough information to figure out the weather effect.

From weather dataset, we picked daily average temperature, average humidity, wind speed, dew point, air pressure, wind chill, heat index, and discomfort level as variables of our recommendation model. The variables are either z-normalized or discretized using quantile-based range partitioning (see Sect. 4 for more details). The discretized variables are converted into dummy variables with one-hot encoding.

To further characterize the daily weather features, we partitioned all the records (from 2012 to 2015) into eight groups using k-means clustering with the weather variables [13]. Each cluster and its centroid represent one weather condition group as described in Table 1. For instance, the first cluster represents cold and dry weather condition group, which mainly corresponds to winter season. The last one denotes hot weather with high discomfort level mainly in summer season. The second and third cluster represents monsoon season in Korea, which is hot and rainy in summer. This cluster information is added into our model according to its configuration as described in Sect. 4.

Table 1. Description of 8 weather condition clusters

3.3 Recommendation Model

We build two different music recommendation models, multi-class logistic regression model and alternating least square, ALS for short, model [10, 11]. For comparison, we design a baseline model that always recommend the same 100 songs that showed up in the chart most frequently. To evaluate the performance of each model, we randomly split the data of weather and music chart into test set and training set with ratio of 2:8. The training set is used to train our models. The test set is to measure the performance of each model.

For the multi-class logistic regression, we devise one logistic regression model for each song. The target variable is a binary variable that has value of 1 when the song is in the music chart and 0 when the song is not in the chart. Each logistic regression model predicts the probability of the song being in the chart on each day using weather variables. Given probability of each song, we pick top 100 songs with the highest probability and recommend those songs to user. Figure 7 illustrates the multi-class logistic regression model for song recommendation.

Fig. 7.
figure 7

Multi-class logistic regression model

Figure 8 shows ALS model for music recommendation model. We first construct n by m input matrix, where n is the number of combinations (cluster, season) and m is the number of songs we use for recommendation. Each element of input matrix represents the normalized number of times that each song ranked in the chart within the pair of cluster and season. By ALS algorithm [12], the input matrix decomposed into two matrices, A and B. Each row of A represents the cluster and season pair and each column represents magnitude of an emotion factor toward the cluster. For transpose of B, each row implies a song, and column means the magnitude of an emotion factor for the song. Given k emotion factors, if an emotion factor has a large positive number for a song and a cluster, then it increase the probability of the song being preferred in the cluster. On the contrary, an emotion factor that has large negative values for a song and cluster decreases the probability of the song being in the chart. For prediction, it first determines to which cluster the input weather condition belongs, and output the 100 songs with the highest values of the cluster in the matrix \( {\text{A}} \times {\text{B}} \).

Fig. 8.
figure 8

ALS for music recommendation

Considering our recommendation models more focus on the weather-effect than song’s popularity whereas baseline model only consider popularity, we construct a hybrid model of ALS and baseline with weight parameter \( \upalpha \), where we compute the score of each song as in Eq. 1. It recommends 100 songs with the highest scores.

$$ {\text{S}}\left( {\text{song}} \right) =\upalpha \times {\text{S}}_{\text{ALS}} ( {\text{song}}\left| {\,{\text{cluster}},{\text{season}}} \right. ) + (1 -\upalpha) \times {\text{S}}_{\text{baseline}} ({\text{song}} ) $$
(1)

4 Result and Discussion

4.1 Experimental Settings

We have used R and Python for preliminary study, modeling and testing. We used Scikit-learn library of Python for logistic regression model, and Pandas library for data preprocessing and management [12, 14]. Hardware and software specification are described in Table 2.

Table 2. Hardware and software configurations

For model training, we use weather variables of daily average temperature, average humidity, wind speed, dew point, air pressure, wind chill, heat index, and discomfort level. For logistic regression model, we normalized the variables for LR1 and discretized for LR2 as in Table 3. For LR3 and L4, we put additional variables of cluster ID and season to LR1 and LR2, respectively.

Table 3. Model configurations

4.2 Evaluation Measure

Our recommendation models and the baseline model recommend 100 songs given weather condition. To evaluate the accuracy of each recommendation, we define hit ratio for each prediction as the number of songs in both prediction and actual music chart of the day. We use the test set for evaluation, which we separated before model training. For example, we predict 100 songs for given weather condition, and 10 songs actually hit in the chart, then hit ratio is 10. For performance comparison, we calculate the average hit ratio for each recommendation model.

4.3 Result and Discussion

Figure 9(a) shows average hit ratio on the test set for each recommendation model according to the configuration in Table 3. The baseline model hits 13.32 songs on average. Logistic regression models outperform the baseline model up to 20.4 %. ALS increase the hit ratio 13.21 %. The result shows that the weather variables contribute to the music preference significantly.

Fig. 9.
figure 9

Comparing model performance (Color figure online)

On the other hands, it also implies there are other factors that affect to user emotion or music preference itself. As LR3 and LR4 introduce additional variables, season and cluster ID that capture more information about users, it models more accurately the music preference than LR1 and LR2. For example, the season variable may infer effect of annual events such as graduation ceremony, thanks-giving day, and sports event, which may not be captured by weather information. Accordingly, we include the season variable into ALS model as well.

Considering ALS model mostly focuses on variables related to the date, weather and season whereas Baseline model fully relies on the popularity of each song. Mixing them together would be a chance to improve our model. Hybrid model slightly improves the performance up to 1.3 % depending on the weight parameter \( \upalpha \). Figure 9(b) shows the performance of hybrids model with different \( \upalpha \) settings. The performance is maximum near the point of \( \upalpha = 0.7 \).

Figure 10 shows the average hit ratio in each month. In winter season, December, January, and February, the difference is marginal as weather effect becomes less significant. In summer season, June, July, and August, the weather effect becomes stronger as the weather changes more drastically than other seasons because of monsoon and typhoon. It can be also thought that hot and humid weather is more crucial for human emotion since summer season in Korea has high discomfort level, which indicates the actual discomfortness of weather to people’s activity.

Fig. 10.
figure 10

Average hit ratio in each month

5 Conclusion and Future Work

We have proven that associating weather condition with user emotion factors noticeably improves music recommendation system. It has a great chance to enrich the user experience in online music streaming service by reflecting factors that change dynamically. The finding are extendable to recommend music artists and music genre as well as songs alone to users.

Many other factors affect user emotion and music preference as well as weather condition. There are more chances to improve the recommendation by integrating personal and social factors such as social media activity, residential area, age, gender and social issues to the system. It is also challenging to recommend new songs and artists with no historical record.