{"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 random\nimport jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()","metadata":{"execution":{"iopub.status.busy":"2023-04-23T12:15:53.972592Z","iopub.execute_input":"2023-04-23T12:15:53.973354Z","iopub.status.idle":"2023-04-23T12:15:54.021122Z","shell.execute_reply.started":"2023-04-23T12:15:53.973215Z","shell.execute_reply":"2023-04-23T12:15:54.020142Z"},"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 (test, sample_submission) in iter_test:\n    if counter == 0:\n        print(sample_submission.head())\n        print(test.head())\n        print(test.shape)\n    \n    x = random.randint(0, 1)\n    print(x)\n    ## users make predictions here using the test data\n    sample_submission['correct'] = x\n    \n    ## env.predict appends the session+level sample_submission to the overall\n    ## submission\n    env.predict(sample_submission)\n    counter += 1","metadata":{"execution":{"iopub.status.busy":"2023-04-23T12:15:54.022814Z","iopub.execute_input":"2023-04-23T12:15:54.023370Z","iopub.status.idle":"2023-04-23T12:15:54.105538Z","shell.execute_reply.started":"2023-04-23T12:15:54.023337Z","shell.execute_reply":"2023-04-23T12:15:54.104663Z"},"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-04-23T12:15:54.106764Z","iopub.execute_input":"2023-04-23T12:15:54.107278Z","iopub.status.idle":"2023-04-23T12:15:55.131680Z","shell.execute_reply.started":"2023-04-23T12:15:54.107247Z","shell.execute_reply":"2023-04-23T12:15:55.130490Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}