Skip to content

Instantly share code, notes, and snippets.

@kusal1990
Last active June 2, 2022 07:49
Show Gist options
  • Save kusal1990/f4c9ca9b0cc502b8a3b6e910d367c5cc to your computer and use it in GitHub Desktop.
Save kusal1990/f4c9ca9b0cc502b8a3b6e910d367c5cc to your computer and use it in GitHub Desktop.
preds_test = []
for i in range(N_SPLITS):
model.load_weights('weights_{}.h5'.format(i))
pred = model.predict(X_test_input, batch_size=300, verbose=1)
pred_3 = []
for pred_scalar in pred:
for i in range(3):
pred_3.append(pred_scalar)
preds_test.append(pred_3)
preds_test = (np.squeeze(np.mean(preds_test, axis=0)) > best_threshold).astype(np.int)
preds_test.shape
submission['target'] = preds_test
submission.to_csv('submission.csv', index=False)
@kusal1990
Copy link
Author

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment