{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/46078538","id":46078538,"diff_hunk":"@@ -244,3 +243,12 @@ program: Insert the following instructions in your main script::\n \n You can find more default on the new start methods in the `multiprocessing\n documentation <https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods>`_.\n+\n+How do I set a random_state for an entire execution?\n+----------------------------------------------------\n+\n+For testing and replicability, it is often important to have the entire execution\n+controlled by a single seed for the pseudo-random number generator used in algorithms\n+that have a randomized component. While there is no ``random.seed(seed)`` function,\n+scikit-learn uses the global random states by default and one could thus define a\n+global random state that would be used throughout an execution.","path":"doc/faq.rst","position":29,"original_position":29,"commit_id":"58360a57a9bff337fddc006d23b5e3362e361730","original_commit_id":"58360a57a9bff337fddc006d23b5e3362e361730","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":"I think that you should be more explicit here and give a specific example:\r\n<pre>\r\n>>> import numpy as np\r\n>>> np.random.seed(42)\r\n</pre>","created_at":"2015-11-28T10:25:46Z","updated_at":"2015-11-28T10:25:46Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5927#discussion_r46078538","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/46078538"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5927#discussion_r46078538"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927","id":51955868,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/5927","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/5927.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/5927.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5927","number":5927,"state":"open","locked":false,"title":"edited the FAQ to fix a typo and include info regarding global random states","user":{"login":"nelson-liu","id":7272031,"avatar_url":"https://avatars.githubusercontent.com/u/7272031?v=3","gravatar_id":"","url":"https://api.github.com/users/nelson-liu","html_url":"https://github.com/nelson-liu","followers_url":"https://api.github.com/users/nelson-liu/followers","following_url":"https://api.github.com/users/nelson-liu/following{/other_user}","gists_url":"https://api.github.com/users/nelson-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/nelson-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelson-liu/subscriptions","organizations_url":"https://api.github.com/users/nelson-liu/orgs","repos_url":"https://api.github.com/users/nelson-liu/repos","events_url":"https://api.github.com/users/nelson-liu/events{/privacy}","received_events_url":"https://api.github.com/users/nelson-liu/received_events","type":"User","site_admin":false},"body":"Attempts to address issue https://github.com/scikit-learn/scikit-learn/issues/5781. Fixed a typo (where -> were in \"Also not scikits.learn or scikits-learn, which where previously used.\"). Also added info regarding the scikit-learn's use of  global random states.","created_at":"2015-11-27T02:50:16Z","updated_at":"2015-11-28T10:25:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a555aee267742fa13b45225404217b80999be309","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927/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/5927/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/58360a57a9bff337fddc006d23b5e3362e361730","head":{"label":"nelson-liu:add_global_random_state_info_to_faq","ref":"add_global_random_state_info_to_faq","sha":"58360a57a9bff337fddc006d23b5e3362e361730","user":{"login":"nelson-liu","id":7272031,"avatar_url":"https://avatars.githubusercontent.com/u/7272031?v=3","gravatar_id":"","url":"https://api.github.com/users/nelson-liu","html_url":"https://github.com/nelson-liu","followers_url":"https://api.github.com/users/nelson-liu/followers","following_url":"https://api.github.com/users/nelson-liu/following{/other_user}","gists_url":"https://api.github.com/users/nelson-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/nelson-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelson-liu/subscriptions","organizations_url":"https://api.github.com/users/nelson-liu/orgs","repos_url":"https://api.github.com/users/nelson-liu/repos","events_url":"https://api.github.com/users/nelson-liu/events{/privacy}","received_events_url":"https://api.github.com/users/nelson-liu/received_events","type":"User","site_admin":false},"repo":{"id":46840245,"name":"scikit-learn","full_name":"nelson-liu/scikit-learn","owner":{"login":"nelson-liu","id":7272031,"avatar_url":"https://avatars.githubusercontent.com/u/7272031?v=3","gravatar_id":"","url":"https://api.github.com/users/nelson-liu","html_url":"https://github.com/nelson-liu","followers_url":"https://api.github.com/users/nelson-liu/followers","following_url":"https://api.github.com/users/nelson-liu/following{/other_user}","gists_url":"https://api.github.com/users/nelson-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/nelson-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelson-liu/subscriptions","organizations_url":"https://api.github.com/users/nelson-liu/orgs","repos_url":"https://api.github.com/users/nelson-liu/repos","events_url":"https://api.github.com/users/nelson-liu/events{/privacy}","received_events_url":"https://api.github.com/users/nelson-liu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nelson-liu/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/nelson-liu/scikit-learn","forks_url":"https://api.github.com/repos/nelson-liu/scikit-learn/forks","keys_url":"https://api.github.com/repos/nelson-liu/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nelson-liu/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nelson-liu/scikit-learn/teams","hooks_url":"https://api.github.com/repos/nelson-liu/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/nelson-liu/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/nelson-liu/scikit-learn/events","assignees_url":"https://api.github.com/repos/nelson-liu/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/nelson-liu/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/nelson-liu/scikit-learn/tags","blobs_url":"https://api.github.com/repos/nelson-liu/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nelson-liu/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nelson-liu/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nelson-liu/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nelson-liu/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/nelson-liu/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/nelson-liu/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/nelson-liu/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/nelson-liu/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/nelson-liu/scikit-learn/subscription","commits_url":"https://api.github.com/repos/nelson-liu/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nelson-liu/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nelson-liu/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nelson-liu/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/nelson-liu/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/nelson-liu/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nelson-liu/scikit-learn/merges","archive_url":"https://api.github.com/repos/nelson-liu/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nelson-liu/scikit-learn/downloads","issues_url":"https://api.github.com/repos/nelson-liu/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/nelson-liu/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/nelson-liu/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/nelson-liu/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nelson-liu/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/nelson-liu/scikit-learn/releases{/id}","created_at":"2015-11-25T05:44:49Z","updated_at":"2015-11-25T05:45:03Z","pushed_at":"2015-11-27T02:48:08Z","git_url":"git://github.com/nelson-liu/scikit-learn.git","ssh_url":"git@github.com:nelson-liu/scikit-learn.git","clone_url":"https://github.com/nelson-liu/scikit-learn.git","svn_url":"https://github.com/nelson-liu/scikit-learn","homepage":"http://scikit-learn.org","size":69976,"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":"335536ce44ec34c4b4d3dafc9ea3920347c57f3e","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-28T07:28:45Z","pushed_at":"2015-11-28T09:55:37Z","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":103779,"stargazers_count":8425,"watchers_count":8425,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5041,"mirror_url":null,"open_issues_count":933,"forks":5041,"open_issues":933,"watchers":8425,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5927"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5927"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5927/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5927/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/5927/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/58360a57a9bff337fddc006d23b5e3362e361730"}}}}