ValueError Found input variables with inconsistent numbers of samples 40002 1573

0 votes
hi I want to try to classify this data from bbc news as new test data with training data form kaggle that already I the got the classification results , but when i run this code:

X = tfidf_v.fit_transform(corpus).toarray()

y = bbc ["label"]

classifier.fit(X, y)

I get a error like this:

ValueError: Found input variables with inconsistent numbers of samples: [40002, 1573]

can someone help me because I tried to transpose the X and reshaping y but it doesn't work
Oct 16, 2022 in Python by anonymous

edited Mar 4, 2025 284 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