diff --git a/atomsci/ddm/pipeline/transformations.py b/atomsci/ddm/pipeline/transformations.py index 2e7c7420..8abc9712 100644 --- a/atomsci/ddm/pipeline/transformations.py +++ b/atomsci/ddm/pipeline/transformations.py @@ -289,6 +289,8 @@ def transform_array(self, X, y, w, ids): X = np.nan_to_num((X - self.X_means) * X_weight / self.X_stds) else: X = np.nan_to_num(X * X_weight / self.X_stds) + # zero out large values, especially for out of range test data + X[np.abs(X) > 1e30] = 0 if self.transform_y: if not hasattr(self, 'move_mean') or self.move_mean: y = np.nan_to_num((y - self.y_means) / self.y_stds)