简体   繁体   中英

How to calculate the percentage similarity of two users?

I have some details about two users that are common in both. I want to know how can I get the percentage similarity of both users: UserA and UserB have: `

5 mutual friends

8 common products purchased

3 same samples received

9 common followers

etc This makes up to a sum of 25 common attributes.`

How can I get the % similarity of both users, Any formula or method ?

Have you tried (number of products in common / number of products purchased) * 100 ? That's typically how you figure out a percentage. Add up the number of common things and divide it by the total number of things.

If user A has bought 10 things, and user B has bought 20 things, and 5 of A's are the same as 5 of B's, you'd have:

((5 + 5) / (10 + 20)) * 100 = 33.3% similar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM