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

Return of Recommenders with with_preference = True is all strings.

marcelcaraciolo opened this issue · comments

When calls from Recommenders the methods to compute the recommendations or similarities the return is coming all string:

For instance:
#1. Catch the nearest neighbors based on Friends.
neighborhood = NearestNeighborsStrategy()

    #2. Followers Similarity
    model = MongoBooleanUserDataModel('followers')
    similarity = UserSimilarity(model, jaccard_coefficient)

    f_model = MongoBooleanUserDataModel('friends')

    #2.Recommend Friends based on Friends Similarity.
    recsys_followers = SocialBasedRecommender(f_model, similarity, neighborhood)

    user_id = 'ricardocaspirro'
    assert_array_equal(np.array([[u'luciananunes', u'0.5'], [u'brunomelo', u'0.5']]),
                recsys_followers.recommend(user_id, 4))        

You can see the return above all string (0.5 , 0.5) the correct output would be both as float values.