Skip to content

Instantly share code, notes, and snippets.

@vosbs
Created April 21, 2020 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vosbs/28518ee5cdc57c8c2e893122a2d47643 to your computer and use it in GitHub Desktop.
Save vosbs/28518ee5cdc57c8c2e893122a2d47643 to your computer and use it in GitHub Desktop.
m5000_10
test = df[17500:]
X_test = test[['speed', 'thickness', 'delta']]
y_test = test[['I']]
X_test_minmax = mm_scaler.transform(X_test[['thickness', 'delta']])
kn = neigh.kneighbors(X_test_minmax, return_distance=False)
test = test.assign(ml_speed=[X_train_clean.loc[i, 'speed'].quantile(0.8) for i in kn])
test = test.assign(I_new_predict=bst.predict(test[['ml_speed', 'thickness', 'delta']]))
test.loc[:, 'ml_speed'] = test['ml_speed'] + (limit - 600 * 3 - test['I_new_predict']) / step
test.loc[:, 'I_new'] = test['I'] + (test['ml_speed'] - test['speed']) * 2000
print((test.I_new > limit).sum() / test.shape[0])
print(test.ml_speed.mean() / test.speed.mean())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment