0

I am not sure how to fit my SVM model with Word2vec training data set ?what should I put instead of question mark in below code?

model = gensim.models.Word2Vec(sentences= df['meaningful_words'])

Train_X, Test_X, Train_Y, Test_Y = model_selection.train_test_split(df['y_labels'],df['meaningful_words'],random_state =1,test_size=0.2)

SVM = svm.SVC(C=1.0, kernel='linear', degree=1, gamma= 'auto')

SVM.fit(??,Train_Y)

predictions_SVM = SVM.predict(Test_X)

print("SVM Accuracy Score",accuracy_score(predictions_SVM, Test_Y)*100)
CONFUSION = confusion_matrix(Test_Y, predictions_SVM)
Anurag Dabas
  • 23,866
  • 9
  • 21
  • 41
Pegah
  • 13
  • 4
  • What is in `Train_X` and of what type? – Jindřich Feb 24 '21 at 08:18
  • I simply used sklearn.model_selection.train_test_split to split my whole data into random train and test subsets.So Train_X are those data selected randomly to be used as a training data and rest as a test data( Test_X). Train_X type is pandas.core.series. – Pegah Feb 24 '21 at 14:54

0 Answers0