error
gratefulbuaa opened this issue · comments
when I try the following example:
from scikits.crab.models import MatrixPreferenceDataModel
Build the model
model = MatrixPreferenceDataModel(movies.data)
from scikits.crab.metrics import pearson_correlation
from scikits.crab.similarities import UserSimilarityBuild the similarity
similarity = UserSimilarity(model, pearson_correlation)
from crab.recommenders.knn import UserBasedRecommender
Build the User based recommender
recommender = UserBasedRecommender(model, similarity, with_preference=True)
Recommend items for the user 5 (Toby)
recommender.recommend(5)
there is AttributeError:
AttributeError Traceback (most recent call last)
in ()
----> 1 recommender.recommend(5)
anaconda/lib/python2.7/site-packages/scikits/crab/recommenders/knn/classes.pyc in recommend(self, user_id, how_many, **params)
598 '''
599
--> 600 self._set_params(**params)
601
602 candidate_items = self.all_other_items(user_id, **params)
AttributeError: 'UserBasedRecommender' object has no attribute '_set_params'
I didn't find a function named "_set_params".
Can you give some suggestions how to solve this?