Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照官网上操作会报错 #115

Open
wpinchine opened this issue Aug 18, 2018 · 0 comments
Open

按照官网上操作会报错 #115

wpinchine opened this issue Aug 18, 2018 · 0 comments

Comments

@wpinchine
Copy link

from scikits.crab import datasets

movies = datasets.load_sample_movies()
songs = datasets.load_sample_songs()
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 UserSimilarity

Build the similarity

similarity = UserSimilarity(model, pearson_correlation)

from scikits.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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant