{"action":"created","comment":{"url":"https://api.github.com/repos/romanie/Diploma/pulls/comments/64205824","id":64205824,"diff_hunk":"@@ -21,14 +21,17 @@ def mean_average_precision(predicted_probability_distribution,\n     k = -1\n     for row in predicted_probability_distribution:\n         k += 1\n-        classes_by_prob = []\n+        prob_of_class = 0\n+        place = 1\n         for i in xrange(0, len(list_of_classes)):\n-            classes_by_prob.append([row[i], list_of_classes[i]])\n-        classes_by_prob.sort(reverse=True)    \n-        for j in range (0, min(5, len(classes_by_prob))):\n-            if classes_by_prob[j][1] == test_y[k]:\n-                total_error += 1.0 / (j + 1)\n-    \n+            if list_of_classes[i] == test_y[k]:\n+                prob_of_class = row[i]","path":"diplom.py","position":15,"original_position":15,"commit_id":"1ae7885ec8ad8383fe8430ce29f1828d135ca480","original_commit_id":"1ae7885ec8ad8383fe8430ce29f1828d135ca480","user":{"login":"romanie","id":5777698,"avatar_url":"https://avatars.githubusercontent.com/u/5777698?v=3","gravatar_id":"","url":"https://api.github.com/users/romanie","html_url":"https://github.com/romanie","followers_url":"https://api.github.com/users/romanie/followers","following_url":"https://api.github.com/users/romanie/following{/other_user}","gists_url":"https://api.github.com/users/romanie/gists{/gist_id}","starred_url":"https://api.github.com/users/romanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanie/subscriptions","organizations_url":"https://api.github.com/users/romanie/orgs","repos_url":"https://api.github.com/users/romanie/repos","events_url":"https://api.github.com/users/romanie/events{/privacy}","received_events_url":"https://api.github.com/users/romanie/received_events","type":"User","site_admin":false},"body":"rename `prob_of_class` to `prob_of_target_class`","created_at":"2016-05-23T11:17:44Z","updated_at":"2016-05-23T11:17:44Z","html_url":"https://github.com/romanie/Diploma/pull/8#discussion_r64205824","pull_request_url":"https://api.github.com/repos/romanie/Diploma/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/romanie/Diploma/pulls/comments/64205824"},"html":{"href":"https://github.com/romanie/Diploma/pull/8#discussion_r64205824"},"pull_request":{"href":"https://api.github.com/repos/romanie/Diploma/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/romanie/Diploma/pulls/8","id":71034632,"html_url":"https://github.com/romanie/Diploma/pull/8","diff_url":"https://github.com/romanie/Diploma/pull/8.diff","patch_url":"https://github.com/romanie/Diploma/pull/8.patch","issue_url":"https://api.github.com/repos/romanie/Diploma/issues/8","number":8,"state":"open","locked":false,"title":"Optimizing MAP metric","user":{"login":"romanie","id":5777698,"avatar_url":"https://avatars.githubusercontent.com/u/5777698?v=3","gravatar_id":"","url":"https://api.github.com/users/romanie","html_url":"https://github.com/romanie","followers_url":"https://api.github.com/users/romanie/followers","following_url":"https://api.github.com/users/romanie/following{/other_user}","gists_url":"https://api.github.com/users/romanie/gists{/gist_id}","starred_url":"https://api.github.com/users/romanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanie/subscriptions","organizations_url":"https://api.github.com/users/romanie/orgs","repos_url":"https://api.github.com/users/romanie/repos","events_url":"https://api.github.com/users/romanie/events{/privacy}","received_events_url":"https://api.github.com/users/romanie/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-23T10:01:17Z","updated_at":"2016-05-23T11:17:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8618e1aa99d3777eed0142dfc831c5d373089377","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/romanie/Diploma/pulls/8/commits","review_comments_url":"https://api.github.com/repos/romanie/Diploma/pulls/8/comments","review_comment_url":"https://api.github.com/repos/romanie/Diploma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/romanie/Diploma/issues/8/comments","statuses_url":"https://api.github.com/repos/romanie/Diploma/statuses/1ae7885ec8ad8383fe8430ce29f1828d135ca480","head":{"label":"romanie:dev","ref":"dev","sha":"1ae7885ec8ad8383fe8430ce29f1828d135ca480","user":{"login":"romanie","id":5777698,"avatar_url":"https://avatars.githubusercontent.com/u/5777698?v=3","gravatar_id":"","url":"https://api.github.com/users/romanie","html_url":"https://github.com/romanie","followers_url":"https://api.github.com/users/romanie/followers","following_url":"https://api.github.com/users/romanie/following{/other_user}","gists_url":"https://api.github.com/users/romanie/gists{/gist_id}","starred_url":"https://api.github.com/users/romanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanie/subscriptions","organizations_url":"https://api.github.com/users/romanie/orgs","repos_url":"https://api.github.com/users/romanie/repos","events_url":"https://api.github.com/users/romanie/events{/privacy}","received_events_url":"https://api.github.com/users/romanie/received_events","type":"User","site_admin":false},"repo":{"id":58581995,"name":"Diploma","full_name":"romanie/Diploma","owner":{"login":"romanie","id":5777698,"avatar_url":"https://avatars.githubusercontent.com/u/5777698?v=3","gravatar_id":"","url":"https://api.github.com/users/romanie","html_url":"https://github.com/romanie","followers_url":"https://api.github.com/users/romanie/followers","following_url":"https://api.github.com/users/romanie/following{/other_user}","gists_url":"https://api.github.com/users/romanie/gists{/gist_id}","starred_url":"https://api.github.com/users/romanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanie/subscriptions","organizations_url":"https://api.github.com/users/romanie/orgs","repos_url":"https://api.github.com/users/romanie/repos","events_url":"https://api.github.com/users/romanie/events{/privacy}","received_events_url":"https://api.github.com/users/romanie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romanie/Diploma","description":null,"fork":false,"url":"https://api.github.com/repos/romanie/Diploma","forks_url":"https://api.github.com/repos/romanie/Diploma/forks","keys_url":"https://api.github.com/repos/romanie/Diploma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romanie/Diploma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romanie/Diploma/teams","hooks_url":"https://api.github.com/repos/romanie/Diploma/hooks","issue_events_url":"https://api.github.com/repos/romanie/Diploma/issues/events{/number}","events_url":"https://api.github.com/repos/romanie/Diploma/events","assignees_url":"https://api.github.com/repos/romanie/Diploma/assignees{/user}","branches_url":"https://api.github.com/repos/romanie/Diploma/branches{/branch}","tags_url":"https://api.github.com/repos/romanie/Diploma/tags","blobs_url":"https://api.github.com/repos/romanie/Diploma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romanie/Diploma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romanie/Diploma/git/refs{/sha}","trees_url":"https://api.github.com/repos/romanie/Diploma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romanie/Diploma/statuses/{sha}","languages_url":"https://api.github.com/repos/romanie/Diploma/languages","stargazers_url":"https://api.github.com/repos/romanie/Diploma/stargazers","contributors_url":"https://api.github.com/repos/romanie/Diploma/contributors","subscribers_url":"https://api.github.com/repos/romanie/Diploma/subscribers","subscription_url":"https://api.github.com/repos/romanie/Diploma/subscription","commits_url":"https://api.github.com/repos/romanie/Diploma/commits{/sha}","git_commits_url":"https://api.github.com/repos/romanie/Diploma/git/commits{/sha}","comments_url":"https://api.github.com/repos/romanie/Diploma/comments{/number}","issue_comment_url":"https://api.github.com/repos/romanie/Diploma/issues/comments{/number}","contents_url":"https://api.github.com/repos/romanie/Diploma/contents/{+path}","compare_url":"https://api.github.com/repos/romanie/Diploma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romanie/Diploma/merges","archive_url":"https://api.github.com/repos/romanie/Diploma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romanie/Diploma/downloads","issues_url":"https://api.github.com/repos/romanie/Diploma/issues{/number}","pulls_url":"https://api.github.com/repos/romanie/Diploma/pulls{/number}","milestones_url":"https://api.github.com/repos/romanie/Diploma/milestones{/number}","notifications_url":"https://api.github.com/repos/romanie/Diploma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romanie/Diploma/labels{/name}","releases_url":"https://api.github.com/repos/romanie/Diploma/releases{/id}","deployments_url":"https://api.github.com/repos/romanie/Diploma/deployments","created_at":"2016-05-11T21:12:41Z","updated_at":"2016-05-12T12:31:09Z","pushed_at":"2016-05-23T11:05:49Z","git_url":"git://github.com/romanie/Diploma.git","ssh_url":"git@github.com:romanie/Diploma.git","clone_url":"https://github.com/romanie/Diploma.git","svn_url":"https://github.com/romanie/Diploma","homepage":null,"size":15,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"romanie:master","ref":"master","sha":"f7327183b9b6cd90af6adb75f3db1de2422cfe64","user":{"login":"romanie","id":5777698,"avatar_url":"https://avatars.githubusercontent.com/u/5777698?v=3","gravatar_id":"","url":"https://api.github.com/users/romanie","html_url":"https://github.com/romanie","followers_url":"https://api.github.com/users/romanie/followers","following_url":"https://api.github.com/users/romanie/following{/other_user}","gists_url":"https://api.github.com/users/romanie/gists{/gist_id}","starred_url":"https://api.github.com/users/romanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanie/subscriptions","organizations_url":"https://api.github.com/users/romanie/orgs","repos_url":"https://api.github.com/users/romanie/repos","events_url":"https://api.github.com/users/romanie/events{/privacy}","received_events_url":"https://api.github.com/users/romanie/received_events","type":"User","site_admin":false},"repo":{"id":58581995,"name":"Diploma","full_name":"romanie/Diploma","owner":{"login":"romanie","id":5777698,"avatar_url":"https://avatars.githubusercontent.com/u/5777698?v=3","gravatar_id":"","url":"https://api.github.com/users/romanie","html_url":"https://github.com/romanie","followers_url":"https://api.github.com/users/romanie/followers","following_url":"https://api.github.com/users/romanie/following{/other_user}","gists_url":"https://api.github.com/users/romanie/gists{/gist_id}","starred_url":"https://api.github.com/users/romanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanie/subscriptions","organizations_url":"https://api.github.com/users/romanie/orgs","repos_url":"https://api.github.com/users/romanie/repos","events_url":"https://api.github.com/users/romanie/events{/privacy}","received_events_url":"https://api.github.com/users/romanie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romanie/Diploma","description":null,"fork":false,"url":"https://api.github.com/repos/romanie/Diploma","forks_url":"https://api.github.com/repos/romanie/Diploma/forks","keys_url":"https://api.github.com/repos/romanie/Diploma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romanie/Diploma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romanie/Diploma/teams","hooks_url":"https://api.github.com/repos/romanie/Diploma/hooks","issue_events_url":"https://api.github.com/repos/romanie/Diploma/issues/events{/number}","events_url":"https://api.github.com/repos/romanie/Diploma/events","assignees_url":"https://api.github.com/repos/romanie/Diploma/assignees{/user}","branches_url":"https://api.github.com/repos/romanie/Diploma/branches{/branch}","tags_url":"https://api.github.com/repos/romanie/Diploma/tags","blobs_url":"https://api.github.com/repos/romanie/Diploma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romanie/Diploma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romanie/Diploma/git/refs{/sha}","trees_url":"https://api.github.com/repos/romanie/Diploma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romanie/Diploma/statuses/{sha}","languages_url":"https://api.github.com/repos/romanie/Diploma/languages","stargazers_url":"https://api.github.com/repos/romanie/Diploma/stargazers","contributors_url":"https://api.github.com/repos/romanie/Diploma/contributors","subscribers_url":"https://api.github.com/repos/romanie/Diploma/subscribers","subscription_url":"https://api.github.com/repos/romanie/Diploma/subscription","commits_url":"https://api.github.com/repos/romanie/Diploma/commits{/sha}","git_commits_url":"https://api.github.com/repos/romanie/Diploma/git/commits{/sha}","comments_url":"https://api.github.com/repos/romanie/Diploma/comments{/number}","issue_comment_url":"https://api.github.com/repos/romanie/Diploma/issues/comments{/number}","contents_url":"https://api.github.com/repos/romanie/Diploma/contents/{+path}","compare_url":"https://api.github.com/repos/romanie/Diploma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romanie/Diploma/merges","archive_url":"https://api.github.com/repos/romanie/Diploma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romanie/Diploma/downloads","issues_url":"https://api.github.com/repos/romanie/Diploma/issues{/number}","pulls_url":"https://api.github.com/repos/romanie/Diploma/pulls{/number}","milestones_url":"https://api.github.com/repos/romanie/Diploma/milestones{/number}","notifications_url":"https://api.github.com/repos/romanie/Diploma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romanie/Diploma/labels{/name}","releases_url":"https://api.github.com/repos/romanie/Diploma/releases{/id}","deployments_url":"https://api.github.com/repos/romanie/Diploma/deployments","created_at":"2016-05-11T21:12:41Z","updated_at":"2016-05-12T12:31:09Z","pushed_at":"2016-05-23T11:05:49Z","git_url":"git://github.com/romanie/Diploma.git","ssh_url":"git@github.com:romanie/Diploma.git","clone_url":"https://github.com/romanie/Diploma.git","svn_url":"https://github.com/romanie/Diploma","homepage":null,"size":15,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/romanie/Diploma/pulls/8"},"html":{"href":"https://github.com/romanie/Diploma/pull/8"},"issue":{"href":"https://api.github.com/repos/romanie/Diploma/issues/8"},"comments":{"href":"https://api.github.com/repos/romanie/Diploma/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/romanie/Diploma/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/romanie/Diploma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/romanie/Diploma/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/romanie/Diploma/statuses/1ae7885ec8ad8383fe8430ce29f1828d135ca480"}}}}
{"actor":{"display_login":"romanie"}}