def score(self, params):

        y = self.endog
        X = self.exog
        L = self.cdf(np.dot(X,params))
        return np.dot(y - L,X)
Logit model score (gradient) vector of the log-likelihood
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/discrete/discrete_model.py/Logit.score