{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-garden/scikit-garden/issues/62","repository_url":"https://api.github.com/repos/scikit-garden/scikit-garden","labels_url":"https://api.github.com/repos/scikit-garden/scikit-garden/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/scikit-garden/scikit-garden/issues/62/comments","events_url":"https://api.github.com/repos/scikit-garden/scikit-garden/issues/62/events","html_url":"https://github.com/scikit-garden/scikit-garden/issues/62","id":311210382,"node_id":"MDU6SXNzdWUzMTEyMTAzODI=","number":62,"title":"ValueError: bad input shape","user":{"login":"YanyanNIE","id":33652949,"node_id":"MDQ6VXNlcjMzNjUyOTQ5","avatar_url":"https://avatars0.githubusercontent.com/u/33652949?v=4","gravatar_id":"","url":"https://api.github.com/users/YanyanNIE","html_url":"https://github.com/YanyanNIE","followers_url":"https://api.github.com/users/YanyanNIE/followers","following_url":"https://api.github.com/users/YanyanNIE/following{/other_user}","gists_url":"https://api.github.com/users/YanyanNIE/gists{/gist_id}","starred_url":"https://api.github.com/users/YanyanNIE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanyanNIE/subscriptions","organizations_url":"https://api.github.com/users/YanyanNIE/orgs","repos_url":"https://api.github.com/users/YanyanNIE/repos","events_url":"https://api.github.com/users/YanyanNIE/events{/privacy}","received_events_url":"https://api.github.com/users/YanyanNIE/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-04T12:33:23Z","updated_at":"2018-06-21T05:14:23Z","closed_at":null,"author_association":"NONE","body":"I am using **`RandomForestQuantileRegressor.fit(X, y)`**\r\n\r\nAnd there is a part of [doc](https://scikit-garden.github.io/api/#skgardenquantile_1):\r\n> Parameters\r\n>\r\n> X (array-like or sparse matrix, shape = [n_samples, n_features])\r\n>\r\n> The training input samples. Internally, it will be converted to dtype=np.float32 and if a sparse matrix is provided to a sparse csc_matrix.\r\n>\r\n> y (array-like, shape = [n_samples] or [n_samples, n_outputs])\r\n\r\nIn my codes, y with the shape [n_samples, n_outputs],\r\n```\r\ntype of X <class 'pandas.core.frame.DataFrame'> dim of X (83, 12)\r\ntype of y <class 'pandas.core.frame.DataFrame'> dim of y (83, 5)\r\n```\r\n\r\nBut there is the ValueError:\r\n```\r\nFile \"random_forest_quantiles.py\", line 217, in fit_and_forecast_RF\r\n    regr.fit(X, y)\r\n  File \"/var/task/skgarden/quantile/ensemble.py\", line 81, in fit\r\n    X, y, accept_sparse=\"csc\", dtype=np.float32, multi_output=False)\r\n  File \"/var/task/sklearn/utils/validation.py\", line 578, in check_X_y\r\n    y = column_or_1d(y, warn=True)\r\n  File \"/var/task/sklearn/utils/validation.py\", line 614, in column_or_1d\r\n    raise ValueError(\"bad input shape {0}\".format(shape))\r\nValueError: bad input shape (83, 5)\r\n```\r\nAfter we change the code in `skgarden/quantile/ensemble.py` to : \r\n```\r\nX, y = check_X_y(\r\n            X, y, accept_sparse=\"csc\", dtype=np.float32, multi_output=True)\r\n```\r\nthen the error doesn't exist. So i think there is a bug in the source code?\r\n\r\nAnd could you fix the bug? Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/scikit-garden/scikit-garden/issues/comments/398978518","html_url":"https://github.com/scikit-garden/scikit-garden/issues/62#issuecomment-398978518","issue_url":"https://api.github.com/repos/scikit-garden/scikit-garden/issues/62","id":398978518,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODk3ODUxOA==","user":{"login":"vision72","id":32649253,"node_id":"MDQ6VXNlcjMyNjQ5MjUz","avatar_url":"https://avatars3.githubusercontent.com/u/32649253?v=4","gravatar_id":"","url":"https://api.github.com/users/vision72","html_url":"https://github.com/vision72","followers_url":"https://api.github.com/users/vision72/followers","following_url":"https://api.github.com/users/vision72/following{/other_user}","gists_url":"https://api.github.com/users/vision72/gists{/gist_id}","starred_url":"https://api.github.com/users/vision72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vision72/subscriptions","organizations_url":"https://api.github.com/users/vision72/orgs","repos_url":"https://api.github.com/users/vision72/repos","events_url":"https://api.github.com/users/vision72/events{/privacy}","received_events_url":"https://api.github.com/users/vision72/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T05:14:23Z","updated_at":"2018-06-21T05:14:23Z","author_association":"NONE","body":"Hello Everyone, the problem you all going through is very simple,\r\nFirst, you can change the data you are using,\r\n(else..)Secondly, you see \"bad shape (83, 5)\", means that the samples are not matching and they must match in number..\r\nYou can try to alter the sizes or use various tricks with the Data.\r\nHope this Helps-"}}
{"actor":{"display_login":"vision72"}}