Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.