0

3 out of 8 columns of my dataset are categorical and the rest are integers or floats. sklearn's OneHotEncoder returns a scipy sparse matrix which is not easy to recombine with the other 5 non-sparse columns. Is there an easy way to recombine the dataframe or will I have to convert the whole df to a sparse matrix?

str31
  • 23
  • 4
  • I'd recommend a pipeline for this. There's a solution here: https://stackoverflow.com/questions/44308504/logistic-regression-on-one-hot-encoding/74881940#74881940 – Alexander L. Hayes Dec 28 '22 at 16:05

0 Answers0