import numpy as np
from sklearn.linear_model import LogisticRegression
x1 = np.random.randn(100)
x2 = 4 * np.random.randn(100)
x3 = 0.5 * np.random.randn(100)
y = 3 + x1 + x2 + x3 + 0.2 * np.random.randn() > 0
X = np.column_stack([x1, x2, x3])
m = LogisticRegression()
m.fit(X, y)
print(m.coef_)
print(np.std(X, 0) * m.coef_)
How to find the importance of the features for a logistic regression model?