{'fraction_non_alphanumeric': 0.02040440329786744, 'fraction_numerical': 0.008567085809036893, 'mean_word_length': 5.182232346241458, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Homophily of Music Listening in Online Social Networks

Homophily, ranging from demographics to sentiments, breeds connections in social networks, either offline or online. However, with the prosperous growth of music streaming service, whether homophily exists in online music listening remains unclear. In this study, two online social networks of a same group of active users are established respectively in Netease Music and Weibo. Through presented multiple similarity measures, it is evidently demonstrated that homophily does exist in music listening of both online social networks. The unexpected music similarity in Weibo also implies that knowledge from generic social networks can be confidently transfered to domain-oriented networks for context enrichment and algorithm enhancement. Comprehensive factors that might function in formation of homophily are further probed and many interesting patterns are profoundly revealed. It is found that female friends are more homogeneous in music listening and positive and energetic songs significantly pull users close. Our methodology and findings would shed lights on realistic applications in online music services.


Introduction
One of the best established findings in social networks is that people who are friends exhibit plenty of similarities in human behaviors [1,2]. Friendship relations, either offline or online, in which individuals socially interact, involve a need for shared mutual understandings. Tremendous efforts have been devoted on homophily of social networks from many aspects, ranging from demographics [3] to mental states [4,5]. Even it is revealed from the recent study that personality similarity exists among close relationships [6]. Particularly, with the booming of online social media, previous studies have extensively investigated the homophily of behaviors in online social networks [7,8,9] and the friend similarity that exists in face-to-face offline networks is identically revealed.
However, as a prominent element of daily life that possesses the cultural universality [10,11,12], music listening is rarely explored in the context of social networks and little knowledge is established about the behavior referring to homophily, especially in the circumstance of online social networks.
ship between listening similarity and online social networks has not been comprehensively explored and understood yet. Specifically, questions like whether we enjoy the music at which the online friends are enchanted, in other words, whether the homophily of music listening exists in online social networks, still deserve a systemic investigation.
Until recently, empirical research willing to answer the questions about music listening had to depend on interviews and surveys in controlled environments [23,24] with inevitable limitations in both data scale and granularity.
While in fact, the technological and societal evolutions that sustain the emergence of online music listening indeed provide unparalleled opportunities for human behavior understanding. Detailed footprints, including where, when and how massive individuals listen music can be regarded as a big-data window network and Weibo network are respectively constructed through user followings in Netease Music and Weibo. To examine whether the music listening is homogeneous for users jointed by online social networks, similarities from six perspectives are defined and measured. In order to investigate the crucial factors influencing the music listening homophily, subjectives are clustered into different categories from multiple perspectives like social attributes, musical preferences or etc. Our results demonstrate that friends linked by online social networks indeed appreciate the identical songs and possess the similar music preferences. As for gender, patterns for music listening between female friends are closer than male friends, implying that women are more sensitive for emotional expression through music [27,28]. Listening practices of the friends with common music preferences in the current culture are similar especially for music languages (Chinese) and genres (pop and folk). With regard to musical mood, the users who enjoy exciting, wild and happy music share more similarities in music listening. It is also difficult for users owning high musical diversity to find friends with similar musical tastes. The present study confirms evidently the existing of homophily in music listening of online social networks and elaborately clarify the roles of human demographics and music traits in influencing the homophily. Our findings would shed insightful lights on music recommendation and friend suggestion in online applications. We merge different social circles of an individual and surprisingly reveal that generic social networks like Weibo still demonstrate significantly the homophily that intuitively only exists in domain-oriented networks. It indeed implies that rich information in general social media can be confidently introduced into the study of specialized social networks [29].

Netease Music Dataset
Digital service providers began to amass large user bases, offering the primary sources of digital music streaming via the Internet increasingly. New innovations, including digitalization and the Internet, transform the existing landscape over the past decade and attracted new artists and listeners into the fields, and digital music streaming services has also profoundly reshaped the user behaviors. China follows this global trend and has become a leading digital country in terms of music services. The Netease Music is one of the most trending music streaming providers in China, whose special trait is the music social network. Users are allowed to follow others in the platform, such as friends and artists. Therefore, this music platform has become a new and booming social network of domain-oriented.
The web site of Netease Music provides abundant online information about users, playlists and music. We develop an excellent crawler aiming at Netease Music platform first to perform the data collection. Our crawler adapts massive agent servers and each agent will simulate a real user to visit pages and click  nately, due to the official limit on viewing following list, we only obtain the latest 1,000 following relations. Nevertheless, according to theory of Dunbar's number, the maximum size of ego-network averages 150 [30,31,32], implying that the latest one thousand followings could sufficiently reflect recently active social connections the user possesses. Similarly, due the limit on tweets viewing, for each Weibo user only its latest 1000 (or less if not enough) tweets can be obtained.

Two Social Networks
We further refine the subjects of the present study by selecting active users from both datasets. Specifically, active users are defined as those have listened complete songs at least 1000 times and posted over 100 tweets. The complementary cumulative distribution function (CCDF) of the number of users in music listening and tweeting is depicted in Fig 1. As can be seen in Fig 1a, for the majority of users, the number of music listening is lower than 10 4 . The percent of users that listen music over 1000 times is lower than 55%. As shown in Fig 1b, about 70% of users tweet 100 times at least. Note that owing to the limit of Weibo, the maximum of number of tweets is 1000. After the refinement, totally 25,953 active users are filtered out to be subjectives of further explorations.
Regarding to the same group of active users, two social networks are then respectively established from the following relationships in Netease Music and Weibo. The first one, named Netease network, contains 89,988 links. The second one, named Weibo network, contains 112,753 links. And these two networks share the 25,953 identical nodes, implying that we construct an ideal scenario to reveal the homophily of music listening in both domain-oriented social network and generic social network. It is worthy noting that here we regard social networks as undirected graphs. The degree distributions of Netease network and Weibo network are demonstrated in Fig 2 and the power-law trending implies the consistence to existing understanding of typical social networks [33]. As for Netease network (γ = 2.12), the distribution evidently shows a long tail, indicating there are few users with large amount of relationships in social network of music-oriented. As for Weibo network (γ = 2.07), a power-law like distribution is observed as degree lower than 500, however, a exponential cutoff then emerges and the maximum degree is 100, both due to the API limit of Weibo.

Similarities of music listening
Based on the personal historical listening and like records, we define six types of similarities with respect to music listening for any pair of users A and  The degree exponent γ of networks are respectively 2.12 and 2.07 (2 < γ < 3).
B in both social networks. And higher similarities suggest more significant homophily in social networks.
The historical listening records for A and B are denoted as H A and H B , respectively and in which top 100 songs of high-frequency are included. The historical similarity sim song , indicating the number of co-occurrence songs in top records can be thus defined as For presenting measures of similarity from aspects of music traits, we first in which c stands for traits and can be language, genre, mood or scene. Finally, based on the feature vectors of 3.2 million songs, traits vectors for 25,953 active users are derived and normalized to z-cores. Then the similarity of user pair A and B can be intuitively measured through cosine distance between their traits vectors, which is defined as Note that −1 sim c 1 and values closer to 1 indicate more similar music preferences. And as c varies over different music traits, we accordingly obtain four music preference similarities from perspectives of languages, genres, moods and scenes.
In addition, the similarity of favorite songs can also reflect the strength of homophily in music preference. Different from historical listening records, the number of songs in like record is not limited. Therefore we define the Jaccard distance as the similarity for like records between users A and B as in which L stands for the set of one's favorite songs.
To sum up, from the above we obtain six similarities referring to music listening and higher similarities indicate more significant homophily in music listening of online social networks. These measures pave the way for quantitative investigations of homophily in this study.

User classifications
Many factors in social networks might influence the homophily between friends. In order to reveal the crucial factors, demographics, social attributes and listening behaviors of active users are further probed for detailed understanding of their roles in homophily of music listening. We argue that regarding these factors as features, active users can be thus clustered into groups from multiple perspectives and discriminations of inter-groups offer windows of homophily investigation and factor weighing.
Gender is one of the most significant demographics in understanding human behaviors. We extract gender from Weibo profiles and split active users into 10,388 female ones and 15,565 male ones. Whether a user is officially verified by Weibo can be an indicator of influence and through the 'verified' labels active users are split into 24,368 non-verified ones and 1,585 verified ones. In addition, social attributes that reflect users' ranks in the social network can be well modeled through the number of the followers (N ER) as well as RF F that defined as the rate of f ollowing numbers to f ollowed numbers (log( N ER+1 N EE+1 ), in which N EE refers to the number of the users' followees). Given the fact that both N ER and RF F are continuous variables, the discretization based on K-means clustering is employed to categorize active users into groups of low rank and high rank respectively based on these two attributes.
Patterns of online music consumption could be sufficiently reflected in terms of users' music preferences that result in behavioral differences directly. Hence active users can also be clustered into groups from the perspective of music preference. The traits vector U c can be features representing users in clustering and the preference feature matrix of c is accordingly constructed for all users.
The matrix is de-correlated by principal component analysis (PCA) with full covariance and then the approach of K-means is employed to cluster active users into groups. Clusterings based on all traits are denoted separately as C mood , C language and C genre , indicating that for each trait active users are grouped into three clusters with divergent patterns of music preferences. In order to better interpret the clusterings, for groups of each clustering, the group feature defined as the mean user feature within the group is calculated. Then the semantic of each group is explained by the top 3 attributes of the group feature. Table 1 reports the clusterings and group interpretations. As can be seen, groups of each clustering could be well explained by the top attributes, suggesting that our methods indeed capture the music preferences and behavioral patterns in music listening can be effectively detected.
In the meantime, as exploited in previous efforts [34,26], diversity of musical preferences is also an indicator of great significance in reflecting listening behaviors. We draw on the concept of entropy [35] to define users' diversity in in which p(u c,i ) refers to the proportion of i-th attribute in user vector of trait c.
Higher diversity implies the user's more appreciations for variety of experience in music listening. We then employ K-means to cluster active users into highdiversity and low-diversity groups respectively. indicating that A and B possess different genders.

Existence of homophily
Being direct indicators of homophily, similarities from different perspectives are first investigated in the two social networks constructed from Netease and Weibo. Meanwhile, in order to testify the significance of the similarity distribution, for each realistic network, in terms of shuffling nodes a random counterpart is also built for base lines.
The CCDF of sim song , as can be seen in Fig. 3, demonstrates that similarities of actual networks are evidently higher than that of random networks, especially when sim song > 5, indicating that friends in online social network inclines to listen same songs and the homophily in music listening significantly exists.
Particularly, as compared to Weibo network, friendships in Netease network are slightly closer, implying that from the perspective of listening same songs, homophily is enhanced in the music-oriented social network.
CCDFs of similarities in perspectives of music preferences are further investigated, as can be seen in Fig 4. Similar to observations of sim song , it is consistently demonstrated that the friend similarity in music preferences is significant, suggesting the existing of homophily in music listening of online social network. Even more interesting, homophily in Netease network is more evident than that of Weibo network, implying again that friends are more homogeneous in domain-oriented social networks than the generic counterparts. However, as for the measure of sim like that shown in Fig 5, there is no evidence for the existing of homophily because the similarity of friends in 'like' behavior of online networks are close to or even lower than that in random networks. To sum up, in terms of similarity metrics except the one regarding to 'like' behavior, homophily of music listening in online social networks, especially the one of music-oriented, is significantly demonstrated and confirmed. Friends connected in online social networks indeed enjoy identical music and share similar music preferences. The absence of homophily in 'like' behavior suggests that even in homogeneous online social networks, individual differences still exist across friends. Although the homophily in specialized network is slightly more significant, we indeed find the same behavior pattern in generic networks like Weibo where the relationships are bonded with more common interests. It further implies that social media like Weibo can be generic but typical instances of online social networks. We further explore the important factors which affect the listening similarity in the Weibo network.

Critical factors for homophily
Given the rich backgrounds of active users carried by Weibo, we further investigate how characteristics of social ties, i.e., factors influence the homophily vectors are also used to cluster the individuals. It could take a mistake when the dependent variable and some independent variables are calculated from the same source. Therefore, we only consider sim song as the dependent variable to predict in regression analysis. As can be seen, Table 2 presents the multiple regression results of nineteen factors function on the homophily.
As for gender, the coefficients of male are higher than that of female, indicating that relationships in online social network between female users are more homogeneous in music listening. Yet the correlations between listening similarities and the verification statuses are not significant due to trivial coefficients.
For social attributes N ER0 and RF F 0 that reflecting individual extraversion and openness [36,37], coefficients are significantly higher than that of N ER1 and RF F 1, implying that users of low extroversion and openness demonstrate more homophily in music listening.
For factors from perspective of music preferences, the positive coefficients shown in Table 2 indicate that users within the same group of clusterings referring to preferences of language and mood are similar. As for the language preference, users in the group of Chinese are more similar than those in other groups. Pop music and folk music are known as the mainstream genres in China.
As for genres, it can be found that the users following pop and folk genre are significantly more similar. According to the results for languages and genres, we suggest that the friends in online social networks, whose music preferences accord with the mass taste, are always listening to the similar music. From the perspective of moods, the coefficients of the factor 'exciting, wild and happy' is the highest for sim song . It demonstrates that people who like the positive and energetic songs are more homogeneous in music listening. In addition, we investigate whether the diversity (div0 and div1) of music consumption is an influential factor for listening similarity. The results show that users with low musical diversity are more similar. However, users that enjoys multiple types of music, always own the uncommon and unique preferences and it is difficult for them to find friends sharing alike musical preferences.

Discussion
The booming of social media greatly facilitates exploitations of social networks by offering an unprecedented big-data window. In the present study, aiming at understanding homophily of music listening in online social networks, two networks with a same group of active users from Netease Music and Weibo are separately built for probing six measures of homophily. It is confirmed significantly that homophily exists in music listening of online social networks, even for the generic one from Weibo. Factors of social ties ranging from demographics to music preferences are further investigated in influencing homophily and many interesting patterns are revealed. To our best knowledge, for the first time a systematic and comprehensive study of music homophily is performed in a manner of data-driven solution.
In the meantime, we are also the first to construct a big music data through matching active users in both music stream platform and Weibo. The unexpected existing of homophily in Weibo suggests that the knowledge from generic social networks can be confidently introduced and transfered to the study [38] and application [29] of domain-oriented social networks, which will essentially enrich the context of subjectives. Previous investigation shows that human averagely spend 17% of life in music listening [39]. Nevertheless, massive behavior data is still missing in existing studies. By combing behavioral and demographical data from different online social networks, our study demonstrates that explorations of music listening can be profoundly boosted.
In fact, music steaming platforms have been experiencing a fast growing stage with increasing influence through establishment of musical environments tailored to individual preferences. Plenty of music service providers use the relationships between online friends to estimate users' musical tastes and then recommend music [40]. In our study, we provide a solid evidence for the homophily of music listening both in specialized online social network and the generic network, suggesting that no matter specialized or generic social networks can serve as high quality sources of music recommendation [41,42]. We argue that the homophily should be exploited in building and enhancing music services. Specifically, the influential factors that function on listening similarities can be directly introduced into the design of music recommendation algorithms and coefficients we obtained can be principal weights of those factors. Taking gender as an example, music platforms could put more emphasis on female friends when recommend music to female users.