{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/43988145","id":43988145,"diff_hunk":"@@ -93,27 +96,16 @@ def generate_dataset(n_train, n_test, n_features, noise=0.1, verbose=False):\n     \"\"\"Generate a regression dataset with the given parameters.\"\"\"\n     if verbose:\n         print(\"generating dataset...\")\n+\n     X, y, coef = make_regression(n_samples=n_train + n_test,\n                                  n_features=n_features, noise=noise, coef=True)\n-    X_train = X[:n_train]\n-    y_train = y[:n_train]\n-    X_test = X[n_train:]\n-    y_test = y[n_train:]\n-    idx = np.arange(n_train)\n-    np.random.seed(13)\n-    np.random.shuffle(idx)\n-    X_train = X_train[idx]\n-    y_train = y_train[idx]\n-\n-    std = X_train.std(axis=0)\n-    mean = X_train.mean(axis=0)\n-    X_train = (X_train - mean) / std\n-    X_test = (X_test - mean) / std\n-\n-    std = y_train.std(axis=0)\n-    mean = y_train.mean(axis=0)\n-    y_train = (y_train - mean) / std\n-    y_test = (y_test - mean) / std\n+    \n+    X = StandardScaler().fit_transform(X)\n+    y = StandardScaler().fit_transform(y)\n+\n+    X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=n_train)","path":"examples/applications/plot_prediction_latency.py","position":46,"original_position":46,"commit_id":"b56af363faaa2f96a019e684ea8dfa585866367d","original_commit_id":"b56af363faaa2f96a019e684ea8dfa585866367d","user":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?v=3","gravatar_id":"","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"body":"If we want things to be reproducible, we should also set the random_state on train_test_split.","created_at":"2015-11-05T08:47:14Z","updated_at":"2015-11-05T08:47:14Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5730#discussion_r43988145","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/43988145"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5730#discussion_r43988145"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730","id":49778535,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/5730","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/5730.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/5730.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5730","number":5730,"state":"open","locked":false,"title":"Bugfix/5720","user":{"login":"hdmetor","id":4465200,"avatar_url":"https://avatars.githubusercontent.com/u/4465200?v=3","gravatar_id":"","url":"https://api.github.com/users/hdmetor","html_url":"https://github.com/hdmetor","followers_url":"https://api.github.com/users/hdmetor/followers","following_url":"https://api.github.com/users/hdmetor/following{/other_user}","gists_url":"https://api.github.com/users/hdmetor/gists{/gist_id}","starred_url":"https://api.github.com/users/hdmetor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdmetor/subscriptions","organizations_url":"https://api.github.com/users/hdmetor/orgs","repos_url":"https://api.github.com/users/hdmetor/repos","events_url":"https://api.github.com/users/hdmetor/events{/privacy}","received_events_url":"https://api.github.com/users/hdmetor/received_events","type":"User","site_admin":false},"body":"Fix for https://github.com/scikit-learn/scikit-learn/issues/5720","created_at":"2015-11-05T03:29:53Z","updated_at":"2015-11-05T08:47:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96f1e8257edd93c84f4c8c21bdff4d4f900b4c18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730/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/5730/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/b56af363faaa2f96a019e684ea8dfa585866367d","head":{"label":"hdmetor:bugfix/5720","ref":"bugfix/5720","sha":"b56af363faaa2f96a019e684ea8dfa585866367d","user":{"login":"hdmetor","id":4465200,"avatar_url":"https://avatars.githubusercontent.com/u/4465200?v=3","gravatar_id":"","url":"https://api.github.com/users/hdmetor","html_url":"https://github.com/hdmetor","followers_url":"https://api.github.com/users/hdmetor/followers","following_url":"https://api.github.com/users/hdmetor/following{/other_user}","gists_url":"https://api.github.com/users/hdmetor/gists{/gist_id}","starred_url":"https://api.github.com/users/hdmetor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdmetor/subscriptions","organizations_url":"https://api.github.com/users/hdmetor/orgs","repos_url":"https://api.github.com/users/hdmetor/repos","events_url":"https://api.github.com/users/hdmetor/events{/privacy}","received_events_url":"https://api.github.com/users/hdmetor/received_events","type":"User","site_admin":false},"repo":{"id":38603735,"name":"scikit-learn","full_name":"hdmetor/scikit-learn","owner":{"login":"hdmetor","id":4465200,"avatar_url":"https://avatars.githubusercontent.com/u/4465200?v=3","gravatar_id":"","url":"https://api.github.com/users/hdmetor","html_url":"https://github.com/hdmetor","followers_url":"https://api.github.com/users/hdmetor/followers","following_url":"https://api.github.com/users/hdmetor/following{/other_user}","gists_url":"https://api.github.com/users/hdmetor/gists{/gist_id}","starred_url":"https://api.github.com/users/hdmetor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdmetor/subscriptions","organizations_url":"https://api.github.com/users/hdmetor/orgs","repos_url":"https://api.github.com/users/hdmetor/repos","events_url":"https://api.github.com/users/hdmetor/events{/privacy}","received_events_url":"https://api.github.com/users/hdmetor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hdmetor/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/hdmetor/scikit-learn","forks_url":"https://api.github.com/repos/hdmetor/scikit-learn/forks","keys_url":"https://api.github.com/repos/hdmetor/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hdmetor/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hdmetor/scikit-learn/teams","hooks_url":"https://api.github.com/repos/hdmetor/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/hdmetor/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/hdmetor/scikit-learn/events","assignees_url":"https://api.github.com/repos/hdmetor/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/hdmetor/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/hdmetor/scikit-learn/tags","blobs_url":"https://api.github.com/repos/hdmetor/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hdmetor/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hdmetor/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/hdmetor/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hdmetor/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/hdmetor/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/hdmetor/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/hdmetor/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/hdmetor/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/hdmetor/scikit-learn/subscription","commits_url":"https://api.github.com/repos/hdmetor/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/hdmetor/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/hdmetor/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/hdmetor/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/hdmetor/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/hdmetor/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hdmetor/scikit-learn/merges","archive_url":"https://api.github.com/repos/hdmetor/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hdmetor/scikit-learn/downloads","issues_url":"https://api.github.com/repos/hdmetor/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/hdmetor/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/hdmetor/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/hdmetor/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hdmetor/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/hdmetor/scikit-learn/releases{/id}","created_at":"2015-07-06T07:21:29Z","updated_at":"2015-07-06T07:21:34Z","pushed_at":"2015-11-05T03:28:57Z","git_url":"git://github.com/hdmetor/scikit-learn.git","ssh_url":"git@github.com:hdmetor/scikit-learn.git","clone_url":"https://github.com/hdmetor/scikit-learn.git","svn_url":"https://github.com/hdmetor/scikit-learn","homepage":"http://scikit-learn.org","size":63175,"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":"53bc02a3f375cb5ea234e9ba5e4f9c03ccce7c2b","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-11-05T08:38:30Z","pushed_at":"2015-11-05T08:47:06Z","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":143450,"stargazers_count":8121,"watchers_count":8121,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4838,"mirror_url":null,"open_issues_count":833,"forks":4838,"open_issues":833,"watchers":8121,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5730"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5730"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5730/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5730/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/5730/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/b56af363faaa2f96a019e684ea8dfa585866367d"}}}}