Statistics, Data Science, Linear Models.
sm.api.families.links.logit().inverse(np.dot(X, beta)) y = np.random.binomial(1, prob) # Creating a DataFrame out of the fabricated data df = pd.DataFrame({'y': y, 'x1': X[:, 1], 'x2': X[:, 2]}) # Fitting a GLM with logit link function model = sm.GLM(df['y'], df[['x1', 'x2']],