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

It contains a serious bug.

rabintang opened this issue · comments

In knn/classes.py UserBasedRecommender.estimate_preference, the following codes

  1. prefs = prefs[~np.isnan(prefs)] # prefs = [1, 2, 4]
  2. similarities = similarities[~np.isnan(prefs)] # similarities = [0.1, 0.2, 0.3], but actually it show be [0.1, 0.2, 0.4]
  3. prefs_sim = np.sum(prefs[~np.isnan(similarities)] * similarities[~np.isnan(similarities)])
    have a serious bug, assuming that initial prefs = [1, 2, non, 4], similarities = [0.1, 0.2, 0.3, 0.4].

do you have resolved it?