Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

submit.py 834 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. from __future__ import print_function
  2. from __future__ import division
  3. from preprocessing import preprocess_data
  4. import joblib
  5. import pandas as pd
  6. import numpy as np
  7. print("processing test data...")
  8. sj_test, iq_test = preprocess_data('./data/dengue_features_test.csv')
  9. print("getting pickled model...")
  10. file = open('./data/sj_model.pkl', 'rb')
  11. sj_model = joblib.load(file)
  12. file = open('./data/iq_model.pkl', 'rb')
  13. iq_model = joblib.load(file)
  14. print("Predicting values...")
  15. sj_predictions = sj_model.predict(sj_test).astype(int)
  16. iq_predictions = iq_model.predict(iq_test).astype(int)
  17. submission = pd.read_csv("./data/submission_format.csv",
  18. index_col=[0, 1, 2])
  19. submission.total_cases = np.concatenate([sj_predictions, iq_predictions])
  20. print("saving output file")
  21. submission.to_csv("./data/output_file.csv")
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...