-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature_names mismatch on sparse matrices #1441
Comments
You need transform sparse matrix to array, like this:
|
@SpLin12 No, that would be ridiculous. Converting a sparse array to be dense is not an intended fix nor is it possible in the majority of sparse feature spaces. |
It's definitely #1238, code works fine with csc matrices (although the performance is ~20% worse) |
passing a dataframe solved the issue for me |
@nazirmubbashir could you clarify? |
@jpbm I used pandas dataframes and passed them directly, without converting to arrays. |
Hi,
I'm have some problems with CSR sparse matrices. I train the model on dataset created by sklearn TfidfVectorizer, then use the same vectorizer to transform test dataset.
During prediction following error occurs:
The dimensions are the same in training and prediction time, the second list appears to be permutation of the first (
...
symbol is mine, log is very long).It may be related to #1238
The text was updated successfully, but these errors were encountered: