How to measure a relationship between interests of topics between two users? I was trying to find a way to calculate the relationship between two Users and their interests. A user can have multiples interests, and an interest can be duplicated in a user's interests. Example:

User1: {
   interests: {"golf": 3, "baseball: 1", "tenis: 2"}
}
 User2: {
   interests: {"golf": 5, "baseball": 1, "football": 4}
}
 User3: {
   interests: {"golf": 1, "baseball": 1, "tenis": 1}
}


Comparing User1 &amp; User2:

They have in common 2 interests, but User2 seems to be a very fan of golf.

Comparing User1 &amp; User2:

They have in common 3 interests, while User3 seems to have a slightly interest in all common interests, not being a very fan of any interests listed.

What I want do to is

The relationship between User1 and User2 should be a higher number than the relationship between User1 and User3, knowing that User3 has only a superficial interest in the topics, and User2 is more likely to be a fan like User1 to golf, for example, meaning that they may want to know each other and etc.

e.g. User1&amp;User2  = 2.5; User1&amp;User3 = 1.8

I tried to use the mean of the intersection of all interests between User-k and User-y and it seemed a reasonable approach, but I think it can have a better way to do this. Suggestions?

Thanks!
You can create a sparse user-interest matrix, impute missing values with some reasonable value, and apply a similarity function. E.g., center all non-missing values on 0 and mutate each value to adjust for the user's and interest's mean. Then impute 0s for all missing data, and use a traditional similarity function like cosine.

You might also use Bayesian methods. You could model the relationship between users and interests. In this way you wouldn't have to impute missing data and it would account for confidence in inference and prediction.