{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4597","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4597/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4597/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4597/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4597","id":68665973,"number":4597,"title":"LassoLarsCV error if n_jobs > 1","user":{"login":"DonBeo","id":4463692,"avatar_url":"https://avatars.githubusercontent.com/u/4463692?v=3","gravatar_id":"","url":"https://api.github.com/users/DonBeo","html_url":"https://github.com/DonBeo","followers_url":"https://api.github.com/users/DonBeo/followers","following_url":"https://api.github.com/users/DonBeo/following{/other_user}","gists_url":"https://api.github.com/users/DonBeo/gists{/gist_id}","starred_url":"https://api.github.com/users/DonBeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonBeo/subscriptions","organizations_url":"https://api.github.com/users/DonBeo/orgs","repos_url":"https://api.github.com/users/DonBeo/repos","events_url":"https://api.github.com/users/DonBeo/events{/privacy}","received_events_url":"https://api.github.com/users/DonBeo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/15","html_url":"https://github.com/scikit-learn/scikit-learn/milestones/0.17","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/15/labels","id":995666,"number":15,"title":"0.17","description":"","creator":{"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},"open_issues":7,"closed_issues":2,"state":"open","created_at":"2015-02-25T18:59:07Z","updated_at":"2015-04-27T18:47:03Z","due_on":"2015-07-01T04:00:00Z","closed_at":null},"comments":11,"created_at":"2015-04-15T12:16:38Z","updated_at":"2015-05-01T20:21:45Z","closed_at":null,"body":"```python\r\nn,p = 2194, 12277\r\nX = np.random.normal(0, 1, (n, p))\r\ny = X[:,1] + X[:,2] + np.random.normal(0,1, n)\r\n\r\n\r\nl1 = LassoLarsCV(n_jobs=1).fit(X,y)\r\nprint(l1.coef_)\r\nl = LassoLarsCV(n_jobs=-1).fit(X,y)\r\nprint(l.coef_)\r\n\r\nOUTPUT\r\n\r\n>>> \r\n>>> \r\n[ 0.          0.91122441  0.88051206 ...,  0.          0.          0.        ]\r\nmultiprocessing.pool.RemoteTraceback: \r\n\"\"\"\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/externals/joblib/parallel.py\", line 94, in __call__\r\n    return self.func(*args, **kwargs)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/linear_model/least_angle.py\", line 853, in _lars_path_residues\r\n    X_train -= X_mean\r\nValueError: output array is read-only\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.4/multiprocessing/pool.py\", line 119, in worker\r\n    result = (True, func(*args, **kwds))\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/externals/joblib/parallel.py\", line 104, in __call__\r\n    raise TransportableException(text, e_type)\r\nsklearn.externals.joblib.my_exceptions.TransportableException: TransportableException\r\n___________________________________________________________________________\r\nValueError                                         Wed Apr 15 14:14:46 2015\r\nPID: 4123                                    Python 3.4.0: /usr/bin/python3\r\n...........................................................................\r\n/usr/local/lib/python3.4/dist-packages/sklearn/linear_model/least_angle.py in _lars_path_residues(X_train=memmap([[ 1.00577915, -1.05126903,  1.30304231, ... -0.35100295,\r\n        -0.9267396 ,  0.63928884]]), y_train=array([ 1.3232542 ,  0.84262663, -2.62905025, ...,  1.62472897,\r\n       -1.45902494, -5.00504709]), X_test=array([[-0.31256648, -0.8413869 ,  0.46347277, ....  1.21977537,\r\n        -1.12781956, -1.12695671]]), y_test=array([ -1.91413301e-02,  -7.90822410e-01,  -2.1...2352138e-01,  -2.06750561e+00,  -3.79778359e-01]), Gram='auto', copy=False, method='lasso', verbose=0, fit_intercept=True, normalize=True, max_iter=500, eps=2.2204460492503131e-16)\r\n    848         X_test = X_test.copy()\r\n    849         y_test = y_test.copy()\r\n    850 \r\n    851     if fit_intercept:\r\n    852         X_mean = X_train.mean(axis=0)\r\n--> 853         X_train -= X_mean\r\n        X_train = memmap([[ 1.00577915, -1.05126903,  1.30304231, ... -0.35100295,\r\n        -0.9267396 ,  0.63928884]])\r\n        X_mean = memmap([-0.01531417,  0.02889734, -0.01592266, ...,  0.00315228,\r\n       -0.00060194,  0.01170645])\r\n    854         X_test -= X_mean\r\n    855         y_mean = y_train.mean(axis=0)\r\n    856         y_train = as_float_array(y_train, copy=False)\r\n    857         y_train -= y_mean\r\n\r\nValueError: output array is read-only\r\n___________________________________________________________________________\r\n\"\"\"\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/externals/joblib/parallel.py\", line 518, in retrieve\r\n    self._output.append(job.get())\r\n  File \"/usr/lib/python3.4/multiprocessing/pool.py\", line 599, in get\r\n    raise self._value\r\nsklearn.externals.joblib.my_exceptions.TransportableException: TransportableException\r\n___________________________________________________________________________\r\nValueError                                         Wed Apr 15 14:14:46 2015\r\nPID: 4123                                    Python 3.4.0: /usr/bin/python3\r\n...........................................................................\r\n/usr/local/lib/python3.4/dist-packages/sklearn/linear_model/least_angle.py in _lars_path_residues(X_train=memmap([[ 1.00577915, -1.05126903,  1.30304231, ... -0.35100295,\r\n        -0.9267396 ,  0.63928884]]), y_train=array([ 1.3232542 ,  0.84262663, -2.62905025, ...,  1.62472897,\r\n       -1.45902494, -5.00504709]), X_test=array([[-0.31256648, -0.8413869 ,  0.46347277, ....  1.21977537,\r\n        -1.12781956, -1.12695671]]), y_test=array([ -1.91413301e-02,  -7.90822410e-01,  -2.1...2352138e-01,  -2.06750561e+00,  -3.79778359e-01]), Gram='auto', copy=False, method='lasso', verbose=0, fit_intercept=True, normalize=True, max_iter=500, eps=2.2204460492503131e-16)\r\n    848         X_test = X_test.copy()\r\n    849         y_test = y_test.copy()\r\n    850 \r\n    851     if fit_intercept:\r\n    852         X_mean = X_train.mean(axis=0)\r\n--> 853         X_train -= X_mean\r\n        X_train = memmap([[ 1.00577915, -1.05126903,  1.30304231, ... -0.35100295,\r\n        -0.9267396 ,  0.63928884]])\r\n        X_mean = memmap([-0.01531417,  0.02889734, -0.01592266, ...,  0.00315228,\r\n       -0.00060194,  0.01170645])\r\n    854         X_test -= X_mean\r\n    855         y_mean = y_train.mean(axis=0)\r\n    856         y_train = as_float_array(y_train, copy=False)\r\n    857         y_train -= y_mean\r\n\r\nValueError: output array is read-only\r\n___________________________________________________________________________\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/donbeo/Desktop/prova.py\", line 31, in <module>\r\n    l = LassoLarsCV(n_jobs=-1).fit(X,y)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/linear_model/least_angle.py\", line 999, in fit\r\n    for train, test in cv)\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/externals/joblib/parallel.py\", line 666, in __call__\r\n    self.retrieve()\r\n  File \"/usr/local/lib/python3.4/dist-packages/sklearn/externals/joblib/parallel.py\", line 549, in retrieve\r\n    raise exception_type(report)\r\nsklearn.externals.joblib.my_exceptions.JoblibValueError: JoblibValueError\r\n___________________________________________________________________________\r\nMultiprocessing exception:\r\n    ...........................................................................\r\n/home/donbeo/Desktop/<stdin> in <module>()\r\n----> 1 \r\n      2 \r\n      3 \r\n      4 \r\n      5 \r\n      6 \r\n      7 \r\n      8 \r\n      9 \r\n     10 \r\n\r\n...........................................................................\r\n/home/donbeo/Desktop/prova.py in <module>()\r\n     26 y = X[:,1] + X[:,2] + np.random.normal(0,1, n)\r\n     27 \r\n     28 \r\n     29 l1 = LassoLarsCV(n_jobs=1).fit(X,y)\r\n     30 print(l1.coef_)\r\n---> 31 l = LassoLarsCV(n_jobs=-1).fit(X,y)\r\n     32 print(l.coef_)\r\n     33 \r\n     34 \r\n     35 \r\n\r\n...........................................................................\r\n/usr/local/lib/python3.4/dist-packages/sklearn/linear_model/least_angle.py in fit(self=LassoLarsCV(copy_X=True, cv=None, eps=2.22044604...normalize=True, precompute='auto', verbose=False), X=array([[-0.31256648, -0.8413869 ,  0.46347277, .... -0.35100295,\r\n        -0.9267396 ,  0.63928884]]), y=array([-0.01914133, -0.79082241, -2.15777265, ...,  1.62472897,\r\n       -1.45902494, -5.00504709]))\r\n    994             delayed(_lars_path_residues)(\r\n    995                 X[train], y[train], X[test], y[test], Gram=Gram, copy=False,\r\n    996                 method=self.method, verbose=max(0, self.verbose - 1),\r\n    997                 normalize=self.normalize, fit_intercept=self.fit_intercept,\r\n    998                 max_iter=self.max_iter, eps=self.eps)\r\n--> 999             for train, test in cv)\r\n        cv = sklearn.cross_validation.KFold(n=2194, n_folds=3, shuffle=False, random_state=None)\r\n   1000         all_alphas = np.concatenate(list(zip(*cv_paths))[0])\r\n   1001         # Unique also sorts\r\n   1002         all_alphas = np.unique(all_alphas)\r\n   1003         # Take at most max_n_alphas values\r\n\r\n...........................................................................\r\n/usr/local/lib/python3.4/dist-packages/sklearn/externals/joblib/parallel.py in __call__(self=Parallel(n_jobs=-1), iterable=<generator object <genexpr>>)\r\n    661             if pre_dispatch == \"all\" or n_jobs == 1:\r\n    662                 # The iterable was consumed all at once by the above for loop.\r\n    663                 # No need to wait for async callbacks to trigger to\r\n    664                 # consumption.\r\n    665                 self._iterating = False\r\n--> 666             self.retrieve()\r\n        self.retrieve = <bound method Parallel.retrieve of Parallel(n_jobs=-1)>\r\n    667             # Make sure that we get a last message telling us we are done\r\n    668             elapsed_time = time.time() - self._start_time\r\n    669             self._print('Done %3i out of %3i | elapsed: %s finished',\r\n    670                         (len(self._output),\r\n\r\n    ---------------------------------------------------------------------------\r\n    Sub-process traceback:\r\n    ---------------------------------------------------------------------------\r\n    ValueError                                         Wed Apr 15 14:14:46 2015\r\nPID: 4123                                    Python 3.4.0: /usr/bin/python3\r\n...........................................................................\r\n/usr/local/lib/python3.4/dist-packages/sklearn/linear_model/least_angle.py in _lars_path_residues(X_train=memmap([[ 1.00577915, -1.05126903,  1.30304231, ... -0.35100295,\r\n        -0.9267396 ,  0.63928884]]), y_train=array([ 1.3232542 ,  0.84262663, -2.62905025, ...,  1.62472897,\r\n       -1.45902494, -5.00504709]), X_test=array([[-0.31256648, -0.8413869 ,  0.46347277, ....  1.21977537,\r\n        -1.12781956, -1.12695671]]), y_test=array([ -1.91413301e-02,  -7.90822410e-01,  -2.1...2352138e-01,  -2.06750561e+00,  -3.79778359e-01]), Gram='auto', copy=False, method='lasso', verbose=0, fit_intercept=True, normalize=True, max_iter=500, eps=2.2204460492503131e-16)\r\n    848         X_test = X_test.copy()\r\n    849         y_test = y_test.copy()\r\n    850 \r\n    851     if fit_intercept:\r\n    852         X_mean = X_train.mean(axis=0)\r\n--> 853         X_train -= X_mean\r\n        X_train = memmap([[ 1.00577915, -1.05126903,  1.30304231, ... -0.35100295,\r\n        -0.9267396 ,  0.63928884]])\r\n        X_mean = memmap([-0.01531417,  0.02889734, -0.01592266, ...,  0.00315228,\r\n       -0.00060194,  0.01170645])\r\n    854         X_test -= X_mean\r\n    855         y_mean = y_train.mean(axis=0)\r\n    856         y_train = as_float_array(y_train, copy=False)\r\n    857         y_train -= y_mean\r\n\r\nValueError: output array is read-only\r\n___________________________________________________________________________\r\n>>> >>> \r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/98224266","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4597#issuecomment-98224266","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4597","id":98224266,"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},"created_at":"2015-05-01T20:21:45Z","updated_at":"2015-05-01T20:21:45Z","body":"@ogrisel @GaelVaroquaux could either of you explain why X is not writable? This is multi-processing, and X is copied, right?"}}