{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/11451","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/11451/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/11451/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/11451/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/11451","id":338949928,"node_id":"MDU6SXNzdWUzMzg5NDk5Mjg=","number":11451,"title":"An error is thrown when using Random forest classifier multi-target non-numeric classes","user":{"login":"mitar","id":585279,"node_id":"MDQ6VXNlcjU4NTI3OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/585279?v=4","gravatar_id":"","url":"https://api.github.com/users/mitar","html_url":"https://github.com/mitar","followers_url":"https://api.github.com/users/mitar/followers","following_url":"https://api.github.com/users/mitar/following{/other_user}","gists_url":"https://api.github.com/users/mitar/gists{/gist_id}","starred_url":"https://api.github.com/users/mitar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitar/subscriptions","organizations_url":"https://api.github.com/users/mitar/orgs","repos_url":"https://api.github.com/users/mitar/repos","events_url":"https://api.github.com/users/mitar/events{/privacy}","received_events_url":"https://api.github.com/users/mitar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-06T13:58:29Z","updated_at":"2018-07-07T10:59:07Z","closed_at":null,"author_association":"NONE","body":"#### Description\r\n\r\nRandom forest classifier can be fit on multiple target columns where columns have string labels and are not numeric, but when trying to predict, an error is thrown.\r\n\r\n#### Steps/Code to Reproduce\r\n\r\n```python\r\nimport numpy as np\r\nfrom sklearn.datasets import make_classification\r\nfrom sklearn.ensemble.forest import RandomForestClassifier\r\n\r\nc = RandomForestClassifier()\r\n\r\nX, y = make_classification()\r\ny = np.array(['foo' if v else 'bar' for v in y]).reshape((y.shape[0], 1))\r\nys = np.hstack([y, y])\r\n\r\nc.fit(X, ys)\r\nc.predict(X)\r\n```\r\n\r\n#### Expected Results\r\n\r\nNo error is thrown.\r\n\r\n#### Actual Results\r\n\r\n```\r\n  File \".../local/lib/python2.7/site-packages/sklearn/ensemble/forest.py\", line 550, in predict\r\n    axis=0)\r\nValueError: could not convert string to float: foo\r\n```\r\n\r\n#### Versions\r\n\r\n```\r\nLinux-4.13.0-45-generic-x86_64-with-Ubuntu-17.10-artful\r\n('Python', '2.7.14 (default, Sep 23 2017, 22:06:14) \\n[GCC 7.2.0]')\r\n('NumPy', '1.14.5')\r\n('SciPy', '1.1.0')\r\n('Scikit-Learn', '0.19.1')\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/403207468","html_url":"https://github.com/scikit-learn/scikit-learn/issues/11451#issuecomment-403207468","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/11451","id":403207468,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzIwNzQ2OA==","user":{"login":"jnothman","id":78827,"node_id":"MDQ6VXNlcjc4ODI3","avatar_url":"https://avatars2.githubusercontent.com/u/78827?v=4","gravatar_id":"","url":"https://api.github.com/users/jnothman","html_url":"https://github.com/jnothman","followers_url":"https://api.github.com/users/jnothman/followers","following_url":"https://api.github.com/users/jnothman/following{/other_user}","gists_url":"https://api.github.com/users/jnothman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnothman/subscriptions","organizations_url":"https://api.github.com/users/jnothman/orgs","repos_url":"https://api.github.com/users/jnothman/repos","events_url":"https://api.github.com/users/jnothman/events{/privacy}","received_events_url":"https://api.github.com/users/jnothman/received_events","type":"User","site_admin":false},"created_at":"2018-07-07T10:59:07Z","updated_at":"2018-07-07T10:59:07Z","author_association":"MEMBER","body":"Yeah, I don't know if we formally support string labels for multi-output\nclassification anywhere.\n\nCould you offer a pull request?​\n"}}
{"actor":{"display_login":"jnothman"}}