Skip to content

Instantly share code, notes, and snippets.

@lgmoneda
Created September 18, 2018 13:14
Show Gist options
  • Save lgmoneda/e0875666f2b43f72879d9f7329a50909 to your computer and use it in GitHub Desktop.
Save lgmoneda/e0875666f2b43f72879d9f7329a50909 to your computer and use it in GitHub Desktop.
def build_submission(preds,
score,
score_name="auc",
file_title="sub",
sample_sub_file="../data/sample_submission.csv",
submissions_path="../submissions/"):
timestamp = int(time())
submission = pd.read_csv(sample_sub_file)
submission[TARGET] = preds
submission.to_csv(submissions_path + "{}_" + score_name + "_{}_{:.4f}.csv.gz".format(timestamp,
file_title,
score),
index=False,
compression="gzip")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment