Segmentation fault when using preprocessing.MinMaxScaler due to densifying. Wrote as function on sparse