@staticmethod
def discrete_to_indicators(x, discrete):
    """Change non-zero values of discrete attributes to 1."""
    if discrete.any():
        x = x.copy()
        for col, disc in enumerate(discrete):
            if disc:
                x[:, (col)].clip(0, 1, out=x[:, (col)])
    return x
