Re: [Scikit-learn-general] sklearn.preprocessing.normalize does not sum to 1

2015-12-17 Thread Ryan R. Rosario
reprocessing.normalize does not > sum to 1 > > The thing is that even if you did sum and divide by the sum, summing the > results back may not lead to 1.0. This is always the "issue" in floating > point computation. > > Cheers, > > Matthieu > > 2015-

[Scikit-learn-general] sklearn.preprocessing.normalize does not sum to 1

2015-12-16 Thread Ryan R. Rosario
Hi, I have a very large dense numpy matrix. To avoid running out of RAM, I use np.float32 as the dtype instead of the default np.float64 on my system. When I do an L1 normalization of the rows (axis=1) in my matrix in-place (copy=False), I frequently get rows that do not sum to 1. Since these