Skip to content Skip to sidebar Skip to footer

Python Sklearn Pipiline Fit: "attributeerror: Lower Not Found"

I'm trying to classify sveveral text data into 3 categories using sklearn. But I'm getting 'AttributeError: lower not found' when running. Code: train, test = train_test_split(d

Solution 1:

Either remove step ('vect', CountVectorizer()) or use TfidfTransformer instead of TfidfVectorizer as TfidfVectorizer expects array of strings as an input and CountVectorizer() returns a matrix of occurances (i.e. numeric matrix).

Per default TfidfVectorizer(..., lowercase=True) will try to "lowercase" all strings, hence the “AttributeError: lower not found” error message.

Also parameter tokenizer expects either a callable (function) or None, so don't specify it.


Post a Comment for "Python Sklearn Pipiline Fit: "attributeerror: Lower Not Found""