ddl.utils.make_positive

ddl.utils.make_positive(X)[source]

Make the data matrix positive by clipping to +epsilon if not positive.

Parameters:
X : array-like, shape (n_samples, n_features)

Data matrix.

Returns:
X : array, shape (n_samples, n_features)

Data matrix as numpy array after checking and possibly replacing non-positive numbers to +epsilon.