{"action":"created","comment":{"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments/43281044","id":43281044,"diff_hunk":"@@ -1003,6 +1006,13 @@ void parse_reductions(vw& all)\n   all.reduction_stack.push_back(bs_setup);\n \n   all.l = setup_base(all);\n+\n+  if (all.probabilities)\n+  { if (!all.vm.count(\"oaa\") && !all.vm.count(\"csoaa_ldf\"))\n+      THROW(\"--probabilities can only be used with --oaa=N or --csoaa_ldf=mc\");\n+    if (!all.vm.count(\"loss_function\") || all.vm[\"loss_function\"].as<string>() != \"logistic\" )","path":"vowpalwabbit/parse_args.cc","position":34,"original_position":34,"commit_id":"c3808dddff266c039c54a659a8c307b3ed96804c","original_commit_id":"c3808dddff266c039c54a659a8c307b3ed96804c","user":{"login":"JohnLangford","id":79590,"avatar_url":"https://avatars.githubusercontent.com/u/79590?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnLangford","html_url":"https://github.com/JohnLangford","followers_url":"https://api.github.com/users/JohnLangford/followers","following_url":"https://api.github.com/users/JohnLangford/following{/other_user}","gists_url":"https://api.github.com/users/JohnLangford/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnLangford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnLangford/subscriptions","organizations_url":"https://api.github.com/users/JohnLangford/orgs","repos_url":"https://api.github.com/users/JohnLangford/repos","events_url":"https://api.github.com/users/JohnLangford/events{/privacy}","received_events_url":"https://api.github.com/users/JohnLangford/received_events","type":"User","site_admin":false},"body":"I would prefer the definition of --probabilities in oaa.cc and csoaa.cc \nand doing the checks locally.  Modularity at a small cost in extra code \nseems worthwhile.  If you can remove the probabilities flag from the \nglobal datastructure and just rely on the local datastructure for each, \nthat seems good to.\n\n-John\n\nOn 10/28/2015 12:25 PM, Martin Popel wrote:\n>\n> In vowpalwabbit/parse_args.cc \n> <https://github.com/JohnLangford/vowpal_wabbit/pull/837#discussion_r43279766>:\n>\n> > @@ -1003,6 +1006,13 @@ void parse_reductions(vw& all)\n> >    all.reduction_stack.push_back(bs_setup);\n> >\n> >    all.l = setup_base(all);\n> > +\n> > +  if (all.probabilities)\n> > +  { if (!all.vm.count(\"oaa\") && !all.vm.count(\"csoaa_ldf\"))\n> > +      THROW(\"--probabilities can only be used with --oaa=N or --csoaa_ldf=mc\");\n> > +    if (!all.vm.count(\"loss_function\") || all.vm[\"loss_function\"].as<string>() != \"logistic\" )\n>\n> I would need to repeat the test both in oaa.cc and csoaa.cc. Should I \n> do it?\n> I felt the test (just two lines of code) fits here where I am testing \n> |all.probabilities && (!oaa || !csoaa_ldf)| (and this test obviously \n> cannot be moved to oaa.cc/csoaa.cc).\n>\n> —\n> Reply to this email directly or view it on GitHub \n> <https://github.com/JohnLangford/vowpal_wabbit/pull/837/files#r43279766>.\n>\n\n","created_at":"2015-10-28T16:33:21Z","updated_at":"2015-10-28T16:33:21Z","html_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/837#discussion_r43281044","pull_request_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837","_links":{"self":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments/43281044"},"html":{"href":"https://github.com/JohnLangford/vowpal_wabbit/pull/837#discussion_r43281044"},"pull_request":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837"}}},"pull_request":{"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837","id":48540453,"html_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/837","diff_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/837.diff","patch_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/837.patch","issue_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/837","number":837,"state":"open","locked":false,"title":"--probabilities (second attempt)","user":{"login":"martinpopel","id":724617,"avatar_url":"https://avatars.githubusercontent.com/u/724617?v=3","gravatar_id":"","url":"https://api.github.com/users/martinpopel","html_url":"https://github.com/martinpopel","followers_url":"https://api.github.com/users/martinpopel/followers","following_url":"https://api.github.com/users/martinpopel/following{/other_user}","gists_url":"https://api.github.com/users/martinpopel/gists{/gist_id}","starred_url":"https://api.github.com/users/martinpopel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinpopel/subscriptions","organizations_url":"https://api.github.com/users/martinpopel/orgs","repos_url":"https://api.github.com/users/martinpopel/repos","events_url":"https://api.github.com/users/martinpopel/events{/privacy}","received_events_url":"https://api.github.com/users/martinpopel/received_events","type":"User","site_admin":false},"body":"This is an alternative to PR #774 (taking into account @JohnLangford 's suggestion to rather recompute the predicted label on the fly, instead of storing it in the example). I've decided to create a new PR, so I can rebase it on the current master. Original description:\r\n\r\nThis new parameter --probabilities can be used in combination with --loss_function=logistic and either --oaa or --csoaa_ldf=mc. VW predictions (-p) will be directly class probabilities (summing to one). There is no need for specifying any --link option.\r\n\r\nThis PR fixes #566 and it should also fix #724.\r\nSee #566 for a detailed discussion.\r\n","created_at":"2015-10-23T04:05:07Z","updated_at":"2015-10-28T16:33:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b73c139e392d2eb71f9d2285c3a44e650121e67","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837/commits","review_comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837/comments","review_comment_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/837/comments","statuses_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/statuses/c3808dddff266c039c54a659a8c307b3ed96804c","head":{"label":"martinpopel:probabilities2","ref":"probabilities2","sha":"c3808dddff266c039c54a659a8c307b3ed96804c","user":{"login":"martinpopel","id":724617,"avatar_url":"https://avatars.githubusercontent.com/u/724617?v=3","gravatar_id":"","url":"https://api.github.com/users/martinpopel","html_url":"https://github.com/martinpopel","followers_url":"https://api.github.com/users/martinpopel/followers","following_url":"https://api.github.com/users/martinpopel/following{/other_user}","gists_url":"https://api.github.com/users/martinpopel/gists{/gist_id}","starred_url":"https://api.github.com/users/martinpopel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinpopel/subscriptions","organizations_url":"https://api.github.com/users/martinpopel/orgs","repos_url":"https://api.github.com/users/martinpopel/repos","events_url":"https://api.github.com/users/martinpopel/events{/privacy}","received_events_url":"https://api.github.com/users/martinpopel/received_events","type":"User","site_admin":false},"repo":{"id":26681407,"name":"vowpal_wabbit","full_name":"martinpopel/vowpal_wabbit","owner":{"login":"martinpopel","id":724617,"avatar_url":"https://avatars.githubusercontent.com/u/724617?v=3","gravatar_id":"","url":"https://api.github.com/users/martinpopel","html_url":"https://github.com/martinpopel","followers_url":"https://api.github.com/users/martinpopel/followers","following_url":"https://api.github.com/users/martinpopel/following{/other_user}","gists_url":"https://api.github.com/users/martinpopel/gists{/gist_id}","starred_url":"https://api.github.com/users/martinpopel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinpopel/subscriptions","organizations_url":"https://api.github.com/users/martinpopel/orgs","repos_url":"https://api.github.com/users/martinpopel/repos","events_url":"https://api.github.com/users/martinpopel/events{/privacy}","received_events_url":"https://api.github.com/users/martinpopel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martinpopel/vowpal_wabbit","description":"John Langford's original release of Vowpal Wabbit -- a fast online learning algorithm","fork":true,"url":"https://api.github.com/repos/martinpopel/vowpal_wabbit","forks_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/forks","keys_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/teams","hooks_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/hooks","issue_events_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/issues/events{/number}","events_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/events","assignees_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/assignees{/user}","branches_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/branches{/branch}","tags_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/tags","blobs_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/statuses/{sha}","languages_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/languages","stargazers_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/stargazers","contributors_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/contributors","subscribers_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/subscribers","subscription_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/subscription","commits_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/contents/{+path}","compare_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/merges","archive_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/downloads","issues_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/issues{/number}","pulls_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/pulls{/number}","milestones_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/milestones{/number}","notifications_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/labels{/name}","releases_url":"https://api.github.com/repos/martinpopel/vowpal_wabbit/releases{/id}","created_at":"2014-11-15T13:57:08Z","updated_at":"2015-10-27T23:45:37Z","pushed_at":"2015-10-28T15:36:43Z","git_url":"git://github.com/martinpopel/vowpal_wabbit.git","ssh_url":"git@github.com:martinpopel/vowpal_wabbit.git","clone_url":"https://github.com/martinpopel/vowpal_wabbit.git","svn_url":"https://github.com/martinpopel/vowpal_wabbit","homepage":"http://hunch.net/~vw/","size":96035,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"JohnLangford:master","ref":"master","sha":"7252c5e1a244937bff1d00e48f913d74b42b6490","user":{"login":"JohnLangford","id":79590,"avatar_url":"https://avatars.githubusercontent.com/u/79590?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnLangford","html_url":"https://github.com/JohnLangford","followers_url":"https://api.github.com/users/JohnLangford/followers","following_url":"https://api.github.com/users/JohnLangford/following{/other_user}","gists_url":"https://api.github.com/users/JohnLangford/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnLangford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnLangford/subscriptions","organizations_url":"https://api.github.com/users/JohnLangford/orgs","repos_url":"https://api.github.com/users/JohnLangford/repos","events_url":"https://api.github.com/users/JohnLangford/events{/privacy}","received_events_url":"https://api.github.com/users/JohnLangford/received_events","type":"User","site_admin":false},"repo":{"id":265995,"name":"vowpal_wabbit","full_name":"JohnLangford/vowpal_wabbit","owner":{"login":"JohnLangford","id":79590,"avatar_url":"https://avatars.githubusercontent.com/u/79590?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnLangford","html_url":"https://github.com/JohnLangford","followers_url":"https://api.github.com/users/JohnLangford/followers","following_url":"https://api.github.com/users/JohnLangford/following{/other_user}","gists_url":"https://api.github.com/users/JohnLangford/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnLangford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnLangford/subscriptions","organizations_url":"https://api.github.com/users/JohnLangford/orgs","repos_url":"https://api.github.com/users/JohnLangford/repos","events_url":"https://api.github.com/users/JohnLangford/events{/privacy}","received_events_url":"https://api.github.com/users/JohnLangford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohnLangford/vowpal_wabbit","description":"Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.","fork":false,"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit","forks_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/forks","keys_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/teams","hooks_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/hooks","issue_events_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/events{/number}","events_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/events","assignees_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/assignees{/user}","branches_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/branches{/branch}","tags_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/tags","blobs_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/statuses/{sha}","languages_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/languages","stargazers_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/stargazers","contributors_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/contributors","subscribers_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/subscribers","subscription_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/subscription","commits_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/contents/{+path}","compare_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/merges","archive_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/downloads","issues_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues{/number}","pulls_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls{/number}","milestones_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/milestones{/number}","notifications_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/labels{/name}","releases_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/releases{/id}","created_at":"2009-07-31T19:36:58Z","updated_at":"2015-10-28T14:08:33Z","pushed_at":"2015-10-28T15:40:24Z","git_url":"git://github.com/JohnLangford/vowpal_wabbit.git","ssh_url":"git@github.com:JohnLangford/vowpal_wabbit.git","clone_url":"https://github.com/JohnLangford/vowpal_wabbit.git","svn_url":"https://github.com/JohnLangford/vowpal_wabbit","homepage":"http://hunch.net/~vw/","size":112075,"stargazers_count":2820,"watchers_count":2820,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":797,"mirror_url":null,"open_issues_count":35,"forks":797,"open_issues":35,"watchers":2820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837"},"html":{"href":"https://github.com/JohnLangford/vowpal_wabbit/pull/837"},"issue":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/837"},"comments":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/837/comments"},"review_comments":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837/comments"},"review_comment":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/837/commits"},"statuses":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/statuses/c3808dddff266c039c54a659a8c307b3ed96804c"}}}}