{"action":"created","comment":{"url":"https://api.github.com/repos/numenta/nupic.fluent/pulls/comments/34006770","id":34006770,"diff_hunk":"@@ -198,16 +216,19 @@ def calculateConfusionMatrix(classifications, references):  ## TODO: just get nu\n       raise ValueError(\"Classification lists must have same length.\")\n \n     actual = numpy.array(classifications[1])\n-    predicted = numpy.array([c[0] for c in classifications[0]])  ## TODO: multiclass; this forces evaluation metrics to consider only the first predicted classification\n+    predicted = numpy.array([c for c in classifications[0]])  ## TODO: multiclass; this forces evaluation metrics to consider only the first predicted classification\n \n     total = len(references)\n     cm = numpy.zeros((total, total+1))\n     for i, p in enumerate(predicted):\n       if p is not None:\n-        cm[actual[i]][p] += 1\n+        for aLabel in actual[i]:\n+          for pLabel in p:\n+            cm[aLabel][pLabel] += 1","path":"fluent/models/classification_model.py","position":77,"original_position":77,"commit_id":"ac2c0c8696f8b9fd0a6c0a83fbbb075c56d31dc9","original_commit_id":"ac2c0c8696f8b9fd0a6c0a83fbbb075c56d31dc9","user":{"login":"BoltzmannBrain","id":8323700,"avatar_url":"https://avatars.githubusercontent.com/u/8323700?v=3","gravatar_id":"","url":"https://api.github.com/users/BoltzmannBrain","html_url":"https://github.com/BoltzmannBrain","followers_url":"https://api.github.com/users/BoltzmannBrain/followers","following_url":"https://api.github.com/users/BoltzmannBrain/following{/other_user}","gists_url":"https://api.github.com/users/BoltzmannBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltzmannBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltzmannBrain/subscriptions","organizations_url":"https://api.github.com/users/BoltzmannBrain/orgs","repos_url":"https://api.github.com/users/BoltzmannBrain/repos","events_url":"https://api.github.com/users/BoltzmannBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BoltzmannBrain/received_events","type":"User","site_admin":false},"body":"Not calculating the CM correctly here; this requires the order of actual labels to match the order of the predicted labels for correct classifications. E.g. actual = [0,4,7] and predicted = [7, 0, 4] would yield three incorrect classifications with the above logic.","created_at":"2015-07-07T04:17:08Z","updated_at":"2015-07-07T04:17:08Z","html_url":"https://github.com/numenta/nupic.fluent/pull/87#discussion_r34006770","pull_request_url":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/numenta/nupic.fluent/pulls/comments/34006770"},"html":{"href":"https://github.com/numenta/nupic.fluent/pull/87#discussion_r34006770"},"pull_request":{"href":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87","id":39287130,"html_url":"https://github.com/numenta/nupic.fluent/pull/87","diff_url":"https://github.com/numenta/nupic.fluent/pull/87.diff","patch_url":"https://github.com/numenta/nupic.fluent/pull/87.patch","issue_url":"https://api.github.com/repos/numenta/nupic.fluent/issues/87","number":87,"state":"open","locked":false,"title":"Added multilabel evaluation ","user":{"login":"mihail911","id":2789441,"avatar_url":"https://avatars.githubusercontent.com/u/2789441?v=3","gravatar_id":"","url":"https://api.github.com/users/mihail911","html_url":"https://github.com/mihail911","followers_url":"https://api.github.com/users/mihail911/followers","following_url":"https://api.github.com/users/mihail911/following{/other_user}","gists_url":"https://api.github.com/users/mihail911/gists{/gist_id}","starred_url":"https://api.github.com/users/mihail911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihail911/subscriptions","organizations_url":"https://api.github.com/users/mihail911/orgs","repos_url":"https://api.github.com/users/mihail911/repos","events_url":"https://api.github.com/users/mihail911/events{/privacy}","received_events_url":"https://api.github.com/users/mihail911/received_events","type":"User","site_admin":false},"body":"Added support for multilabel evaluation in classification_model base class. @BoltzmannBrain @scottpurdy @subutai ","created_at":"2015-07-06T16:44:44Z","updated_at":"2015-07-07T04:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67a63339830791af918b8f723936636e715f7106","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87/commits","review_comments_url":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87/comments","review_comment_url":"https://api.github.com/repos/numenta/nupic.fluent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numenta/nupic.fluent/issues/87/comments","statuses_url":"https://api.github.com/repos/numenta/nupic.fluent/statuses/ac2c0c8696f8b9fd0a6c0a83fbbb075c56d31dc9","head":{"label":"mihail911:new_evaluation_metrics","ref":"new_evaluation_metrics","sha":"ac2c0c8696f8b9fd0a6c0a83fbbb075c56d31dc9","user":{"login":"mihail911","id":2789441,"avatar_url":"https://avatars.githubusercontent.com/u/2789441?v=3","gravatar_id":"","url":"https://api.github.com/users/mihail911","html_url":"https://github.com/mihail911","followers_url":"https://api.github.com/users/mihail911/followers","following_url":"https://api.github.com/users/mihail911/following{/other_user}","gists_url":"https://api.github.com/users/mihail911/gists{/gist_id}","starred_url":"https://api.github.com/users/mihail911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihail911/subscriptions","organizations_url":"https://api.github.com/users/mihail911/orgs","repos_url":"https://api.github.com/users/mihail911/repos","events_url":"https://api.github.com/users/mihail911/events{/privacy}","received_events_url":"https://api.github.com/users/mihail911/received_events","type":"User","site_admin":false},"repo":{"id":38079966,"name":"nupic.fluent","full_name":"mihail911/nupic.fluent","owner":{"login":"mihail911","id":2789441,"avatar_url":"https://avatars.githubusercontent.com/u/2789441?v=3","gravatar_id":"","url":"https://api.github.com/users/mihail911","html_url":"https://github.com/mihail911","followers_url":"https://api.github.com/users/mihail911/followers","following_url":"https://api.github.com/users/mihail911/following{/other_user}","gists_url":"https://api.github.com/users/mihail911/gists{/gist_id}","starred_url":"https://api.github.com/users/mihail911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihail911/subscriptions","organizations_url":"https://api.github.com/users/mihail911/orgs","repos_url":"https://api.github.com/users/mihail911/repos","events_url":"https://api.github.com/users/mihail911/events{/privacy}","received_events_url":"https://api.github.com/users/mihail911/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mihail911/nupic.fluent","description":"A platform for building language / NLP-based applications using NuPIC and Cortical.io.","fork":true,"url":"https://api.github.com/repos/mihail911/nupic.fluent","forks_url":"https://api.github.com/repos/mihail911/nupic.fluent/forks","keys_url":"https://api.github.com/repos/mihail911/nupic.fluent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mihail911/nupic.fluent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mihail911/nupic.fluent/teams","hooks_url":"https://api.github.com/repos/mihail911/nupic.fluent/hooks","issue_events_url":"https://api.github.com/repos/mihail911/nupic.fluent/issues/events{/number}","events_url":"https://api.github.com/repos/mihail911/nupic.fluent/events","assignees_url":"https://api.github.com/repos/mihail911/nupic.fluent/assignees{/user}","branches_url":"https://api.github.com/repos/mihail911/nupic.fluent/branches{/branch}","tags_url":"https://api.github.com/repos/mihail911/nupic.fluent/tags","blobs_url":"https://api.github.com/repos/mihail911/nupic.fluent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mihail911/nupic.fluent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mihail911/nupic.fluent/git/refs{/sha}","trees_url":"https://api.github.com/repos/mihail911/nupic.fluent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mihail911/nupic.fluent/statuses/{sha}","languages_url":"https://api.github.com/repos/mihail911/nupic.fluent/languages","stargazers_url":"https://api.github.com/repos/mihail911/nupic.fluent/stargazers","contributors_url":"https://api.github.com/repos/mihail911/nupic.fluent/contributors","subscribers_url":"https://api.github.com/repos/mihail911/nupic.fluent/subscribers","subscription_url":"https://api.github.com/repos/mihail911/nupic.fluent/subscription","commits_url":"https://api.github.com/repos/mihail911/nupic.fluent/commits{/sha}","git_commits_url":"https://api.github.com/repos/mihail911/nupic.fluent/git/commits{/sha}","comments_url":"https://api.github.com/repos/mihail911/nupic.fluent/comments{/number}","issue_comment_url":"https://api.github.com/repos/mihail911/nupic.fluent/issues/comments{/number}","contents_url":"https://api.github.com/repos/mihail911/nupic.fluent/contents/{+path}","compare_url":"https://api.github.com/repos/mihail911/nupic.fluent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mihail911/nupic.fluent/merges","archive_url":"https://api.github.com/repos/mihail911/nupic.fluent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mihail911/nupic.fluent/downloads","issues_url":"https://api.github.com/repos/mihail911/nupic.fluent/issues{/number}","pulls_url":"https://api.github.com/repos/mihail911/nupic.fluent/pulls{/number}","milestones_url":"https://api.github.com/repos/mihail911/nupic.fluent/milestones{/number}","notifications_url":"https://api.github.com/repos/mihail911/nupic.fluent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mihail911/nupic.fluent/labels{/name}","releases_url":"https://api.github.com/repos/mihail911/nupic.fluent/releases{/id}","created_at":"2015-06-25T23:34:07Z","updated_at":"2015-06-25T23:34:08Z","pushed_at":"2015-07-06T16:35:50Z","git_url":"git://github.com/mihail911/nupic.fluent.git","ssh_url":"git@github.com:mihail911/nupic.fluent.git","clone_url":"https://github.com/mihail911/nupic.fluent.git","svn_url":"https://github.com/mihail911/nupic.fluent","homepage":"","size":3259,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"numenta:master","ref":"master","sha":"3b718d8cc623d6edce4abb32cb6a0e142d692f58","user":{"login":"numenta","id":1039191,"avatar_url":"https://avatars.githubusercontent.com/u/1039191?v=3","gravatar_id":"","url":"https://api.github.com/users/numenta","html_url":"https://github.com/numenta","followers_url":"https://api.github.com/users/numenta/followers","following_url":"https://api.github.com/users/numenta/following{/other_user}","gists_url":"https://api.github.com/users/numenta/gists{/gist_id}","starred_url":"https://api.github.com/users/numenta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numenta/subscriptions","organizations_url":"https://api.github.com/users/numenta/orgs","repos_url":"https://api.github.com/users/numenta/repos","events_url":"https://api.github.com/users/numenta/events{/privacy}","received_events_url":"https://api.github.com/users/numenta/received_events","type":"Organization","site_admin":false},"repo":{"id":17183816,"name":"nupic.fluent","full_name":"numenta/nupic.fluent","owner":{"login":"numenta","id":1039191,"avatar_url":"https://avatars.githubusercontent.com/u/1039191?v=3","gravatar_id":"","url":"https://api.github.com/users/numenta","html_url":"https://github.com/numenta","followers_url":"https://api.github.com/users/numenta/followers","following_url":"https://api.github.com/users/numenta/following{/other_user}","gists_url":"https://api.github.com/users/numenta/gists{/gist_id}","starred_url":"https://api.github.com/users/numenta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numenta/subscriptions","organizations_url":"https://api.github.com/users/numenta/orgs","repos_url":"https://api.github.com/users/numenta/repos","events_url":"https://api.github.com/users/numenta/events{/privacy}","received_events_url":"https://api.github.com/users/numenta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numenta/nupic.fluent","description":"A platform for building language / NLP-based applications using NuPIC and Cortical.io.","fork":false,"url":"https://api.github.com/repos/numenta/nupic.fluent","forks_url":"https://api.github.com/repos/numenta/nupic.fluent/forks","keys_url":"https://api.github.com/repos/numenta/nupic.fluent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numenta/nupic.fluent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numenta/nupic.fluent/teams","hooks_url":"https://api.github.com/repos/numenta/nupic.fluent/hooks","issue_events_url":"https://api.github.com/repos/numenta/nupic.fluent/issues/events{/number}","events_url":"https://api.github.com/repos/numenta/nupic.fluent/events","assignees_url":"https://api.github.com/repos/numenta/nupic.fluent/assignees{/user}","branches_url":"https://api.github.com/repos/numenta/nupic.fluent/branches{/branch}","tags_url":"https://api.github.com/repos/numenta/nupic.fluent/tags","blobs_url":"https://api.github.com/repos/numenta/nupic.fluent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numenta/nupic.fluent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numenta/nupic.fluent/git/refs{/sha}","trees_url":"https://api.github.com/repos/numenta/nupic.fluent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numenta/nupic.fluent/statuses/{sha}","languages_url":"https://api.github.com/repos/numenta/nupic.fluent/languages","stargazers_url":"https://api.github.com/repos/numenta/nupic.fluent/stargazers","contributors_url":"https://api.github.com/repos/numenta/nupic.fluent/contributors","subscribers_url":"https://api.github.com/repos/numenta/nupic.fluent/subscribers","subscription_url":"https://api.github.com/repos/numenta/nupic.fluent/subscription","commits_url":"https://api.github.com/repos/numenta/nupic.fluent/commits{/sha}","git_commits_url":"https://api.github.com/repos/numenta/nupic.fluent/git/commits{/sha}","comments_url":"https://api.github.com/repos/numenta/nupic.fluent/comments{/number}","issue_comment_url":"https://api.github.com/repos/numenta/nupic.fluent/issues/comments{/number}","contents_url":"https://api.github.com/repos/numenta/nupic.fluent/contents/{+path}","compare_url":"https://api.github.com/repos/numenta/nupic.fluent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numenta/nupic.fluent/merges","archive_url":"https://api.github.com/repos/numenta/nupic.fluent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numenta/nupic.fluent/downloads","issues_url":"https://api.github.com/repos/numenta/nupic.fluent/issues{/number}","pulls_url":"https://api.github.com/repos/numenta/nupic.fluent/pulls{/number}","milestones_url":"https://api.github.com/repos/numenta/nupic.fluent/milestones{/number}","notifications_url":"https://api.github.com/repos/numenta/nupic.fluent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numenta/nupic.fluent/labels{/name}","releases_url":"https://api.github.com/repos/numenta/nupic.fluent/releases{/id}","created_at":"2014-02-25T18:41:17Z","updated_at":"2015-07-05T11:09:46Z","pushed_at":"2015-07-06T23:26:35Z","git_url":"git://github.com/numenta/nupic.fluent.git","ssh_url":"git@github.com:numenta/nupic.fluent.git","clone_url":"https://github.com/numenta/nupic.fluent.git","svn_url":"https://github.com/numenta/nupic.fluent","homepage":"","size":6374,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":21,"forks":18,"open_issues":21,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87"},"html":{"href":"https://github.com/numenta/nupic.fluent/pull/87"},"issue":{"href":"https://api.github.com/repos/numenta/nupic.fluent/issues/87"},"comments":{"href":"https://api.github.com/repos/numenta/nupic.fluent/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/numenta/nupic.fluent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numenta/nupic.fluent/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/numenta/nupic.fluent/statuses/ac2c0c8696f8b9fd0a6c0a83fbbb075c56d31dc9"}}}}