php - Best Algorithm for choosing the right data to present to the user based on his choices -


i'm working on project tries match events in city based on interests of user. basically, end user in front end has select interests (culture, sports, fun, food...there 8 of them) values range 0 10. in end (where events created) webmaster can choose score each category (culture, sports, fun...the same front end). best algorithm use find relevant results based on user input? i'm using php (although think not language specific question).

compare each of scores of events user profile. lower deviation, better event matches user's interest.

in sql this:

select ... `events` ...   order (     abs(`culture` - $culture)      + abs(`sports` - $sports)      + abs(`fun` - $fun)      + ... ) asc 

you weight scores according distribution of points in user profile. means if user has $culture = 10 , other scores 0, particularly interested in culture , may better results with

select ... `events` ...   order (     (abs(`culture` - $culture) * $cultureimportance)     + (abs(`sports` - $sports) * $sportsimportance)     + (abs(`fun` - $fun) * $funimportance)     + ... ) asc 

where importance of each score deviation of score mean of scores of user.

you add "spice" importance values, e.g. push sport events during time of superbowl make site more zeitgeisty.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -