{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd","metadata":{"papermill":{"duration":0.023295,"end_time":"2022-06-03T21:13:10.412151","exception":false,"start_time":"2022-06-03T21:13:10.388856","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-30T14:16:01.023147Z","iopub.execute_input":"2023-01-30T14:16:01.023609Z","iopub.status.idle":"2023-01-30T14:16:01.052935Z","shell.execute_reply.started":"2023-01-30T14:16:01.023519Z","shell.execute_reply":"2023-01-30T14:16:01.051970Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()","metadata":{"papermill":{"duration":0.036198,"end_time":"2022-06-03T21:13:10.454318","exception":false,"start_time":"2022-06-03T21:13:10.418120","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-30T14:16:01.056616Z","iopub.execute_input":"2023-01-30T14:16:01.057111Z","iopub.status.idle":"2023-01-30T14:16:01.096157Z","shell.execute_reply.started":"2023-01-30T14:16:01.057071Z","shell.execute_reply":"2023-01-30T14:16:01.094878Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"counter = 0\n# The API will deliver two dataframes in this specific order,\n# for every session+level grouping (one group per session for each checkpoint)\nfor (sample_submission, test) in iter_test:\n    if counter == 0:\n        print(sample_submission.head())\n        print(test.head())\n        print(test.shape)\n        \n    ## users make predictions here using the test data\n    sample_submission['correct'] = 0\n    \n    ## env.predict appends the session+level sample_submission to the overall\n    ## submission\n    env.predict(sample_submission)\n    counter += 1","metadata":{"papermill":{"duration":0.337707,"end_time":"2022-06-03T21:13:10.798069","exception":false,"start_time":"2022-06-03T21:13:10.460362","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-30T14:16:01.182163Z","iopub.execute_input":"2023-01-30T14:16:01.182545Z","iopub.status.idle":"2023-01-30T14:16:01.261680Z","shell.execute_reply.started":"2023-01-30T14:16:01.182510Z","shell.execute_reply":"2023-01-30T14:16:01.260178Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"## the end result is a submission file containing all test session predictions\n! head submission.csv","metadata":{"papermill":{"duration":0.767504,"end_time":"2022-06-03T21:13:11.572788","exception":false,"start_time":"2022-06-03T21:13:10.805284","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-01-30T14:16:01.275258Z","iopub.execute_input":"2023-01-30T14:16:01.276564Z","iopub.status.idle":"2023-01-30T14:16:02.391191Z","shell.execute_reply.started":"2023-01-30T14:16:01.276514Z","shell.execute_reply":"2023-01-30T14:16:02.389279Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}