algorithm - how to calculate the percentage of match / absolute value -


hard explain...let me try:

i built script compare 2 users' interests (hobbies)

let's assume usera have 44 hobbies, , 13 in common userb (who has 19 hobbies) in pseudo code (where % formula):

    func %(usera,userb) = 13  ...etc..comparing other users      func %(usera, userc) = 2     func %(usera, userd) = 7 

given users' hobbies have no limit, can 100, 20 or infinite...

how can calculate , show percentage of "compatibility" between usera , rest of world?

because thought was, if knew 20 max numebr of hobbies, simple equation (bewteen user , b)

percent = 13 / 20 * 100 between usera , userb can display "you match 65%"

but problem dont know value 20 (the maxium number)! that's problem!

you're close.

in example, user compatibility percentage user b = 13 / 19 (total user b hobbies) = 68.4 %

user b compatibility percentage user = 13 / 44 (total user hobbies) = 29.5%


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -