Skip to content

Instantly share code, notes, and snippets.

@mwitiderrick
Created June 14, 2018 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwitiderrick/363a71bc0d686383a33132aa9f896fce to your computer and use it in GitHub Desktop.
Save mwitiderrick/363a71bc0d686383a33132aa9f896fce to your computer and use it in GitHub Desktop.
from sklearn.feature_extraction.text import CountVectorizer
cv = CountVectorizer(max_features = 2000)
X = cv.fit_transform(corpus).toarray()
y = dataset.iloc[:, 1].values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment