问题描述
我有一个名为music的数据库表,其中包含用户,歌曲和评级(从1到5)。问题是基于对相同歌曲的评级来找到当前用户与同一桌子的其他用户的相关性。这里,相关性是计算那些听过当前歌曲的用户,即与当前歌曲匹配的用户。表格如下:
用户|歌曲|评分|
user1 | song1 | 3.5 |
user1 | song2 | 4.5 |
user1 | song3 | 5 |
user2 | song2 | 4 |
user2 | song3 | 4.5 |
user2 | song4 | 5 |
user3 | song4 | 1.5 |
user3 | song3 | 2.5 |
user3 | song1 | 3.5 |
等等。
如果user1正在收听song2那么user1和user2之间的相关性应该计算(不在user1和user3之间,因为song2没有被user3收听或评级)。在这里,应使用歌曲:song2和song3计算相关性,因为这两首歌曲与两个用户匹配
I have a database table called music that contains user, song and rating(from 1 to 5). The problem is to find correlation of current user with other users of same table on the basis of their rating on the same songs. Here correlation is to calculated of those users who had listened the current song i.e user matching with current song. The table is like:
User|song|rating|
user1 | song1 | 3.5 |
user1 | song2 | 4.5 |
user1 | song3 | 5 |
user2 | song2 | 4 |
user2 | song3 | 4.5 |
user2 | song4 | 5 |
user3 | song4 | 1.5 |
user3 | song3 | 2.5 |
user3 | song1 | 3.5 |
and so on.
if user1 is listening song2 then the correlation between user1 and user2 should be calculated(not between user1 and user3 because song2 is not listened or rated by user3). Here, correlation should be calculated using songs: song2 and song3 because these two songs are matched to both users
推荐答案
这篇关于在asp.net中实现pearson关联的SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!