{"action":"created","comment":{"url":"https://api.github.com/repos/mangaki/mangaki/pulls/comments/111681950","pull_request_review_id":32942322,"id":111681950,"diff_hunk":"@@ -72,16 +72,11 @@ def dpp(self, nb_points):\n         \"\"\"\n         sample \"nb_points\" popular works which are far from each other (using DPP)\n         \"\"\"\n-        ratings_matrix = RatingsMatrix(Rating.objects.values_list('user_id',\n-                                                                  'work_id',\n-                                                                  'choice'))\n-        similarity = SimilarityMatrix(ratings_matrix.matrix, nb_components_svd=70)\n-        set_item_id_popular = set(self.popular()[:NB_POPULAR_WORKS].values_list('pk', flat=True))\n-        items = [ratings_matrix.item_dict[item] for item in ratings_matrix.item_set if item in set_item_id_popular]\n-        dpp = MangakiDPP(items, similarity.similarity_matrix)\n-        liste_dpp = dpp.sample_k(nb_points)\n-        liste_dpp_work_ids = [ratings_matrix.item_dict_inv[element] for element in liste_dpp]\n-        return self.filter(id__in=liste_dpp_work_ids)\n+        work_ids = self.popular().values_list('id', flat=True)[:100]","path":"mangaki/mangaki/models.py","position":23,"original_position":23,"commit_id":"90665904f0397d622e289e5ba244e4d26f79ccf2","original_commit_id":"90665904f0397d622e289e5ba244e4d26f79ccf2","user":{"login":"jilljenn","id":1729581,"avatar_url":"https://avatars2.githubusercontent.com/u/1729581?v=3","gravatar_id":"","url":"https://api.github.com/users/jilljenn","html_url":"https://github.com/jilljenn","followers_url":"https://api.github.com/users/jilljenn/followers","following_url":"https://api.github.com/users/jilljenn/following{/other_user}","gists_url":"https://api.github.com/users/jilljenn/gists{/gist_id}","starred_url":"https://api.github.com/users/jilljenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jilljenn/subscriptions","organizations_url":"https://api.github.com/users/jilljenn/orgs","repos_url":"https://api.github.com/users/jilljenn/repos","events_url":"https://api.github.com/users/jilljenn/events{/privacy}","received_events_url":"https://api.github.com/users/jilljenn/received_events","type":"User","site_admin":false},"body":"No, everything will be removed (ratings & similarity matrices).","created_at":"2017-04-16T10:26:14Z","updated_at":"2017-04-16T10:26:14Z","html_url":"https://github.com/mangaki/mangaki/pull/276#discussion_r111681950","pull_request_url":"https://api.github.com/repos/mangaki/mangaki/pulls/276","_links":{"self":{"href":"https://api.github.com/repos/mangaki/mangaki/pulls/comments/111681950"},"html":{"href":"https://github.com/mangaki/mangaki/pull/276#discussion_r111681950"},"pull_request":{"href":"https://api.github.com/repos/mangaki/mangaki/pulls/276"}}},"pull_request":{"url":"https://api.github.com/repos/mangaki/mangaki/pulls/276","id":112628193,"html_url":"https://github.com/mangaki/mangaki/pull/276","diff_url":"https://github.com/mangaki/mangaki/pull/276.diff","patch_url":"https://github.com/mangaki/mangaki/pull/276.patch","issue_url":"https://api.github.com/repos/mangaki/mangaki/issues/276","number":276,"state":"open","locked":false,"title":"Factor recommendation algorithms to handle backups","user":{"login":"jilljenn","id":1729581,"avatar_url":"https://avatars2.githubusercontent.com/u/1729581?v=3","gravatar_id":"","url":"https://api.github.com/users/jilljenn","html_url":"https://github.com/jilljenn","followers_url":"https://api.github.com/users/jilljenn/followers","following_url":"https://api.github.com/users/jilljenn/following{/other_user}","gists_url":"https://api.github.com/users/jilljenn/gists{/gist_id}","starred_url":"https://api.github.com/users/jilljenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jilljenn/subscriptions","organizations_url":"https://api.github.com/users/jilljenn/orgs","repos_url":"https://api.github.com/users/jilljenn/repos","events_url":"https://api.github.com/users/jilljenn/events{/privacy}","received_events_url":"https://api.github.com/users/jilljenn/received_events","type":"User","site_admin":false},"body":"There is a lot of cleanup here.\r\n\r\n- Fix KNN\r\n- Now users receive SVD recommendation if it exists, KNN otherwise\r\n- A user can order all their ratings based on the recommendation of any algorithm\r\n- Fix DPP\r\n\r\nThe main contributions are the functions:\r\n- `get_algo_backup` and `get_dataset_backup` that raise `FileNotFoundException` if such backup does not exist;\r\n- `get_pos_of_best_works_for_user_via_algo` that provides the ranking that some algorithm would give to some works to some user.\r\n\r\nIt simplifies everything!","created_at":"2017-03-26T13:52:46Z","updated_at":"2017-04-16T10:26:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9bed858f2063256b5210d64af1a7dbea932a74c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mangaki/mangaki/pulls/276/commits","review_comments_url":"https://api.github.com/repos/mangaki/mangaki/pulls/276/comments","review_comment_url":"https://api.github.com/repos/mangaki/mangaki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mangaki/mangaki/issues/276/comments","statuses_url":"https://api.github.com/repos/mangaki/mangaki/statuses/90665904f0397d622e289e5ba244e4d26f79ccf2","head":{"label":"mangaki:jj/fix-dpp","ref":"jj/fix-dpp","sha":"90665904f0397d622e289e5ba244e4d26f79ccf2","user":{"login":"mangaki","id":16416680,"avatar_url":"https://avatars2.githubusercontent.com/u/16416680?v=3","gravatar_id":"","url":"https://api.github.com/users/mangaki","html_url":"https://github.com/mangaki","followers_url":"https://api.github.com/users/mangaki/followers","following_url":"https://api.github.com/users/mangaki/following{/other_user}","gists_url":"https://api.github.com/users/mangaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mangaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangaki/subscriptions","organizations_url":"https://api.github.com/users/mangaki/orgs","repos_url":"https://api.github.com/users/mangaki/repos","events_url":"https://api.github.com/users/mangaki/events{/privacy}","received_events_url":"https://api.github.com/users/mangaki/received_events","type":"Organization","site_admin":false},"repo":{"id":48501368,"name":"mangaki","full_name":"mangaki/mangaki","owner":{"login":"mangaki","id":16416680,"avatar_url":"https://avatars2.githubusercontent.com/u/16416680?v=3","gravatar_id":"","url":"https://api.github.com/users/mangaki","html_url":"https://github.com/mangaki","followers_url":"https://api.github.com/users/mangaki/followers","following_url":"https://api.github.com/users/mangaki/following{/other_user}","gists_url":"https://api.github.com/users/mangaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mangaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangaki/subscriptions","organizations_url":"https://api.github.com/users/mangaki/orgs","repos_url":"https://api.github.com/users/mangaki/repos","events_url":"https://api.github.com/users/mangaki/events{/privacy}","received_events_url":"https://api.github.com/users/mangaki/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mangaki/mangaki","description":"Site de recommandation de mangas et d'anime","fork":false,"url":"https://api.github.com/repos/mangaki/mangaki","forks_url":"https://api.github.com/repos/mangaki/mangaki/forks","keys_url":"https://api.github.com/repos/mangaki/mangaki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mangaki/mangaki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mangaki/mangaki/teams","hooks_url":"https://api.github.com/repos/mangaki/mangaki/hooks","issue_events_url":"https://api.github.com/repos/mangaki/mangaki/issues/events{/number}","events_url":"https://api.github.com/repos/mangaki/mangaki/events","assignees_url":"https://api.github.com/repos/mangaki/mangaki/assignees{/user}","branches_url":"https://api.github.com/repos/mangaki/mangaki/branches{/branch}","tags_url":"https://api.github.com/repos/mangaki/mangaki/tags","blobs_url":"https://api.github.com/repos/mangaki/mangaki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mangaki/mangaki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mangaki/mangaki/git/refs{/sha}","trees_url":"https://api.github.com/repos/mangaki/mangaki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mangaki/mangaki/statuses/{sha}","languages_url":"https://api.github.com/repos/mangaki/mangaki/languages","stargazers_url":"https://api.github.com/repos/mangaki/mangaki/stargazers","contributors_url":"https://api.github.com/repos/mangaki/mangaki/contributors","subscribers_url":"https://api.github.com/repos/mangaki/mangaki/subscribers","subscription_url":"https://api.github.com/repos/mangaki/mangaki/subscription","commits_url":"https://api.github.com/repos/mangaki/mangaki/commits{/sha}","git_commits_url":"https://api.github.com/repos/mangaki/mangaki/git/commits{/sha}","comments_url":"https://api.github.com/repos/mangaki/mangaki/comments{/number}","issue_comment_url":"https://api.github.com/repos/mangaki/mangaki/issues/comments{/number}","contents_url":"https://api.github.com/repos/mangaki/mangaki/contents/{+path}","compare_url":"https://api.github.com/repos/mangaki/mangaki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mangaki/mangaki/merges","archive_url":"https://api.github.com/repos/mangaki/mangaki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mangaki/mangaki/downloads","issues_url":"https://api.github.com/repos/mangaki/mangaki/issues{/number}","pulls_url":"https://api.github.com/repos/mangaki/mangaki/pulls{/number}","milestones_url":"https://api.github.com/repos/mangaki/mangaki/milestones{/number}","notifications_url":"https://api.github.com/repos/mangaki/mangaki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mangaki/mangaki/labels{/name}","releases_url":"https://api.github.com/repos/mangaki/mangaki/releases{/id}","deployments_url":"https://api.github.com/repos/mangaki/mangaki/deployments","created_at":"2015-12-23T16:55:03Z","updated_at":"2017-04-01T16:35:13Z","pushed_at":"2017-04-16T08:49:22Z","git_url":"git://github.com/mangaki/mangaki.git","ssh_url":"git@github.com:mangaki/mangaki.git","clone_url":"https://github.com/mangaki/mangaki.git","svn_url":"https://github.com/mangaki/mangaki","homepage":"https://mangaki.fr","size":11403,"stargazers_count":39,"watchers_count":39,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":59,"forks":14,"open_issues":59,"watchers":39,"default_branch":"master"}},"base":{"label":"mangaki:master","ref":"master","sha":"bda0a37acda102ece2a5d3d44073d01e0d04985f","user":{"login":"mangaki","id":16416680,"avatar_url":"https://avatars2.githubusercontent.com/u/16416680?v=3","gravatar_id":"","url":"https://api.github.com/users/mangaki","html_url":"https://github.com/mangaki","followers_url":"https://api.github.com/users/mangaki/followers","following_url":"https://api.github.com/users/mangaki/following{/other_user}","gists_url":"https://api.github.com/users/mangaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mangaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangaki/subscriptions","organizations_url":"https://api.github.com/users/mangaki/orgs","repos_url":"https://api.github.com/users/mangaki/repos","events_url":"https://api.github.com/users/mangaki/events{/privacy}","received_events_url":"https://api.github.com/users/mangaki/received_events","type":"Organization","site_admin":false},"repo":{"id":48501368,"name":"mangaki","full_name":"mangaki/mangaki","owner":{"login":"mangaki","id":16416680,"avatar_url":"https://avatars2.githubusercontent.com/u/16416680?v=3","gravatar_id":"","url":"https://api.github.com/users/mangaki","html_url":"https://github.com/mangaki","followers_url":"https://api.github.com/users/mangaki/followers","following_url":"https://api.github.com/users/mangaki/following{/other_user}","gists_url":"https://api.github.com/users/mangaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mangaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangaki/subscriptions","organizations_url":"https://api.github.com/users/mangaki/orgs","repos_url":"https://api.github.com/users/mangaki/repos","events_url":"https://api.github.com/users/mangaki/events{/privacy}","received_events_url":"https://api.github.com/users/mangaki/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mangaki/mangaki","description":"Site de recommandation de mangas et d'anime","fork":false,"url":"https://api.github.com/repos/mangaki/mangaki","forks_url":"https://api.github.com/repos/mangaki/mangaki/forks","keys_url":"https://api.github.com/repos/mangaki/mangaki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mangaki/mangaki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mangaki/mangaki/teams","hooks_url":"https://api.github.com/repos/mangaki/mangaki/hooks","issue_events_url":"https://api.github.com/repos/mangaki/mangaki/issues/events{/number}","events_url":"https://api.github.com/repos/mangaki/mangaki/events","assignees_url":"https://api.github.com/repos/mangaki/mangaki/assignees{/user}","branches_url":"https://api.github.com/repos/mangaki/mangaki/branches{/branch}","tags_url":"https://api.github.com/repos/mangaki/mangaki/tags","blobs_url":"https://api.github.com/repos/mangaki/mangaki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mangaki/mangaki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mangaki/mangaki/git/refs{/sha}","trees_url":"https://api.github.com/repos/mangaki/mangaki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mangaki/mangaki/statuses/{sha}","languages_url":"https://api.github.com/repos/mangaki/mangaki/languages","stargazers_url":"https://api.github.com/repos/mangaki/mangaki/stargazers","contributors_url":"https://api.github.com/repos/mangaki/mangaki/contributors","subscribers_url":"https://api.github.com/repos/mangaki/mangaki/subscribers","subscription_url":"https://api.github.com/repos/mangaki/mangaki/subscription","commits_url":"https://api.github.com/repos/mangaki/mangaki/commits{/sha}","git_commits_url":"https://api.github.com/repos/mangaki/mangaki/git/commits{/sha}","comments_url":"https://api.github.com/repos/mangaki/mangaki/comments{/number}","issue_comment_url":"https://api.github.com/repos/mangaki/mangaki/issues/comments{/number}","contents_url":"https://api.github.com/repos/mangaki/mangaki/contents/{+path}","compare_url":"https://api.github.com/repos/mangaki/mangaki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mangaki/mangaki/merges","archive_url":"https://api.github.com/repos/mangaki/mangaki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mangaki/mangaki/downloads","issues_url":"https://api.github.com/repos/mangaki/mangaki/issues{/number}","pulls_url":"https://api.github.com/repos/mangaki/mangaki/pulls{/number}","milestones_url":"https://api.github.com/repos/mangaki/mangaki/milestones{/number}","notifications_url":"https://api.github.com/repos/mangaki/mangaki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mangaki/mangaki/labels{/name}","releases_url":"https://api.github.com/repos/mangaki/mangaki/releases{/id}","deployments_url":"https://api.github.com/repos/mangaki/mangaki/deployments","created_at":"2015-12-23T16:55:03Z","updated_at":"2017-04-01T16:35:13Z","pushed_at":"2017-04-16T08:49:22Z","git_url":"git://github.com/mangaki/mangaki.git","ssh_url":"git@github.com:mangaki/mangaki.git","clone_url":"https://github.com/mangaki/mangaki.git","svn_url":"https://github.com/mangaki/mangaki","homepage":"https://mangaki.fr","size":11403,"stargazers_count":39,"watchers_count":39,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":59,"forks":14,"open_issues":59,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mangaki/mangaki/pulls/276"},"html":{"href":"https://github.com/mangaki/mangaki/pull/276"},"issue":{"href":"https://api.github.com/repos/mangaki/mangaki/issues/276"},"comments":{"href":"https://api.github.com/repos/mangaki/mangaki/issues/276/comments"},"review_comments":{"href":"https://api.github.com/repos/mangaki/mangaki/pulls/276/comments"},"review_comment":{"href":"https://api.github.com/repos/mangaki/mangaki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mangaki/mangaki/pulls/276/commits"},"statuses":{"href":"https://api.github.com/repos/mangaki/mangaki/statuses/90665904f0397d622e289e5ba244e4d26f79ccf2"}}}}
{"actor":{"display_login":"jilljenn"}}