{"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.6"},"widgets":{"application/vnd.jupyter.widget-state+json":{"state":{"040c9867f4eb42ee9607ac5a11861d10":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_f20370c47b754f2cadb858e0d8abe65f","max":3,"min":0,"orientation":"horizontal","style":"IPY_MODEL_7d1e5f7dba6c4ab595cb32810cc3bb42","value":3}},"0ccb4a2129744cc8a0e17090286fbcd6":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"31f4aef18a6a4fb7ba27d73b729241d9":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_ea7c4f573fdd47cea6eaddc9fbee9b8b","placeholder":"​","style":"IPY_MODEL_7a5a47a2ab824c6fbc6e73a63ee325b4","value":" 3/3 [24:35&lt;00:00, 491.97s/it]"}},"3a49a098ffab46a7a8a3fd6a6c3ce8df":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_f7599681eff44373a9a12f9e6ae56884","max":3,"min":0,"orientation":"horizontal","style":"IPY_MODEL_92db149a9a5b47c9b9bfacb13407a3ed","value":3}},"3db96bb3065e4ec6a8a816a74079a48c":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_e4c463e0d2934503a7163f4f3deb4b48","IPY_MODEL_dd1db965f58a43eeb84a7e1382cf1720"],"layout":"IPY_MODEL_aece02adf8494527a32950b27ec67082"}},"3f51d25739db4146ac913b83fc0e98c3":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_e2667b4c580d459f8a0895869a9ae6d7","placeholder":"​","style":"IPY_MODEL_c3cbf889bc87482685dce7830e138d3e","value":" 3/3 [41:09&lt;00:00, 823.07s/it]"}},"602d925c0bbd4e1daea5bac8c847eda8":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"66377305ef2c434a8f0390aff08823ca":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"6c0494a2458e4baea84fee624f12228f":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"758337bfa81747b2bb7f7c866a9d8afe":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"7a5a47a2ab824c6fbc6e73a63ee325b4":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"7d1e5f7dba6c4ab595cb32810cc3bb42":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"7e03ebd79f434579864ba059b7e8da58":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_b4b640edd6ae44e5a64549ac4d64121d","IPY_MODEL_3f51d25739db4146ac913b83fc0e98c3"],"layout":"IPY_MODEL_f52252408f9f47308b56788f02302a3b"}},"7e948fe1f6464b07ad086edaec4898a4":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"88ba56fdf2464d6791d2b329f1841e5e":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8900da0cd1d24c6ab5ac2595e52ef607":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"92db149a9a5b47c9b9bfacb13407a3ed":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"a4ce9e4926fd453aa2261af8532422a7":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"aece02adf8494527a32950b27ec67082":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"b4b640edd6ae44e5a64549ac4d64121d":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_602d925c0bbd4e1daea5bac8c847eda8","max":3,"min":0,"orientation":"horizontal","style":"IPY_MODEL_66377305ef2c434a8f0390aff08823ca","value":3}},"ba6408d4cd2b462c9c95fb6714308d84":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_6c0494a2458e4baea84fee624f12228f","placeholder":"​","style":"IPY_MODEL_758337bfa81747b2bb7f7c866a9d8afe","value":" 3/3 [21:25&lt;00:00, 428.48s/it]"}},"c0640e4365ec4f6494978a28b59ca0a9":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"ProgressStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":"initial"}},"c09bce2238b043ac96bd5e8363c26fbf":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_040c9867f4eb42ee9607ac5a11861d10","IPY_MODEL_31f4aef18a6a4fb7ba27d73b729241d9"],"layout":"IPY_MODEL_88ba56fdf2464d6791d2b329f1841e5e"}},"c3cbf889bc87482685dce7830e138d3e":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"DescriptionStyleModel","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"dd1db965f58a43eeb84a7e1382cf1720":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HTMLModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_0ccb4a2129744cc8a0e17090286fbcd6","placeholder":"​","style":"IPY_MODEL_7e948fe1f6464b07ad086edaec4898a4","value":" 3/3 [48:41&lt;00:00, 973.88s/it]"}},"e2667b4c580d459f8a0895869a9ae6d7":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"e4c463e0d2934503a7163f4f3deb4b48":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"FloatProgressModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"100%","description_tooltip":null,"layout":"IPY_MODEL_8900da0cd1d24c6ab5ac2595e52ef607","max":3,"min":0,"orientation":"horizontal","style":"IPY_MODEL_c0640e4365ec4f6494978a28b59ca0a9","value":3}},"ea7c4f573fdd47cea6eaddc9fbee9b8b":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f20370c47b754f2cadb858e0d8abe65f":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f52252408f9f47308b56788f02302a3b":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f7151f82f6db44c381ed4950e3becb98":{"model_module":"@jupyter-widgets/controls","model_module_version":"1.5.0","model_name":"HBoxModel","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_3a49a098ffab46a7a8a3fd6a6c3ce8df","IPY_MODEL_ba6408d4cd2b462c9c95fb6714308d84"],"layout":"IPY_MODEL_a4ce9e4926fd453aa2261af8532422a7"}},"f7599681eff44373a9a12f9e6ae56884":{"model_module":"@jupyter-widgets/base","model_module_version":"1.2.0","model_name":"LayoutModel","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}}},"version_major":2,"version_minor":0}},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":17000,"databundleVersionId":895292,"sourceType":"competition"}],"dockerImageVersionId":29852,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Required Library","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.model_selection import KFold, StratifiedKFold, GroupKFold\nfrom tqdm import tqdm_notebook as tqdm\nimport datetime\nfrom sklearn.metrics import roc_auc_score\nimport xgboost as xgb\nimport gc\nimport os\n\n\n\n\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","execution":{"iopub.status.busy":"2024-01-30T03:14:52.926144Z","iopub.execute_input":"2024-01-30T03:14:52.926697Z","iopub.status.idle":"2024-01-30T03:14:56.400815Z","shell.execute_reply.started":"2024-01-30T03:14:52.926619Z","shell.execute_reply":"2024-01-30T03:14:56.400020Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Load data","metadata":{}},{"cell_type":"code","source":"train = pd.read_csv(\"../input/cat-in-the-dat-ii/train.csv\")\ntest = pd.read_csv(\"../input/cat-in-the-dat-ii/test.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:14:56.402779Z","iopub.execute_input":"2024-01-30T03:14:56.403351Z","iopub.status.idle":"2024-01-30T03:15:03.754344Z","shell.execute_reply.started":"2024-01-30T03:14:56.403299Z","shell.execute_reply":"2024-01-30T03:15:03.753197Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.756099Z","iopub.execute_input":"2024-01-30T03:15:03.756741Z","iopub.status.idle":"2024-01-30T03:15:03.823437Z","shell.execute_reply.started":"2024-01-30T03:15:03.756658Z","shell.execute_reply":"2024-01-30T03:15:03.822323Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.825202Z","iopub.execute_input":"2024-01-30T03:15:03.825519Z","iopub.status.idle":"2024-01-30T03:15:03.869757Z","shell.execute_reply.started":"2024-01-30T03:15:03.825470Z","shell.execute_reply":"2024-01-30T03:15:03.868358Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Preprocessing","metadata":{}},{"cell_type":"markdown","source":"**1. Ordinal data**\n\nConvert Ordinal data to numbers representing order.\n\nBecause ord_0 looks already done, I'll try 'ord_1', 'ord_2', 'ord_3', 'ord_4' and 'ord_5'.","metadata":{}},{"cell_type":"code","source":"train.loc[:,['ord_1', 'ord_2', 'ord_3', 'ord_4', 'ord_5']]","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.874655Z","iopub.execute_input":"2024-01-30T03:15:03.875165Z","iopub.status.idle":"2024-01-30T03:15:03.926915Z","shell.execute_reply.started":"2024-01-30T03:15:03.875095Z","shell.execute_reply":"2024-01-30T03:15:03.925997Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def ret_ord_1(ord_1_data):\n    \"\"\"\n    convert index from sorted ord_1 data.\n    if data is np.nan, return -1.\n    \"\"\"\n    try:\n        if (math.isnan(ord_1_data)):\n            return -1 #np.nan\n    except TypeError:\n        ord_1_list = ['Novice', 'Contributor', 'Expert', 'Master', 'Grandmaster']\n        indexes = [ i for i in range(len(ord_1_list))]\n        num_index = ord_1_list.index(ord_1_data)\n        return indexes[num_index]","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.932373Z","iopub.execute_input":"2024-01-30T03:15:03.932790Z","iopub.status.idle":"2024-01-30T03:15:03.945247Z","shell.execute_reply.started":"2024-01-30T03:15:03.932706Z","shell.execute_reply":"2024-01-30T03:15:03.943438Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def ret_ord_2(ord_2_data):\n    \"\"\"\n    convert index from sorted ord_2 data.\n    if data is np.nan, return -1.\n    \"\"\"\n    \n    try:\n        if math.isnan(ord_2_data):\n            return -1 #np.nan\n    \n    except TypeError:\n            ord_2_list = ['Freezing', 'Cold', 'Warm', 'Hot','Boiling Hot', 'Lava Hot']\n            indexes = [ i for i in range(len(ord_2_list))]\n            num_index = ord_2_list.index(ord_2_data)\n            return indexes[num_index]","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.947583Z","iopub.execute_input":"2024-01-30T03:15:03.948077Z","iopub.status.idle":"2024-01-30T03:15:03.959295Z","shell.execute_reply.started":"2024-01-30T03:15:03.948001Z","shell.execute_reply":"2024-01-30T03:15:03.957842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def ret_ord_3(ord_3_data):\n    \"\"\"\n    convert index from sorted ord_3 data.\n    if data is np.nan, return -1.\n    \"\"\"\n    try:\n        if math.isnan(ord_3_data):\n            return -1 #np.nan\n    \n    except TypeError:\n            ord_3_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o']\n            indexes = [ i for i in range(len(ord_3_list))]\n            num_index = ord_3_list.index(ord_3_data)\n            return indexes[num_index]","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.961798Z","iopub.execute_input":"2024-01-30T03:15:03.962538Z","iopub.status.idle":"2024-01-30T03:15:03.973479Z","shell.execute_reply.started":"2024-01-30T03:15:03.962256Z","shell.execute_reply":"2024-01-30T03:15:03.972381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def ret_ord_4(ord_4_data):\n    \"\"\"\n    convert index from sorted ord_4 data.\n    if data is np.nan, return -1.\n    \"\"\"\n    try:\n        if math.isnan(ord_4_data):\n            return -1 #np.nan\n    \n    except TypeError:\n            ord_4_list = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']\n            indexes = [ i for i in range(len(ord_4_list))]\n            num_index = ord_4_list.index(ord_4_data)\n            return indexes[num_index]","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.975652Z","iopub.execute_input":"2024-01-30T03:15:03.976091Z","iopub.status.idle":"2024-01-30T03:15:03.989426Z","shell.execute_reply.started":"2024-01-30T03:15:03.976017Z","shell.execute_reply":"2024-01-30T03:15:03.988372Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def ret_ord_5(ord_5_data):\n    \"\"\"\n    convert index from sorted ord_5 data.\n    if data is np.nan, return -1.\n    \"\"\"\n    \n    try:\n        if math.isnan(ord_5_data):\n            return -1 #np.nan\n    \n    except TypeError:\n            ord_5_list = ['AG','AI','AU','AW','Ay','BL','BX','Bx','CN','CU','Cn','DI','DN','DR','DT','Dj','Dn',\n                          'EC','Ey','FB','FH','Fl','GZ','HF','HK','HO','Hk','IA','IS','Ib','In','Io','Iq','JQ',\n                          'JT','Ji','Kq','LS','LY','Lo','MF','MU','MV','MX','Mg','Mq','NS','NT','Nh','OM','OZ',\n                          'Oe','Ox','PG','PS','Pk','Pw','QV','Qm','RB','RD','RT','RV','Re','Rj','Ro','Rv','Rz',\n                          'SL','SS','Sk','Sz','TH','TL','TP','TZ','Tg','Ty','Tz','US','UV','WC','WW','Wr','XC',\n                          'XI','XM','XR','XU','YJ','Yb','Yi','Yr','Zv','aA','aE','al','be','cR','cY','cg','cy',\n                          'dh','dp','eA','eN','ep','fF','fO','fV','fe','gK','gL','gV','gc','gj','gt','hG','hT',\n                          'ht','hx','iS','iv','ja','jf','jp','kB','kP','kT','kv','lA','lR','lS','ly','mD','mP',\n                          'mX','mi','mo','nS','ne','nf','nj','nn','oI','oJ','oU','oh','ok','pB','pE','pT','pZ',\n                          'pl','qN','qP','rA','rM','rg','rl','sF','sY','sc','sf','tT','th','tn','uI','uP','uQ',\n                          'uW','uZ','ur','us','vQ','vq','vw','vx','wJ','wU','wa','xB','xF','xG','yE','yK','zc',\n                          'ze','zf','zp']\n            \n            ord_5_list = list(set([ i for i in ord_5_list]))\n            indexes = [ i for i in range(len(ord_5_list))]\n            num_index = ord_5_list.index(ord_5_data)\n            return indexes[num_index]\n","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:03.991198Z","iopub.execute_input":"2024-01-30T03:15:03.991616Z","iopub.status.idle":"2024-01-30T03:15:04.014813Z","shell.execute_reply.started":"2024-01-30T03:15:03.991540Z","shell.execute_reply":"2024-01-30T03:15:04.013277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['ord_1'] = train['ord_1'].map(ret_ord_1)\ntrain['ord_2'] = train['ord_2'].map(ret_ord_2)\ntrain['ord_3'] = train['ord_3'].map(ret_ord_3)\ntrain['ord_4'] = train['ord_4'].map(ret_ord_4)\ntrain['ord_5'] = train['ord_5'].map(ret_ord_5)","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:04.017294Z","iopub.execute_input":"2024-01-30T03:15:04.017718Z","iopub.status.idle":"2024-01-30T03:15:35.240013Z","shell.execute_reply.started":"2024-01-30T03:15:04.017644Z","shell.execute_reply":"2024-01-30T03:15:35.238875Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.loc[:,['ord_0','ord_1', 'ord_2', 'ord_3', 'ord_4', 'ord_5']]","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:35.241597Z","iopub.execute_input":"2024-01-30T03:15:35.241942Z","iopub.status.idle":"2024-01-30T03:15:35.299293Z","shell.execute_reply.started":"2024-01-30T03:15:35.241871Z","shell.execute_reply":"2024-01-30T03:15:35.298186Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test['ord_1'] = test['ord_1'].map(ret_ord_1)\ntest['ord_2'] = test['ord_2'].map(ret_ord_2)\ntest['ord_3'] = test['ord_3'].map(ret_ord_3)\ntest['ord_4'] = test['ord_4'].map(ret_ord_4)\ntest['ord_5'] = test['ord_5'].map(ret_ord_5)","metadata":{"execution":{"iopub.status.busy":"2024-01-30T03:15:35.300912Z","iopub.execute_input":"2024-01-30T03:15:35.301268Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.loc[:,['ord_0','ord_1', 'ord_2', 'ord_3', 'ord_4', 'ord_5']]","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**2. Label encording**\n\nI'll apply Label encording to \"bin_3\", \"bin_4\", \"nom_0\", \"nom_1\", \"nom_2\", \"nom_3\", \"nom_4\", \"nom_5\", \"nom_6\", \"nom_7\", \"nom_8\" and \"nom_9\".\nThese columns look categolical.","metadata":{}},{"cell_type":"code","source":"cat_cols = [\"bin_3\", \"bin_4\", \"nom_0\", \"nom_1\", \"nom_2\", \"nom_3\", \"nom_4\", \"nom_5\", \"nom_6\", \n            \"nom_7\", \"nom_8\", \"nom_9\"]\nfor c in cat_cols:\n    le = LabelEncoder()\n    tmp = []\n    train[c][pd.isnull(train)[c]]= 'NaN'\n    test[c][pd.isnull(test)[c]]= 'NaN'\n    \n    \n    for i in train[c]:\n        tmp.append(i)\n    for i in test[c]:\n        tmp.append(i)\n        \n    \n    le.fit(tmp)\n    train[c] = le.transform(train[c])\n    test[c] = le.transform(test[c])\n    \n    del tmp\n    gc.collect()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**3.Standard Scale**","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import StandardScaler\ncol_StandardScale=['bin_0','bin_1', 'bin_2', 'bin_3', 'bin_4', \n                   'nom_0','nom_1','nom_2', 'nom_3', 'nom_4', \n                   'nom_5','nom_6', 'nom_7', 'nom_8','nom_9' ,\n                   'ord_0', 'ord_1', 'ord_2','ord_3', 'ord_4', \n                   'ord_5', 'day', 'month']\nobj=StandardScaler()\ntrain[col_StandardScale]=obj.fit_transform(train[col_StandardScale])\ntest[col_StandardScale]=obj.transform(test[col_StandardScale])","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**4.Check data for training & prediction.**","metadata":{}},{"cell_type":"code","source":"train.head()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.head()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Training & Prediction\n\nI refered https://www.kaggle.com/drcapa/categorical-feature-engineering-2-xgb for decide hyperparameters.\nThank you so mutch.","metadata":{}},{"cell_type":"markdown","source":"**1.Grid Search**","metadata":{}},{"cell_type":"code","source":"categorical = ['bin_0', 'bin_1', 'bin_2', 'bin_3', 'bin_4', 'nom_0', 'nom_1',\n       'nom_2', 'nom_3', 'nom_4' ,'nom_5', 'nom_6','nom_7', 'nom_8', 'nom_9']\nnumeric_cols = [col for col in train.columns if col not in categorical + ['target','id']]\nfeatures = categorical + numeric_cols","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def search_XGBoost(max_depth,subsample,colsample_bytree,lr):\n    folds = 3\n    scores = []\n\n    kf = StratifiedKFold(n_splits=folds, shuffle=True)\n    for tr_idx, val_idx in tqdm(kf.split(train[features], train['target']), total = folds):\n        X_train = train[features].iloc[tr_idx] \n        y_train = train['target'].iloc[tr_idx]\n        X_test = train[features].iloc[val_idx]\n        y_test = train['target'].iloc[val_idx]\n    \n        model = xgb.XGBClassifier(objective ='binary:logistic',\n                      colsample_bytree = colsample_bytree,\n                      learning_rate = lr,\n                      max_depth = max_depth,\n                      n_estimators = 400,\n                      eta = 0.25,\n                      scale_pos_weight = 2,\n                      random_state = 2020,\n                      subsample = subsample)\n    \n        model.fit(X_train, y_train, eval_set=[(X_test, y_test)], verbose=False,)\n    \n        preds_val = model.predict_proba(X_test)[:,1]\n        score = roc_auc_score(y_test ,preds_val)\n        print(\"score: %f\" % (score))\n        scores.append(score)\n    \n    print(\"CV score: \",sum(scores)/len(scores))\n    return sum(scores)/len(scores)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"max_depths =[16]#14, 16, 18, 20 ]\nsubsamples = [0.86]\ncolsample_bytrees = [0, 0.05, 0.1, 0.15]\nlrs = [0.25]\n\nmax_auc = 0\n\nfor i in max_depths:\n    for j in subsamples:\n        for k in colsample_bytrees:\n            for l in lrs:          \n                tauc = search_XGBoost(i, j, k, l)\n                print(\"max_depth,ubsample,colsample_bytree,learning_rate: \", i,j,k,l)\n                if max_auc < tauc:\n                    max_auc = tauc\n                    best_max_depths = i\n                    best_subsamples = j\n                    best_colsample_bytrees = k\n                    best_learning_rate = l","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**2.Train Model for Prediction**","metadata":{}},{"cell_type":"code","source":"model = xgb.XGBClassifier(objective ='binary:logistic',\n                      colsample_bytree = best_colsample_bytrees,\n                      learning_rate = best_learning_rate,\n                      max_depth = best_max_depths,\n                      n_estimators = 400,\n                      eta=0.25,\n                      scale_pos_weight = 2,\n                      random_state = 2020,\n                      subsample = best_subsamples)\nmodel.fit(train[features], train['target'])","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**3.Prediction**","metadata":{}},{"cell_type":"code","source":"pred = model.predict_proba(test[features])[:,1]","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Submit","metadata":{}},{"cell_type":"code","source":"submit = pd.read_csv(\"../input/cat-in-the-dat-ii/sample_submission.csv\")","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submit[\"target\"] = pred","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submit.head()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submit.to_csv(\"./submit.csv\", index=False)","metadata":{"trusted":true},"execution_count":null,"outputs":[]}]}