Skip to content

Instantly share code, notes, and snippets.

@lisanka93
Created August 3, 2020 16:26
Show Gist options
  • Save lisanka93/60ec55351144e2cb6fd6a312655af15d to your computer and use it in GitHub Desktop.
Save lisanka93/60ec55351144e2cb6fd6a312655af15d to your computer and use it in GitHub Desktop.
instantiating countvectorizer and learning vocabulary and transforming arguments into vectors
count_vectorizer = CountVectorizer(binary=True)
#fit training data
training_data = count_vectorizer.fit_transform(X_train)
#transform test data
testing_data = count_vectorizer.transform(X_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment