Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vect = CountVectorizer()
- tfidf = TfidfTransformer()
- clf = SGDClassifier()
- vx = vect.fit_transform(X_train)
- tfidfx = tfidf.fit_transform(vx)
- predicted = clf.fit_predict(tfidf)
- #Evaluate on text
- vx = vect.transform(X_test)
- tfidf = tfidf.transform(vx)
- predicted = clf.predict(tfidfX)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement