Re: [Scikit-learn-general] normalize with nan values

2015-06-15 Thread Michael Eickenberg
np.nan_to_num replaces NaN's with zeros. If you want to take into account the fact that you are normalizing over less entries, you need to do normalize(np.nan_to_num(X)) * np.sqrt(np.isnan(X).sum(0) / float(X.shape[0])) On Mon, Jun 15, 2015 at 5:28 PM, Andreas Mueller wrote: > Hey. > Not wit

Re: [Scikit-learn-general] normalize with nan values

2015-06-15 Thread Andreas Mueller
Hey. Not with scikit-learn but it should be about three lines in numpy to do it yourself. I would replace them with 0 for computing the norm, that is all there is, right? Andy On 06/15/2015 10:43 AM, William Correa beltran wrote: Hello, I would like to know if there is a way to normalize a