muricoca / crab

Crab is a flexible, fast recommender engine for Python that integrates classic information filtering recommendation algorithms in the world of scientific Python packages (numpy, scipy, matplotlib).

Home Page:http://muricoca.github.com/crab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

most_similar_users to Boolean Model does not work propperly

marcelcaraciolo opened this issue · 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])