Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. vect = CountVectorizer()
  2. tfidf = TfidfTransformer()
  3. clf = SGDClassifier()
  4.  
  5. vx = vect.fit_transform(X_train)
  6. tfidfx = tfidf.fit_transform(vx)
  7. predicted = clf.fit_predict(tfidf)
  8.  
  9. #Evaluate on text
  10. vx = vect.transform(X_test)
  11. tfidf = tfidf.transform(vx)
  12. predicted = clf.predict(tfidfX)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement