Skip to content

Algorithm Description

maubinle edited this page May 10, 2016 · 3 revisions

The algorithm works in the following way:

In the UserInterestService, a hashmap is saved for each interested suggestiontype, for example Professor Name, University Name, Subfield, etc. The UserInterestService sends requests to the database for that user's past interactions, and the hashmaps are populated with a score based on how much interaction that user has had with each field. As the user interacts with Drafty, these hashmaps are updated dynamically. When a user clicks on a field, their interest is recorded for that field (e.g. click on Brown University -> saves 3 points for Brown in the uni hashmap) but also for their tangential information (e.g. click on Brown University by Jeff Huang's name -> saves 1 point for Jeff in the prof hashmap, and 1 point for HCI in the subfield hashmap). Thus we have an up-to-date view of the user's interest profile.

When we want to ask a user to make a suggestion, the getInterestField() in the InteractionService method is called. This creates two things: a NavigableMap and a NoInterestList. For each professor in the database, the user hashmaps are compared against the fields for that professor currently in the database. If any match, the corresponding number in the hashmap is added to the score for that professor. This is recorded in the NavigableMap as a cumulative probability in the form (probability/score, professor ID). We then randomise an integer between 0 and the overall score, and use the NavigableMap to return the first professor whose score is greater than or equal to this randomised value. This allows us to select a Professor by likelihood. Then, we randomise a relevant column number (not including PhotoURL, Sources, or Prof Name) and return the given field.

To get a field the user has no interest in, the getNoInterest() method in the InteractionService is called. If the score for a professor is 0 when it is calculated, their name is added to the noInterestList. If the user is interested in everything (very unlikely), a noInterestList will be calculated for all scores 1 or below, then 2 or below, then 4 or below, etc. We then simply randomise which professor in the noInterestList to ask them about, and which column to ask them about.

Clone this wiki locally