def expit(x, out=None):
        if out is None:
            out = np.empty(np.atleast_1d(x).shape, dtype=np.float64)
        out[:] = x

        # 1 / (1 + exp(-x)) = (1 + tanh(x / 2)) / 2
        # This way of computing the logistic is both fast and stable.
        out *= .5
        np.tanh(out, out)
        out += 1
        out *= .5

        return out.reshape(np.shape(x))


# little danse to see if np.copy has an 'order' keyword argument
Logistic sigmoid function, ``1 / (1 + exp(-x))``.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/utils/fixes.py/expit