amueller / introduction_to_ml_with_python

Notebooks and code for the book "Introduction to Machine Learning with Python"
7.37k stars 4.55k forks source link

CountVectorizer not working #104

Closed yhzheng89 closed 4 years ago

yhzheng89 commented 5 years ago

from sklearn.feature_extraction.text import CountVectorizer bow_transformer = CountVectorizer(analyzer=text_process).fit(X)


NameError Traceback (most recent call last)

in 1 from sklearn.feature_extraction.text import CountVectorizer ----> 2 bow_transformer = CountVectorizer(analyzer=text_process).fit(X) NameError: name 'text_process' is not defined
amueller commented 5 years ago

Can you give a bit more context? This snippet doesn't seem to be from the book or the notebooks. And clearly text_process is not defined, as the error says.

Anuragsangem commented 4 years ago

even I was facing the same issue did you find a solution/alternative for this?

amueller commented 4 years ago

@Anuragsangem again, can you give more context? What was the code and what was the error?

harshgeek4coder commented 4 years ago

Even i am having the same issue

amueller commented 4 years ago

@harshgeek4coder can you please describe the issue? What is the code, where in the book is it from, and what is the error?

harshgeek4coder commented 4 years ago

@amueller Nope.. it worked .. i tried some new code while fixing it with changing the ratio of test split..Thanks Anyways.