Skip to content

Instantly share code, notes, and snippets.

@vosbs
Created April 21, 2020 18:32
Show Gist options
  • Save vosbs/a1ff0fa2a40e71bbbf997852eb669bad to your computer and use it in GitHub Desktop.
Save vosbs/a1ff0fa2a40e71bbbf997852eb669bad to your computer and use it in GitHub Desktop.
m5000_8
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