{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/32145069","id":32145069,"diff_hunk":"@@ -487,6 +487,35 @@ def test_class_weights():\n     assert_array_almost_equal(clf.intercept_, clfa.intercept_)\n \n \n+def test_class_weight_vs_sample_weight():","path":"sklearn/linear_model/tests/test_ridge.py","position":4,"original_position":4,"commit_id":"2f69574393d822326a68d3238536d60b50a9e2fe","original_commit_id":"2f69574393d822326a68d3238536d60b50a9e2fe","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"body":"Adding one that checks if ``sample_weights`` is equivalent to doing the corresponding ``class_weights`` would be nice, too. I feel it should be pretty straight-forward, though. Why would you need a helper? Just check if ``decision_function`` is ``almost_equal``.","created_at":"2015-06-10T17:46:24Z","updated_at":"2015-06-10T17:46:24Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4838#discussion_r32145069","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/32145069"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4838#discussion_r32145069"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838","id":37218935,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/4838","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/4838.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/4838.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4838","number":4838,"state":"closed","locked":false,"title":"[MRG+1] Add sample_weight support to RidgeClassifier","user":{"login":"trevorstephens","id":5210848,"avatar_url":"https://avatars.githubusercontent.com/u/5210848?v=3","gravatar_id":"","url":"https://api.github.com/users/trevorstephens","html_url":"https://github.com/trevorstephens","followers_url":"https://api.github.com/users/trevorstephens/followers","following_url":"https://api.github.com/users/trevorstephens/following{/other_user}","gists_url":"https://api.github.com/users/trevorstephens/gists{/gist_id}","starred_url":"https://api.github.com/users/trevorstephens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevorstephens/subscriptions","organizations_url":"https://api.github.com/users/trevorstephens/orgs","repos_url":"https://api.github.com/users/trevorstephens/repos","events_url":"https://api.github.com/users/trevorstephens/events{/privacy}","received_events_url":"https://api.github.com/users/trevorstephens/received_events","type":"User","site_admin":false},"body":"Added `sample_weight` support to `RidgeClassifier` as it was in `RidgeClassifierCV` but not the non-CV implementation. \r\n\r\nAlso added some tests to both of the above to check it reacts as expected when compared to `class_weight` from the constructor.","created_at":"2015-06-09T04:38:05Z","updated_at":"2015-06-10T17:46:24Z","closed_at":"2015-06-09T15:22:50Z","merged_at":"2015-06-09T15:22:50Z","merge_commit_sha":"6845bccb6a174768872172ef89f3be0ed78e7b54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4838/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/2f69574393d822326a68d3238536d60b50a9e2fe","head":{"label":"trevorstephens:ridge_sw","ref":"ridge_sw","sha":"2f69574393d822326a68d3238536d60b50a9e2fe","user":{"login":"trevorstephens","id":5210848,"avatar_url":"https://avatars.githubusercontent.com/u/5210848?v=3","gravatar_id":"","url":"https://api.github.com/users/trevorstephens","html_url":"https://github.com/trevorstephens","followers_url":"https://api.github.com/users/trevorstephens/followers","following_url":"https://api.github.com/users/trevorstephens/following{/other_user}","gists_url":"https://api.github.com/users/trevorstephens/gists{/gist_id}","starred_url":"https://api.github.com/users/trevorstephens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevorstephens/subscriptions","organizations_url":"https://api.github.com/users/trevorstephens/orgs","repos_url":"https://api.github.com/users/trevorstephens/repos","events_url":"https://api.github.com/users/trevorstephens/events{/privacy}","received_events_url":"https://api.github.com/users/trevorstephens/received_events","type":"User","site_admin":false},"repo":{"id":24569671,"name":"scikit-learn","full_name":"trevorstephens/scikit-learn","owner":{"login":"trevorstephens","id":5210848,"avatar_url":"https://avatars.githubusercontent.com/u/5210848?v=3","gravatar_id":"","url":"https://api.github.com/users/trevorstephens","html_url":"https://github.com/trevorstephens","followers_url":"https://api.github.com/users/trevorstephens/followers","following_url":"https://api.github.com/users/trevorstephens/following{/other_user}","gists_url":"https://api.github.com/users/trevorstephens/gists{/gist_id}","starred_url":"https://api.github.com/users/trevorstephens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevorstephens/subscriptions","organizations_url":"https://api.github.com/users/trevorstephens/orgs","repos_url":"https://api.github.com/users/trevorstephens/repos","events_url":"https://api.github.com/users/trevorstephens/events{/privacy}","received_events_url":"https://api.github.com/users/trevorstephens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trevorstephens/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/trevorstephens/scikit-learn","forks_url":"https://api.github.com/repos/trevorstephens/scikit-learn/forks","keys_url":"https://api.github.com/repos/trevorstephens/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trevorstephens/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trevorstephens/scikit-learn/teams","hooks_url":"https://api.github.com/repos/trevorstephens/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/trevorstephens/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/trevorstephens/scikit-learn/events","assignees_url":"https://api.github.com/repos/trevorstephens/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/trevorstephens/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/trevorstephens/scikit-learn/tags","blobs_url":"https://api.github.com/repos/trevorstephens/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trevorstephens/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trevorstephens/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/trevorstephens/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trevorstephens/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/trevorstephens/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/trevorstephens/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/trevorstephens/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/trevorstephens/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/trevorstephens/scikit-learn/subscription","commits_url":"https://api.github.com/repos/trevorstephens/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/trevorstephens/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/trevorstephens/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/trevorstephens/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/trevorstephens/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/trevorstephens/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trevorstephens/scikit-learn/merges","archive_url":"https://api.github.com/repos/trevorstephens/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trevorstephens/scikit-learn/downloads","issues_url":"https://api.github.com/repos/trevorstephens/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/trevorstephens/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/trevorstephens/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/trevorstephens/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trevorstephens/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/trevorstephens/scikit-learn/releases{/id}","created_at":"2014-09-28T20:28:06Z","updated_at":"2015-05-07T14:40:49Z","pushed_at":"2015-06-10T02:21:33Z","git_url":"git://github.com/trevorstephens/scikit-learn.git","ssh_url":"git@github.com:trevorstephens/scikit-learn.git","clone_url":"https://github.com/trevorstephens/scikit-learn.git","svn_url":"https://github.com/trevorstephens/scikit-learn","homepage":"http://scikit-learn.org","size":63339,"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":"scikit-learn:master","ref":"master","sha":"8453daa6b983ee2fd73d537e81e58b3f6b0e3147","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","created_at":"2010-08-17T09:43:38Z","updated_at":"2015-06-10T16:27:23Z","pushed_at":"2015-06-10T17:40:54Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":122235,"stargazers_count":6365,"watchers_count":6365,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3815,"mirror_url":null,"open_issues_count":677,"forks":3815,"open_issues":677,"watchers":6365,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4838"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4838"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4838/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4838/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/2f69574393d822326a68d3238536d60b50a9e2fe"}}}}