{"action":"created","issue":{"url":"https://api.github.com/repos/harusametime/RUSBoost/issues/2","repository_url":"https://api.github.com/repos/harusametime/RUSBoost","labels_url":"https://api.github.com/repos/harusametime/RUSBoost/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/harusametime/RUSBoost/issues/2/comments","events_url":"https://api.github.com/repos/harusametime/RUSBoost/issues/2/events","html_url":"https://github.com/harusametime/RUSBoost/issues/2","id":333930519,"node_id":"MDU6SXNzdWUzMzM5MzA1MTk=","number":2,"title":"Getting error when running code","user":{"login":"antriksh63","id":20464339,"node_id":"MDQ6VXNlcjIwNDY0MzM5","avatar_url":"https://avatars3.githubusercontent.com/u/20464339?v=4","gravatar_id":"","url":"https://api.github.com/users/antriksh63","html_url":"https://github.com/antriksh63","followers_url":"https://api.github.com/users/antriksh63/followers","following_url":"https://api.github.com/users/antriksh63/following{/other_user}","gists_url":"https://api.github.com/users/antriksh63/gists{/gist_id}","starred_url":"https://api.github.com/users/antriksh63/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antriksh63/subscriptions","organizations_url":"https://api.github.com/users/antriksh63/orgs","repos_url":"https://api.github.com/users/antriksh63/repos","events_url":"https://api.github.com/users/antriksh63/events{/privacy}","received_events_url":"https://api.github.com/users/antriksh63/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-20T05:37:45Z","updated_at":"2018-06-20T07:10:30Z","closed_at":null,"author_association":"NONE","body":"Traceback (most recent call last):\r\n  File \"RUSBoost.py\", line 177, in <module>\r\n    rus.learning()\r\n  File \"RUSBoost.py\", line 63, in learning\r\n    if self.Y[i] == self.clf[k].predict(self.X[i]):\r\n  File \"/home/antriksh/.local/lib/python2.7/site-packages/sklearn/tree/tree.py\", line 412, in predict\r\n    X = self._validate_X_predict(X, check_input)\r\n  File \"/home/antriksh/.local/lib/python2.7/site-packages/sklearn/tree/tree.py\", line 373, in _validate_X_predict\r\n    X = check_array(X, dtype=DTYPE, accept_sparse=\"csr\")\r\n  File \"/home/antriksh/.local/lib/python2.7/site-packages/sklearn/utils/validation.py\", line 441, in check_array\r\n    \"if it contains a single sample.\".format(array))\r\nValueError: Expected 2D array, got 1D array instead:\r\narray=[0.49 0.29 0.48 0.5  0.56 0.24 0.35].\r\nReshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.\r\n\r\nHow do I resolve this?"},"comment":{"url":"https://api.github.com/repos/harusametime/RUSBoost/issues/comments/398647636","html_url":"https://github.com/harusametime/RUSBoost/issues/2#issuecomment-398647636","issue_url":"https://api.github.com/repos/harusametime/RUSBoost/issues/2","id":398647636,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODY0NzYzNg==","user":{"login":"harusametime","id":10037251,"node_id":"MDQ6VXNlcjEwMDM3MjUx","avatar_url":"https://avatars1.githubusercontent.com/u/10037251?v=4","gravatar_id":"","url":"https://api.github.com/users/harusametime","html_url":"https://github.com/harusametime","followers_url":"https://api.github.com/users/harusametime/followers","following_url":"https://api.github.com/users/harusametime/following{/other_user}","gists_url":"https://api.github.com/users/harusametime/gists{/gist_id}","starred_url":"https://api.github.com/users/harusametime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harusametime/subscriptions","organizations_url":"https://api.github.com/users/harusametime/orgs","repos_url":"https://api.github.com/users/harusametime/repos","events_url":"https://api.github.com/users/harusametime/events{/privacy}","received_events_url":"https://api.github.com/users/harusametime/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T07:10:30Z","updated_at":"2018-06-20T07:10:30Z","author_association":"OWNER","body":"@antriksh63 \r\nThank you for reporting this issue.\r\nThis code is not maintained for a long time, and may get incompatible with the latest scikit-learn.\r\nUsing `self.X[i].reshape(-1,1)` instead of `self.X[i]` may fix this bug as the error message says.\r\n\r\nNow I am on the business trip, and have no environment for Python 2. If you are okay, I want to rewrite this code with Python 3 and fix the bug."}}
{"actor":{"display_login":"harusametime"}}