Hi, I'm attempting to use sklearn.ensemble.RandomForestClassifier as a regression, but when I run it, I get the following error regarding my dependent variable y:
ValueError: Unknown label type: 'continuous'
Hey, I found out why. I was using sklearn.ensemble.RandomForestClassifier, which is for categorical data. Use sklearn.ensemble.RandomForestRegressor instead, which takes floating point i.e. "continuous" values.
Great to hear you figured out what the problem was and thanks for posting back the result.
A similar problem has been reported here: python - ValueError: Unknown label type: 'continuous' - Stack Overflow . There are some suggestions that might help. BTW, the OP on Stack Overflow provided a lot more information.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.