Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.linear_model import LogisticRegression
- import numpy as np
- x1 = np.random.randn(100)
- x2 = x1 + 0.00001*np.random.randn(100)
- x3 = np.random.randn(100)
- y = ((100*x1 - 100*x2 + x3) > 0).astype(int)
- X = np.vstack([x1, x2, x3]).T
- m = LogisticRegression().fit(X, y)
- print(np.std(X, 0)*m.coef_)
- >> [[0.02823824 0.02824964 3.70616255]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement