diff --git a/GPy/util/normalizer.py b/GPy/util/normalizer.py index 243f81c7..d04e7324 100644 --- a/GPy/util/normalizer.py +++ b/GPy/util/normalizer.py @@ -92,7 +92,8 @@ class Standardize(_Norm): self.std = Y.std(0).view(np.ndarray) if np.any(self.std == 0): warnings.warn("Some values of Y have standard deviation of zero. Resetting to 1.0 to avoid divide by zero errors.") - self.std[np.where(self.std==0)]=1. + # Choice of setting to 1.0 is somewhat arbitrary. It avoids a divide by zero error, but setting to EPS would also do this. Don't have strong reasons for choosing 1.0, it was just first instinct + self.std[np.where(self.std==0)]=1. def normalize(self, Y): super(Standardize, self).normalize(Y)