Reputation: 213
I am using countvectorizer to extract features, and I am wondering if I can scale the features. With the code below I am wondering if I can do some scaling using StandardScaler.
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer()
x_training=vectorizer.fit_transform(df ['var'])
Upvotes: 0
Views: 1033
Reputation: 89
as CountVectorizer creates a sparse matrix of features, the StandardScalar function from sklearn will throw an exception as it does'nt take sparse matrix.
Read the Docs.
Upvotes: 1