{"action":"created","comment":{"url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/comments/193009208","pull_request_review_id":125892720,"id":193009208,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzAwOTIwOA==","diff_hunk":"@@ -0,0 +1,214 @@\n+import pytest\n+from sklearn.datasets import load_iris\n+from sklearn.pipeline import make_pipeline\n+from sklearn.utils import shuffle, check_random_state\n+from sklearn.utils.estimator_checks import is_public_parameter\n+from sklearn.utils.testing import (assert_allclose_dense_sparse,\n+                                   set_random_state)\n+\n+from metric_learn import ITML, MMC, SDML, LSML\n+from metric_learn.constraints import wrap_pairs, Constraints\n+from sklearn import clone\n+import numpy as np\n+from sklearn.model_selection import cross_val_score, train_test_split\n+\n+\n+def build_data():\n+  RNG = check_random_state(0)\n+  dataset = load_iris()\n+  X, y = shuffle(dataset.data, dataset.target, random_state=RNG)\n+  num_constraints = 20\n+  constraints = Constraints.random_subset(y)\n+  pairs = constraints.positive_negative_pairs(num_constraints,\n+                                              same_length=True,\n+                                              random_state=RNG)\n+  return X, pairs\n+\n+\n+def build_pairs():\n+  # test that you can do cross validation on a ConstrainedDataset with","path":"test/test_weakly_supervised.py","position":29,"original_position":29,"commit_id":"a70d1a856a6b7aeb6ff5800e5f03ffc48bfb6163","original_commit_id":"a70d1a856a6b7aeb6ff5800e5f03ffc48bfb6163","user":{"login":"wdevazelhes","id":31916524,"node_id":"MDQ6VXNlcjMxOTE2NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/31916524?v=4","gravatar_id":"","url":"https://api.github.com/users/wdevazelhes","html_url":"https://github.com/wdevazelhes","followers_url":"https://api.github.com/users/wdevazelhes/followers","following_url":"https://api.github.com/users/wdevazelhes/following{/other_user}","gists_url":"https://api.github.com/users/wdevazelhes/gists{/gist_id}","starred_url":"https://api.github.com/users/wdevazelhes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdevazelhes/subscriptions","organizations_url":"https://api.github.com/users/wdevazelhes/orgs","repos_url":"https://api.github.com/users/wdevazelhes/repos","events_url":"https://api.github.com/users/wdevazelhes/events{/privacy}","received_events_url":"https://api.github.com/users/wdevazelhes/received_events","type":"User","site_admin":false},"body":"as some tests are parameterized to work for pairs and quadruplets, I will rename them tuples in the tests, but pairs and quadruplets in ``build_pairs`` and ``build_quadruplets`` functions that initialize data","created_at":"2018-06-05T09:40:43Z","updated_at":"2018-06-05T09:40:44Z","html_url":"https://github.com/metric-learn/metric-learn/pull/95#discussion_r193009208","pull_request_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/comments/193009208"},"html":{"href":"https://github.com/metric-learn/metric-learn/pull/95#discussion_r193009208"},"pull_request":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95"}},"in_reply_to_id":191324802},"pull_request":{"url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95","id":189669036,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5NjY5MDM2","html_url":"https://github.com/metric-learn/metric-learn/pull/95","diff_url":"https://github.com/metric-learn/metric-learn/pull/95.diff","patch_url":"https://github.com/metric-learn/metric-learn/pull/95.patch","issue_url":"https://api.github.com/repos/metric-learn/metric-learn/issues/95","number":95,"state":"open","locked":false,"title":"[MRG] New API should allow prediction functions and scoring","user":{"login":"wdevazelhes","id":31916524,"node_id":"MDQ6VXNlcjMxOTE2NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/31916524?v=4","gravatar_id":"","url":"https://api.github.com/users/wdevazelhes","html_url":"https://github.com/wdevazelhes","followers_url":"https://api.github.com/users/wdevazelhes/followers","following_url":"https://api.github.com/users/wdevazelhes/following{/other_user}","gists_url":"https://api.github.com/users/wdevazelhes/gists{/gist_id}","starred_url":"https://api.github.com/users/wdevazelhes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdevazelhes/subscriptions","organizations_url":"https://api.github.com/users/wdevazelhes/orgs","repos_url":"https://api.github.com/users/wdevazelhes/repos","events_url":"https://api.github.com/users/wdevazelhes/events{/privacy}","received_events_url":"https://api.github.com/users/wdevazelhes/received_events","type":"User","site_admin":false},"body":"The new API should allow metric learning algorithms that fit on tuples of points to also predict, score, etc on tuples, Therefore being usable in scikit-learn's cross-validation routines. This is part of the PRs need for issue #91.\r\n\r\n- [x] Take previous tests from https://github.com/metric-learn/metric-learn/pull/85, and refactor them using pytest, and to allow already formed tuples (3D arrays) instead of ``ConstrainedDatasets``.\r\n- [x] Take previous code from https://github.com/metric-learn/metric-learn/pull/85 and adapt it to formed tuples\r\n- [x] Make tests work\r\n- [x] Make some modifications if needed\r\n    - <strike>Move docstrings from ``_fit`` to ``fit``</strike>\r\n    - <strike>Remove unused imports</strike>","created_at":"2018-05-22T13:47:33Z","updated_at":"2018-06-05T09:40:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f1712abeeee89c3f5a026b2cf2adb40cf4e9f63","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nvauquie","id":19710083,"node_id":"MDQ6VXNlcjE5NzEwMDgz","avatar_url":"https://avatars1.githubusercontent.com/u/19710083?v=4","gravatar_id":"","url":"https://api.github.com/users/nvauquie","html_url":"https://github.com/nvauquie","followers_url":"https://api.github.com/users/nvauquie/followers","following_url":"https://api.github.com/users/nvauquie/following{/other_user}","gists_url":"https://api.github.com/users/nvauquie/gists{/gist_id}","starred_url":"https://api.github.com/users/nvauquie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvauquie/subscriptions","organizations_url":"https://api.github.com/users/nvauquie/orgs","repos_url":"https://api.github.com/users/nvauquie/repos","events_url":"https://api.github.com/users/nvauquie/events{/privacy}","received_events_url":"https://api.github.com/users/nvauquie/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95/commits","review_comments_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95/comments","review_comment_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metric-learn/metric-learn/issues/95/comments","statuses_url":"https://api.github.com/repos/metric-learn/metric-learn/statuses/a70d1a856a6b7aeb6ff5800e5f03ffc48bfb6163","head":{"label":"wdevazelhes:feat/api_prediction","ref":"feat/api_prediction","sha":"a70d1a856a6b7aeb6ff5800e5f03ffc48bfb6163","user":{"login":"wdevazelhes","id":31916524,"node_id":"MDQ6VXNlcjMxOTE2NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/31916524?v=4","gravatar_id":"","url":"https://api.github.com/users/wdevazelhes","html_url":"https://github.com/wdevazelhes","followers_url":"https://api.github.com/users/wdevazelhes/followers","following_url":"https://api.github.com/users/wdevazelhes/following{/other_user}","gists_url":"https://api.github.com/users/wdevazelhes/gists{/gist_id}","starred_url":"https://api.github.com/users/wdevazelhes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdevazelhes/subscriptions","organizations_url":"https://api.github.com/users/wdevazelhes/orgs","repos_url":"https://api.github.com/users/wdevazelhes/repos","events_url":"https://api.github.com/users/wdevazelhes/events{/privacy}","received_events_url":"https://api.github.com/users/wdevazelhes/received_events","type":"User","site_admin":false},"repo":{"id":121612336,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE2MTIzMzY=","name":"metric-learn","full_name":"wdevazelhes/metric-learn","owner":{"login":"wdevazelhes","id":31916524,"node_id":"MDQ6VXNlcjMxOTE2NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/31916524?v=4","gravatar_id":"","url":"https://api.github.com/users/wdevazelhes","html_url":"https://github.com/wdevazelhes","followers_url":"https://api.github.com/users/wdevazelhes/followers","following_url":"https://api.github.com/users/wdevazelhes/following{/other_user}","gists_url":"https://api.github.com/users/wdevazelhes/gists{/gist_id}","starred_url":"https://api.github.com/users/wdevazelhes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdevazelhes/subscriptions","organizations_url":"https://api.github.com/users/wdevazelhes/orgs","repos_url":"https://api.github.com/users/wdevazelhes/repos","events_url":"https://api.github.com/users/wdevazelhes/events{/privacy}","received_events_url":"https://api.github.com/users/wdevazelhes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wdevazelhes/metric-learn","description":"Metric learning algorithms in Python","fork":true,"url":"https://api.github.com/repos/wdevazelhes/metric-learn","forks_url":"https://api.github.com/repos/wdevazelhes/metric-learn/forks","keys_url":"https://api.github.com/repos/wdevazelhes/metric-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wdevazelhes/metric-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wdevazelhes/metric-learn/teams","hooks_url":"https://api.github.com/repos/wdevazelhes/metric-learn/hooks","issue_events_url":"https://api.github.com/repos/wdevazelhes/metric-learn/issues/events{/number}","events_url":"https://api.github.com/repos/wdevazelhes/metric-learn/events","assignees_url":"https://api.github.com/repos/wdevazelhes/metric-learn/assignees{/user}","branches_url":"https://api.github.com/repos/wdevazelhes/metric-learn/branches{/branch}","tags_url":"https://api.github.com/repos/wdevazelhes/metric-learn/tags","blobs_url":"https://api.github.com/repos/wdevazelhes/metric-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wdevazelhes/metric-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wdevazelhes/metric-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/wdevazelhes/metric-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wdevazelhes/metric-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/wdevazelhes/metric-learn/languages","stargazers_url":"https://api.github.com/repos/wdevazelhes/metric-learn/stargazers","contributors_url":"https://api.github.com/repos/wdevazelhes/metric-learn/contributors","subscribers_url":"https://api.github.com/repos/wdevazelhes/metric-learn/subscribers","subscription_url":"https://api.github.com/repos/wdevazelhes/metric-learn/subscription","commits_url":"https://api.github.com/repos/wdevazelhes/metric-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/wdevazelhes/metric-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/wdevazelhes/metric-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/wdevazelhes/metric-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/wdevazelhes/metric-learn/contents/{+path}","compare_url":"https://api.github.com/repos/wdevazelhes/metric-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wdevazelhes/metric-learn/merges","archive_url":"https://api.github.com/repos/wdevazelhes/metric-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wdevazelhes/metric-learn/downloads","issues_url":"https://api.github.com/repos/wdevazelhes/metric-learn/issues{/number}","pulls_url":"https://api.github.com/repos/wdevazelhes/metric-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/wdevazelhes/metric-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/wdevazelhes/metric-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wdevazelhes/metric-learn/labels{/name}","releases_url":"https://api.github.com/repos/wdevazelhes/metric-learn/releases{/id}","deployments_url":"https://api.github.com/repos/wdevazelhes/metric-learn/deployments","created_at":"2018-02-15T09:43:10Z","updated_at":"2018-05-18T16:09:46Z","pushed_at":"2018-05-25T16:49:42Z","git_url":"git://github.com/wdevazelhes/metric-learn.git","ssh_url":"git@github.com:wdevazelhes/metric-learn.git","clone_url":"https://github.com/wdevazelhes/metric-learn.git","svn_url":"https://github.com/wdevazelhes/metric-learn","homepage":null,"size":1453,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metric-learn:new_api_design","ref":"new_api_design","sha":"13f153568a0b37f77413a9c7d55e9f2570ae84a1","user":{"login":"metric-learn","id":35635935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjM1OTM1","avatar_url":"https://avatars1.githubusercontent.com/u/35635935?v=4","gravatar_id":"","url":"https://api.github.com/users/metric-learn","html_url":"https://github.com/metric-learn","followers_url":"https://api.github.com/users/metric-learn/followers","following_url":"https://api.github.com/users/metric-learn/following{/other_user}","gists_url":"https://api.github.com/users/metric-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/metric-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metric-learn/subscriptions","organizations_url":"https://api.github.com/users/metric-learn/orgs","repos_url":"https://api.github.com/users/metric-learn/repos","events_url":"https://api.github.com/users/metric-learn/events{/privacy}","received_events_url":"https://api.github.com/users/metric-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":14063354,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2MzM1NA==","name":"metric-learn","full_name":"metric-learn/metric-learn","owner":{"login":"metric-learn","id":35635935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjM1OTM1","avatar_url":"https://avatars1.githubusercontent.com/u/35635935?v=4","gravatar_id":"","url":"https://api.github.com/users/metric-learn","html_url":"https://github.com/metric-learn","followers_url":"https://api.github.com/users/metric-learn/followers","following_url":"https://api.github.com/users/metric-learn/following{/other_user}","gists_url":"https://api.github.com/users/metric-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/metric-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metric-learn/subscriptions","organizations_url":"https://api.github.com/users/metric-learn/orgs","repos_url":"https://api.github.com/users/metric-learn/repos","events_url":"https://api.github.com/users/metric-learn/events{/privacy}","received_events_url":"https://api.github.com/users/metric-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metric-learn/metric-learn","description":"Metric learning algorithms in Python","fork":false,"url":"https://api.github.com/repos/metric-learn/metric-learn","forks_url":"https://api.github.com/repos/metric-learn/metric-learn/forks","keys_url":"https://api.github.com/repos/metric-learn/metric-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metric-learn/metric-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metric-learn/metric-learn/teams","hooks_url":"https://api.github.com/repos/metric-learn/metric-learn/hooks","issue_events_url":"https://api.github.com/repos/metric-learn/metric-learn/issues/events{/number}","events_url":"https://api.github.com/repos/metric-learn/metric-learn/events","assignees_url":"https://api.github.com/repos/metric-learn/metric-learn/assignees{/user}","branches_url":"https://api.github.com/repos/metric-learn/metric-learn/branches{/branch}","tags_url":"https://api.github.com/repos/metric-learn/metric-learn/tags","blobs_url":"https://api.github.com/repos/metric-learn/metric-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metric-learn/metric-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metric-learn/metric-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/metric-learn/metric-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metric-learn/metric-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/metric-learn/metric-learn/languages","stargazers_url":"https://api.github.com/repos/metric-learn/metric-learn/stargazers","contributors_url":"https://api.github.com/repos/metric-learn/metric-learn/contributors","subscribers_url":"https://api.github.com/repos/metric-learn/metric-learn/subscribers","subscription_url":"https://api.github.com/repos/metric-learn/metric-learn/subscription","commits_url":"https://api.github.com/repos/metric-learn/metric-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/metric-learn/metric-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/metric-learn/metric-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/metric-learn/metric-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/metric-learn/metric-learn/contents/{+path}","compare_url":"https://api.github.com/repos/metric-learn/metric-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metric-learn/metric-learn/merges","archive_url":"https://api.github.com/repos/metric-learn/metric-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metric-learn/metric-learn/downloads","issues_url":"https://api.github.com/repos/metric-learn/metric-learn/issues{/number}","pulls_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/metric-learn/metric-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/metric-learn/metric-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metric-learn/metric-learn/labels{/name}","releases_url":"https://api.github.com/repos/metric-learn/metric-learn/releases{/id}","deployments_url":"https://api.github.com/repos/metric-learn/metric-learn/deployments","created_at":"2013-11-02T08:29:47Z","updated_at":"2018-06-04T03:28:27Z","pushed_at":"2018-05-25T16:49:43Z","git_url":"git://github.com/metric-learn/metric-learn.git","ssh_url":"git@github.com:metric-learn/metric-learn.git","clone_url":"https://github.com/metric-learn/metric-learn.git","svn_url":"https://github.com/metric-learn/metric-learn","homepage":null,"size":1356,"stargazers_count":426,"watchers_count":426,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":121,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":121,"open_issues":25,"watchers":426,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95"},"html":{"href":"https://github.com/metric-learn/metric-learn/pull/95"},"issue":{"href":"https://api.github.com/repos/metric-learn/metric-learn/issues/95"},"comments":{"href":"https://api.github.com/repos/metric-learn/metric-learn/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/metric-learn/metric-learn/statuses/a70d1a856a6b7aeb6ff5800e5f03ffc48bfb6163"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"wdevazelhes"}}