{"action":"opened","issue":{"url":"https://api.github.com/repos/natekupp/ffx/issues/16","labels_url":"https://api.github.com/repos/natekupp/ffx/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/natekupp/ffx/issues/16/comments","events_url":"https://api.github.com/repos/natekupp/ffx/issues/16/events","html_url":"https://github.com/natekupp/ffx/issues/16","id":111696170,"number":16,"title":"Error on some data","user":{"login":"zegkljan","id":6035604,"avatar_url":"https://avatars.githubusercontent.com/u/6035604?v=3","gravatar_id":"","url":"https://api.github.com/users/zegkljan","html_url":"https://github.com/zegkljan","followers_url":"https://api.github.com/users/zegkljan/followers","following_url":"https://api.github.com/users/zegkljan/following{/other_user}","gists_url":"https://api.github.com/users/zegkljan/gists{/gist_id}","starred_url":"https://api.github.com/users/zegkljan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zegkljan/subscriptions","organizations_url":"https://api.github.com/users/zegkljan/orgs","repos_url":"https://api.github.com/users/zegkljan/repos","events_url":"https://api.github.com/users/zegkljan/events{/privacy}","received_events_url":"https://api.github.com/users/zegkljan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-15T20:01:22Z","updated_at":"2015-10-15T20:01:22Z","closed_at":null,"body":"We want to use FFX in a comparative study but we ran into a problem: for some data, in STEP 2 there are somehow 0 bases (``STEP 2: Regress on all 0 bases: begin.``) and in this case the pathwise learn fails because of an empty array:\r\n\r\n```\r\n...\r\nBuild with approach 2/7 (inter1 denom0 expon0 nonlin0 thresh1): begin\r\n  STEP 1A: Build order-1 bases: begin\r\n  STEP 1A: Build order-1 bases: done.  Have 65 order-1 bases.\r\n  STEP 1B: Find order-1 base infls: begin\r\n    Pathwise learn: begin. max_num_bases=65\r\n      alpha 1/1249 (4.091439e-02): num_bases=0, nmse=0.009177, time 1.83 s\r\n    Pathwise learn: Early stop because nmse < target\r\n  STEP 1B: Find order-1 base infls: done\r\n  STEP 1C: Build order-2 bases: begin\r\n  STEP 1C: Build order-2 bases: done.  Have 0 order-2 bases.\r\n  STEP 2: Regress on all 0 bases: begin.\r\n    Pathwise learn: begin. max_num_bases=250\r\nTraceback (most recent call last):\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/code/run.py\", line 205, in <module>\r\n    main()\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/code/run.py\", line 122, in main\r\n    verbose=True)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/api.py\", line 4, in run\r\n    return core.MultiFFXModelFactory().build(train_X, train_y, test_X, test_y, varnames, verbose)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/core.py\", line 443, in build\r\n    next_models = FFXModelFactory().build(train_X, train_y, ss, varnames, verbose)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/core.py\", line 653, in build\r\n    ss, varnames, bases, X, y, ss.final_max_num_bases, ss.final_target_train_nmse, verbose)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/core.py\", line 683, in _basesToModels\r\n    max_num_bases, target_train_nmse, verbose)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/core.py\", line 729, in _pathwiseLearn\r\n    max_iter=max_iter, **fit_params)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/core.py\", line 841, in new_f\r\n    result = f(*args, **kwargs)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/ffx/core.py\", line 853, in fit\r\n    return ElasticNet.fit(self, *args, **kwargs)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/scikits/learn/linear_model/coordinate_descent.py\", line 122, in fit\r\n    beta, Gram, Xy, y, max_iter, tol)\r\n  File \"cd_fast.pyx\", line 225, in scikits.learn.linear_model.cd_fast.enet_coordinate_descent_gram (scikits/learn/linear_model/cd_fast.c:2518)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/numpy/linalg/linalg.py\", line 2072, in norm\r\n    return abs(x).max(axis=axis)\r\n  File \"/mnt/data/gandalv/School/PhD/Research/sr-comparison/ffx/ffx-venv/local/lib/python2.7/site-packages/numpy/core/_methods.py\", line 26, in _amax\r\n    return umr_maximum(a, axis, None, out, keepdims)\r\nValueError: zero-size array to reduction operation maximum which has no identity\r\n```\r\n\r\nThe training data can be downloaded [here](https://www.dropbox.com/s/pj23y5xab56qo79/train.csv?dl=0), the last column is the y-value (i.e. the target value). Testing data are identical to training data.\r\n\r\nIs there any possibility this could be resolved? FFX will get its citation :)."}}