Hi I am trying Random Forest on data when I am fitting rfr fit x train y train its giving below error

0 votes
ValueError: Expected 2D array, got 1D array instead:
array=[33. 46. 32. ... 38. 38. 31.].
Reshape 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.
May 16, 2022 in Data Science by Naresh

edited Mar 4, 2025 415 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP