Created
April 21, 2020 18:32
-
-
Save vosbs/a1ff0fa2a40e71bbbf997852eb669bad to your computer and use it in GitHub Desktop.
m5000_8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coefs = {} | |
for i in range(6, 19): | |
train_new = train.copy() | |
train_new['bin'] = ((resc.predict(Xc) < (i + 2)) & (resc.predict(Xc) >= i)).astype(int) | |
Xcb = train_new[train_new.bin == 1][['speed', 'thickness', 'delta']] | |
Xcb = sm.add_constant(Xcb) | |
Ycb = train_new[train_new.bin == 1][['I']] | |
modcb = sm.OLS(Ycb, Xcb) | |
rescb = modcb.fit() | |
coefs[i] = rescb.params['speed'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment