Я пытаюсь обучить модель, однако, когда я подгоняю модель, я получаю следующую ошибку:
ValueError: Found input variables with inconsistent numbers of samples: [1, 3608]
Вот мой код:
data = pd.read_csv("/Users/amanpuranik/Desktop/fake-news-detection/data.csv")
data = data[['Headline', "Label"]]
print(data)
x = data[["Headline"]]
y = data[["Label"]]
print(x.shape)
print(y.shape)
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.1, random_state=1)
print(x_train.shape)
tfidf_vectorizer=TfidfVectorizer(stop_words='english', max_df=1)
model = MultinomialNB()
#model.fit(x_train,y_train) #this part gives me a string to float error
pipeline = Pipeline([('vectorizer', tfidf_vectorizer), ('classifier', model)])
pipeline.fit(x_train, y_train)
Я не являюсь уверен, как я мог обойти эту ошибку