muricoca/crab

most_similar_users to Boolean Model does not work propperly

Closed this issue · 0 comments

The method most_similar_users does not work properly with boolean models since the similarity returns 0.0 when the similarity is null different from ratings model which returns np.nan

def most_similar_users(self, user_id, how_many=None):
'''
Return the most similar users to the given user, ordered
from most similar to least.

    Parameters
    -----------
   ....
    return np.array([to_user_id for to_user_id, pref in similarities \
        if user_id != to_user_id and not np.isnan(pref) and pref != 0.0])