{"action":"created","comment":{"url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/comments/172449501","pull_request_review_id":101464275,"id":172449501,"diff_hunk":"@@ -59,7 +59,7 @@ def fit(self, X, y):\n \n class WeaklySupervisedMetricLearner(BaseMetricLearner):\n \n-  def fit(self, X, constraints):\n+  def fit(self, constrained_dataset, y):","path":"metric_learn/base_metric.py","position":null,"original_position":5,"commit_id":"ac00b8b74b092dc0f495c53a7519bfce5db9dde6","original_commit_id":"ac00b8b74b092dc0f495c53a7519bfce5db9dde6","user":{"login":"bellet","id":7905665,"avatar_url":"https://avatars1.githubusercontent.com/u/7905665?v=4","gravatar_id":"","url":"https://api.github.com/users/bellet","html_url":"https://github.com/bellet","followers_url":"https://api.github.com/users/bellet/followers","following_url":"https://api.github.com/users/bellet/following{/other_user}","gists_url":"https://api.github.com/users/bellet/gists{/gist_id}","starred_url":"https://api.github.com/users/bellet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bellet/subscriptions","organizations_url":"https://api.github.com/users/bellet/orgs","repos_url":"https://api.github.com/users/bellet/repos","events_url":"https://api.github.com/users/bellet/events{/privacy}","received_events_url":"https://api.github.com/users/bellet/received_events","type":"User","site_admin":false},"body":"maybe think of a more concise naming convention instead of `constrained_dataset` as it is gonna be used all over the place. `X_constrained` perhaps?","created_at":"2018-03-06T09:06:57Z","updated_at":"2018-03-06T09:31:15Z","html_url":"https://github.com/metric-learn/metric-learn/pull/85#discussion_r172449501","pull_request_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/85","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/comments/172449501"},"html":{"href":"https://github.com/metric-learn/metric-learn/pull/85#discussion_r172449501"},"pull_request":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/85","id":171408407,"html_url":"https://github.com/metric-learn/metric-learn/pull/85","diff_url":"https://github.com/metric-learn/metric-learn/pull/85.diff","patch_url":"https://github.com/metric-learn/metric-learn/pull/85.patch","issue_url":"https://api.github.com/repos/metric-learn/metric-learn/issues/85","number":85,"state":"open","locked":false,"title":"[WIP] New API proposal","user":{"login":"wdevazelhes","id":31916524,"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":"This PR intends to provide a new API for the package, that would allow to use scikit-learn's tools for model selection and pipelining not only for supervised algorithms but also for weakly supervised ones. Indeed we would like to be able for instance to have a dataset of pairs, an algorithm that works on labeled pairs (i.e. pairwise constraints) and plug it into say scikit-learn's 'roc_auc' cross-validation scoring. This cross-validation scoring would split on the **pairs** and return the score of a classification of **pairs**. However we don't want to build an explicit dataset of pairs: indeed if we duplicate a point as many times as it is involved in a pair, the dataset would be huge. Instead, we would build a object that acts **as if** it was a list of pairs, but in fact stores the initial dataset as well as indices. The behaviour of such an object and use basic use cases can be found in this binder notebook: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/wdevazelhes/api_metric_learn/master).\r\n\r\nThis PR will be complete when the following will be done: \r\n\r\n- [X] Keep the same API but introduce the objects that will be used in the new API\r\n- [ ] Create an object ConstrainedDataset that will allow the behaviour presented in the description\r\n- [ ] Modify existing algorithms to use this object. The API will then be changed (only for algorithms that take as an input an some labeled pairs of samples instead of labeled samples).\r\n- [ ] Write the appropriate documentation\r\n\r\n","created_at":"2018-02-26T15:34:18Z","updated_at":"2018-03-06T09:31:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"564e03d2e7351492f462a12f280e598f0984ba04","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nvauquie","id":19710083,"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/85/commits","review_comments_url":"https://api.github.com/repos/metric-learn/metric-learn/pulls/85/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/85/comments","statuses_url":"https://api.github.com/repos/metric-learn/metric-learn/statuses/ac00b8b74b092dc0f495c53a7519bfce5db9dde6","head":{"label":"wdevazelhes:new_api","ref":"new_api","sha":"ac00b8b74b092dc0f495c53a7519bfce5db9dde6","user":{"login":"wdevazelhes","id":31916524,"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,"name":"metric-learn","full_name":"wdevazelhes/metric-learn","owner":{"login":"wdevazelhes","id":31916524,"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-02-15T09:43:11Z","pushed_at":"2018-03-05T17:39:00Z","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":1368,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metric-learn:master","ref":"master","sha":"1193c7b774ada526636d6550eb3bda4fd6dfcba8","user":{"login":"metric-learn","id":35635935,"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,"name":"metric-learn","full_name":"metric-learn/metric-learn","owner":{"login":"metric-learn","id":35635935,"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-03-01T11:47:35Z","pushed_at":"2018-03-05T17:39:01Z","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":1343,"stargazers_count":379,"watchers_count":379,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":111,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":111,"open_issues":19,"watchers":379,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/85"},"html":{"href":"https://github.com/metric-learn/metric-learn/pull/85"},"issue":{"href":"https://api.github.com/repos/metric-learn/metric-learn/issues/85"},"comments":{"href":"https://api.github.com/repos/metric-learn/metric-learn/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/metric-learn/metric-learn/pulls/85/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/85/commits"},"statuses":{"href":"https://api.github.com/repos/metric-learn/metric-learn/statuses/ac00b8b74b092dc0f495c53a7519bfce5db9dde6"}},"author_association":"NONE"}}
{"actor":{"display_login":"bellet"}}