How to fix “NaN or infinity” issue for sparse matrix in python?
I'm totally new to python. I've used some code found online and I tried to work on it. So I'm creating a text-document-matrix and I want to add some extra features before training a logistic regression model. Although I've checked my data with R and I get no error, when I run the logistic regression I get the error "ValueError: Array contains NaN or infinity." I'm not getting the same error when I do not add my own features. My features are in the file "toPython.txt". Mind the two calls to assert_all_finite function that returns "None"! Below is the code I use and the output I get: def _assert