{"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":101849,"databundleVersionId":13093295,"sourceType":"competition"},{"sourceId":9629432,"sourceType":"datasetVersion","datasetId":5846888},{"sourceId":12648560,"sourceType":"datasetVersion","datasetId":7993284}],"dockerImageVersionId":31089,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false},"papermill":{"default_parameters":{},"duration":36.921723,"end_time":"2024-10-17T09:42:47.313836","environment_variables":{},"exception":null,"input_path":"__notebook__.ipynb","output_path":"__notebook__.ipynb","parameters":{},"start_time":"2024-10-17T09:42:10.392113","version":"2.6.0"},"widgets":{"application/vnd.jupyter.widget-state+json":{"state":{"0217e0293bb045f38d75a05ec9456c55":{"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}},"06e309249bd54b368fdd1bde5fb177d3":{"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":""}},"0c149fcb46be4870aaf05722c9165ae4":{"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}},"0d667e37f8f7457b90df435b8a3fb0c3":{"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_f7fe75c76b384933993626e29a5333e9","placeholder":"​","style":"IPY_MODEL_28b872e440af4b508756741c8f108fba","value":" 1/1 [00:00&lt;00:00, 59.54it/s]"}},"10efd0abdb4649ae86e0775c19efa96b":{"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_e16b638e3d68448ab1474cc9dad3d9a5","IPY_MODEL_33084b28c101468bbd937d0b14b3a699","IPY_MODEL_94b7198bb80e4a3c96234ffae06f69f9"],"layout":"IPY_MODEL_28a2db47031f404393fd7c7298ae87c7"}},"10f172827baf41519f3b61a2d14bdffd":{"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}},"11525f1982994abb8749484066da6027":{"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":""}},"1ce87843b0234aac8804130f578f2ba0":{"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":""}},"1d718658a4544e2eba41a42c377db035":{"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}},"1e5c6440392649c097f04bb25070cd33":{"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}},"1ec013b749fc4f01b4973093ecea06ed":{"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":""}},"21622f0533da4858961e6e13429bea9e":{"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_1d718658a4544e2eba41a42c377db035","placeholder":"​","style":"IPY_MODEL_4ec6e04f90e54c33bcaac70fe21c377d","value":" 1/1 [00:00&lt;00:00, 16.38it/s]"}},"28a2db47031f404393fd7c7298ae87c7":{"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}},"28b872e440af4b508756741c8f108fba":{"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":""}},"2bdaa3f9e018490f85f353234e220630":{"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_4c7dd6f71bf842458017bfba0e05e1f7","placeholder":"​","style":"IPY_MODEL_f8e3bd47354b4434a2afa032534d657e","value":" 1/1 [00:00&lt;00:00, 58.00it/s]"}},"2cbef0cd948241a7bca85b2342809f2d":{"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_fc8be9e88b854b72adbaa1ef554a91ba","IPY_MODEL_fadf5c251cea4792bcec5c9d3d1a244e","IPY_MODEL_0d667e37f8f7457b90df435b8a3fb0c3"],"layout":"IPY_MODEL_51c5959cb0b24d4d809023e617469464"}},"30f4e9ac8e3f4562811a50d0bcc44b7a":{"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}},"33084b28c101468bbd937d0b14b3a699":{"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":"","description_tooltip":null,"layout":"IPY_MODEL_a5a155a00184494a9db5653343cbdb20","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_553ebd2e7a8647309ec3baf479927d4e","value":1}},"348ea64fef814441affcbbe909f35479":{"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":""}},"35a88ca9545b47ef952f4e6ecd8a0f04":{"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_8c97cd7b8bd04fa5948fe4302e152872","IPY_MODEL_b6532d0169de4941ab373da6c7fcaecf","IPY_MODEL_7962be04243641daa50978803cf334e4"],"layout":"IPY_MODEL_b8e2e9f791e64690aa1c50c90434a198"}},"360008763dac4d3c8c6b327ff9e4b18f":{"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}},"377e1f98d5a74d58909bfab8a5d355d9":{"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}},"46205ceffb9642d7962f9626774d355b":{"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}},"4c124c1359944d8a908ae17787e1ef89":{"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":"","description_tooltip":null,"layout":"IPY_MODEL_ce5ffd82e0cd4d5fac6762def34ed182","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_e9779b24bfca441399b658fffd30922b","value":1}},"4c7dd6f71bf842458017bfba0e05e1f7":{"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}},"4ec6e04f90e54c33bcaac70fe21c377d":{"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":""}},"4f6ece964c8c4dabae02f053327ff42c":{"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_10f172827baf41519f3b61a2d14bdffd","placeholder":"​","style":"IPY_MODEL_a17f7b9b6417438f9a3e82902d92f4af","value":"QUEUEING TASKS | : 100%"}},"51c5959cb0b24d4d809023e617469464":{"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}},"553ebd2e7a8647309ec3baf479927d4e":{"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":""}},"5d19f9c45b5d4b90816589e073baf017":{"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_8a06433d4ef5434990089b95a06e9c8b","IPY_MODEL_4c124c1359944d8a908ae17787e1ef89","IPY_MODEL_8b8db1651f8844308f6b36c3e29d0524"],"layout":"IPY_MODEL_69abd17a385944c5baf61f15446ef7db"}},"5fa711c4d5934cfdbd4097542bf6855d":{"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":"","description_tooltip":null,"layout":"IPY_MODEL_c1c872de57e5476793509faa2c880db8","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_11525f1982994abb8749484066da6027","value":1}},"69abd17a385944c5baf61f15446ef7db":{"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}},"6d2d82c24721404ca7b7f6ed4cc5a191":{"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":""}},"782bbd0f25ef4c9db12887761970cf86":{"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}},"7962be04243641daa50978803cf334e4":{"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_1e5c6440392649c097f04bb25070cd33","placeholder":"​","style":"IPY_MODEL_c29c7c42fa204bdf8c81a2a090c9d92e","value":" 1/1 [00:00&lt;00:00, 16.19it/s]"}},"8310814d6cf640d981346276320e666d":{"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":""}},"854d0c8c188747a398757eecc5c70a4f":{"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":""}},"8a06433d4ef5434990089b95a06e9c8b":{"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_e61ea973a7ac48e1a0c39a9cfbeed6ea","placeholder":"​","style":"IPY_MODEL_1ce87843b0234aac8804130f578f2ba0","value":"PROCESSING TASKS | : 100%"}},"8b8db1651f8844308f6b36c3e29d0524":{"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_46205ceffb9642d7962f9626774d355b","placeholder":"​","style":"IPY_MODEL_c9a131e3b780490b83783e6e39c5c91d","value":" 1/1 [00:07&lt;00:00,  7.00s/it]"}},"8c97cd7b8bd04fa5948fe4302e152872":{"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_c06a32a04df94d0cb3feefbf4359de0f","placeholder":"​","style":"IPY_MODEL_1ec013b749fc4f01b4973093ecea06ed","value":"QUEUEING TASKS | : 100%"}},"91fc962c759c4c20a3e63678ba17df9d":{"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":""}},"94b7198bb80e4a3c96234ffae06f69f9":{"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_a7ef732ef1f04c6caa29ccc4456ab497","placeholder":"​","style":"IPY_MODEL_8310814d6cf640d981346276320e666d","value":" 1/1 [00:05&lt;00:00,  5.51s/it]"}},"a17f7b9b6417438f9a3e82902d92f4af":{"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":""}},"a5a155a00184494a9db5653343cbdb20":{"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}},"a7ef732ef1f04c6caa29ccc4456ab497":{"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}},"b6532d0169de4941ab373da6c7fcaecf":{"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":"","description_tooltip":null,"layout":"IPY_MODEL_782bbd0f25ef4c9db12887761970cf86","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_6d2d82c24721404ca7b7f6ed4cc5a191","value":1}},"b8e2e9f791e64690aa1c50c90434a198":{"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}},"bd1da3b644ce45dbb20928cebe4b3cd8":{"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_4f6ece964c8c4dabae02f053327ff42c","IPY_MODEL_5fa711c4d5934cfdbd4097542bf6855d","IPY_MODEL_21622f0533da4858961e6e13429bea9e"],"layout":"IPY_MODEL_360008763dac4d3c8c6b327ff9e4b18f"}},"c06a32a04df94d0cb3feefbf4359de0f":{"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}},"c1c872de57e5476793509faa2c880db8":{"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}},"c29c7c42fa204bdf8c81a2a090c9d92e":{"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":""}},"c3058178ca654c259922670ec7a44f72":{"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_0c149fcb46be4870aaf05722c9165ae4","placeholder":"​","style":"IPY_MODEL_854d0c8c188747a398757eecc5c70a4f","value":"COLLECTING RESULTS | : 100%"}},"c9a131e3b780490b83783e6e39c5c91d":{"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":""}},"cbee1393c9d84a7f9141a0497525be25":{"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}},"ce5ffd82e0cd4d5fac6762def34ed182":{"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}},"e0611027ba8d4ba6b83a846c3c610689":{"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":""}},"e16b638e3d68448ab1474cc9dad3d9a5":{"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_377e1f98d5a74d58909bfab8a5d355d9","placeholder":"​","style":"IPY_MODEL_91fc962c759c4c20a3e63678ba17df9d","value":"PROCESSING TASKS | : 100%"}},"e194151c396a41cf8a5e1f768f888831":{"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}},"e61ea973a7ac48e1a0c39a9cfbeed6ea":{"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}},"e9779b24bfca441399b658fffd30922b":{"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":""}},"f7fe75c76b384933993626e29a5333e9":{"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}},"f8e3bd47354b4434a2afa032534d657e":{"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":""}},"f903f48a47114a8293a2c0b9d5bedcc4":{"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_c3058178ca654c259922670ec7a44f72","IPY_MODEL_fb85b54e00dc48abbef36e734685b4d9","IPY_MODEL_2bdaa3f9e018490f85f353234e220630"],"layout":"IPY_MODEL_0217e0293bb045f38d75a05ec9456c55"}},"fadf5c251cea4792bcec5c9d3d1a244e":{"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":"","description_tooltip":null,"layout":"IPY_MODEL_cbee1393c9d84a7f9141a0497525be25","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_e0611027ba8d4ba6b83a846c3c610689","value":1}},"fb85b54e00dc48abbef36e734685b4d9":{"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":"","description_tooltip":null,"layout":"IPY_MODEL_30f4e9ac8e3f4562811a50d0bcc44b7a","max":1,"min":0,"orientation":"horizontal","style":"IPY_MODEL_06e309249bd54b368fdd1bde5fb177d3","value":1}},"fc8be9e88b854b72adbaa1ef554a91ba":{"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_e194151c396a41cf8a5e1f768f888831","placeholder":"​","style":"IPY_MODEL_348ea64fef814441affcbbe909f35479","value":"COLLECTING RESULTS | : 100%"}}},"version_major":2,"version_minor":0}}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"This notebook builds upon the excellent work done in the following baselines: <br />\n- [Sergei Fironov](https://www.kaggle.com/sergeifironov): [ariel_only_correlation](https://www.kaggle.com/code/sergeifironov/ariel-only-correlation)\n- [Laurent Pourchot](https://www.kaggle.com/pourchot): [Ariel Data Challenge 2024](https://www.kaggle.com/code/pourchot/ariel-data-challenge-2024?scriptVersionId=195970765)\n- [qianc](https://www.kaggle.com/xiaocao123): [Ariel Data Challenge 2024](https://www.kaggle.com/code/xiaocao123/ariel-data-challenge-2024)\n- [Vitaly Kudelya](https://www.kaggle.com/vitalykudelya) : [Ariel Data Challenge 2025](https://www.kaggle.com/code/vitalykudelya/neurips-non-ml-transit-curve-fitting)\n\nThank you to the authors for sharing their insights and code 🙏","metadata":{"_uuid":"59e1f5a1-4897-49be-b9ca-aa9a44516170","_cell_guid":"7c7620c3-baad-4005-b969-d3f5bdf4a83b","trusted":true,"collapsed":false,"papermill":{"duration":0.006572,"end_time":"2024-10-17T09:42:13.32315","exception":false,"start_time":"2024-10-17T09:42:13.316578","status":"completed"},"tags":[],"jupyter":{"outputs_hidden":false}}},{"cell_type":"code","source":"# # install pqdm for parallel processing\n!pip install --no-index --find-links=/kaggle/input/ariel-2024-pqdm pqdm","metadata":{"_uuid":"551c5f29-196c-4b4f-ae13-8e330a26d5cf","_cell_guid":"a1797359-3baf-4c1a-a0e0-7448f15d7d26","trusted":true,"collapsed":false,"papermill":{"duration":14.056395,"end_time":"2024-10-17T09:42:27.397019","exception":false,"start_time":"2024-10-17T09:42:13.340624","status":"completed"},"tags":[],"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2025-08-11T02:35:03.306298Z","iopub.execute_input":"2025-08-11T02:35:03.306731Z","iopub.status.idle":"2025-08-11T02:35:08.288229Z","shell.execute_reply.started":"2025-08-11T02:35:03.306695Z","shell.execute_reply":"2025-08-11T02:35:08.28697Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Librairies","metadata":{"_uuid":"fa38d47c-49ca-48f8-b877-19cf09a1850e","_cell_guid":"fd700e01-cba4-437c-b5d9-862c227e1bb7","trusted":true,"collapsed":false,"papermill":{"duration":0.005981,"end_time":"2024-10-17T09:42:27.409388","exception":false,"start_time":"2024-10-17T09:42:27.403407","status":"completed"},"tags":[],"jupyter":{"outputs_hidden":false}}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport pandas.api.types\nimport scipy.stats\n\nfrom tqdm import tqdm\nfrom pqdm.threads import pqdm\nimport itertools\nimport pickle\n\nfrom scipy.optimize import minimize\nfrom sklearn.metrics import mean_squared_error\n\nimport plotly.express as px\n\nfrom astropy.stats import sigma_clip\nfrom scipy.signal import savgol_filter\nimport matplotlib.pyplot as plt\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\nfrom xgboost import XGBRegressor\nfrom sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score\nfrom sklearn.model_selection import KFold\n","metadata":{"_uuid":"24798c1e-8b26-4548-b007-fe790adb4e88","_cell_guid":"7167a660-8bc2-4b2c-951a-71fc5a4eb8e8","trusted":true,"collapsed":false,"execution":{"iopub.status.busy":"2025-08-11T02:35:08.290448Z","iopub.execute_input":"2025-08-11T02:35:08.290739Z","iopub.status.idle":"2025-08-11T02:35:11.910775Z","shell.execute_reply.started":"2025-08-11T02:35:08.290712Z","shell.execute_reply":"2025-08-11T02:35:11.909923Z"},"papermill":{"duration":3.680946,"end_time":"2024-10-17T09:42:31.096532","exception":false,"start_time":"2024-10-17T09:42:27.415586","status":"completed"},"tags":[],"jupyter":{"outputs_hidden":false}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Config","metadata":{}},{"cell_type":"code","source":"class Config:\n    def __init__(self, dataset=\"train\"):\n        self.DATA_PATH = '/kaggle/input/ariel-data-challenge-2025'\n        self.DATASET = dataset\n    \n        self.SCALE = 0.93960\n        self.SIGMA = 0.0009\n        \n        self.CUT_INF = 39\n        self.CUT_SUP = 250\n        \n        self.SENSOR_CONFIG = {\n            \"AIRS-CH0\": {\n                \"raw_shape\": [11250, 32, 356],\n                \"calibrated_shape\": [1, 32, self.CUT_SUP - self.CUT_INF],\n                \"linear_corr_shape\": (6, 32, 356),\n                \"dt_pattern\": (0.1, 4.5), \n                \"binning\": 30\n            },\n            \"FGS1\": {\n                \"raw_shape\": [135000, 32, 32],\n                \"calibrated_shape\": [1, 32, 32],\n                \"linear_corr_shape\": (6, 32, 32),\n                \"dt_pattern\": (0.1, 0.1),\n                \"binning\": 30 * 12\n            }\n        }\n        \n        self.MODEL_PHASE_DETECTION_SLICE = slice(30, 140)\n        self.MODEL_OPTIMIZATION_DELTA = 7\n        self.MODEL_POLYNOMIAL_DEGREE = 2 #3\n        \n        self.N_JOBS = 4","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:11.911801Z","iopub.execute_input":"2025-08-11T02:35:11.912324Z","iopub.status.idle":"2025-08-11T02:35:11.919386Z","shell.execute_reply.started":"2025-08-11T02:35:11.91229Z","shell.execute_reply":"2025-08-11T02:35:11.918487Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Import the dataset","metadata":{}},{"cell_type":"code","source":"preprocessed_train_data = np.load(\n    \"/kaggle/input/ariel-preprocessed-traindata/preprocessed_traindata.npy\")\ndf_train_labels = pd.read_csv(\n    \"/kaggle/input/ariel-data-challenge-2025/train.csv\", index_col=\"planet_id\")\nprint(preprocessed_train_data.shape, df_train_labels.shape) ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:11.920336Z","iopub.execute_input":"2025-08-11T02:35:11.92061Z","iopub.status.idle":"2025-08-11T02:35:14.650492Z","shell.execute_reply.started":"2025-08-11T02:35:11.92059Z","shell.execute_reply":"2025-08-11T02:35:14.649565Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Data Preprocessing","metadata":{}},{"cell_type":"code","source":"    class SignalProcessor:\n        def __init__(self, config):\n            self.cfg = config\n            self.adc_info = pd.read_csv(f\"{self.cfg.DATA_PATH}/adc_info.csv\")\n            self.planet_ids = pd.read_csv(f'{self.cfg.DATA_PATH}/{self.cfg.DATASET}_star_info.csv', index_col='planet_id').index.astype(int)\n    \n        def _apply_linear_corr(self, linear_corr, signal):\n            linear_corr_flipped = np.flip(linear_corr, axis=0)\n            corrected_signal = signal.copy()\n            \n            for x, y in itertools.product(range(signal.shape[1]), range(signal.shape[2])):\n                poly = np.poly1d(linear_corr_flipped[:, x, y])\n                corrected_signal[:, x, y] = poly(corrected_signal[:, x, y])\n                \n            return corrected_signal\n    \n        def _calibrate_single_signal(self, planet_id, sensor):\n            sensor_cfg = self.cfg.SENSOR_CONFIG[sensor]\n    \n            signal = pd.read_parquet(f\"{self.cfg.DATA_PATH}/{self.cfg.DATASET}/{planet_id}/{sensor}_signal_0.parquet\").to_numpy()\n            dark = pd.read_parquet(f\"{self.cfg.DATA_PATH}/{self.cfg.DATASET}/{planet_id}/{sensor}_calibration_0/dark.parquet\").to_numpy()\n            dead = pd.read_parquet(f\"{self.cfg.DATA_PATH}/{self.cfg.DATASET}/{planet_id}/{sensor}_calibration_0/dead.parquet\").to_numpy()\n            flat = pd.read_parquet(f\"{self.cfg.DATA_PATH}/{self.cfg.DATASET}/{planet_id}/{sensor}_calibration_0/flat.parquet\").to_numpy()\n            linear_corr = pd.read_parquet(f\"{self.cfg.DATA_PATH}/{self.cfg.DATASET}/{planet_id}/{sensor}_calibration_0/linear_corr.parquet\").values.astype(np.float64).reshape(sensor_cfg[\"linear_corr_shape\"])\n    \n            signal = signal.reshape(sensor_cfg[\"raw_shape\"])\n            gain = self.adc_info[f\"{sensor}_adc_gain\"].iloc[0]\n            offset = self.adc_info[f\"{sensor}_adc_offset\"].iloc[0]\n            signal = signal / gain + offset\n    \n            hot = sigma_clip(dark, sigma=5, maxiters=5).mask\n    \n            if sensor == \"AIRS-CH0\":\n                signal = signal[:, :, self.cfg.CUT_INF : self.cfg.CUT_SUP]\n                linear_corr = linear_corr[:, :, self.cfg.CUT_INF : self.cfg.CUT_SUP]\n                dark = dark[:, self.cfg.CUT_INF : self.cfg.CUT_SUP] #nhiễu nền\n                dead = dead[:, self.cfg.CUT_INF : self.cfg.CUT_SUP]\n                flat = flat[:, self.cfg.CUT_INF : self.cfg.CUT_SUP]#độ nhạy khác nhau của từng điểm ảnh\n                hot = hot[:, self.cfg.CUT_INF : self.cfg.CUT_SUP] # tín hiệu lỗi từ dark\n            \n            base_dt, increment = sensor_cfg[\"dt_pattern\"]\n            dt = np.ones(len(signal)) * base_dt # thời gian phơi sáng cơ bản\n            dt[1::2] += increment\n            \n            signal = signal.clip(0)\n            signal = self._apply_linear_corr(linear_corr, signal)\n            signal -= dark * dt[:, np.newaxis, np.newaxis]\n            \n            flat = flat.reshape(sensor_cfg[\"calibrated_shape\"])\n            flat[dead.reshape(sensor_cfg[\"calibrated_shape\"])] = np.nan\n            flat[hot.reshape(sensor_cfg[\"calibrated_shape\"])] = np.nan\n            \n            signal = signal / flat\n            \n            return signal\n    \n        def _preprocess_calibrated_signal(self, calibrated_signal, sensor):\n            sensor_cfg = self.cfg.SENSOR_CONFIG[sensor]\n            binning = sensor_cfg[\"binning\"]\n    \n            if sensor == \"AIRS-CH0\":\n                signal_roi = calibrated_signal[:, 10:22, :]\n            elif sensor == \"FGS1\":\n                signal_roi = calibrated_signal[:, 10:22, 10:22]\n                signal_roi = signal_roi.reshape(signal_roi.shape[0], -1)\n            \n            mean_signal = np.nanmean(signal_roi, axis=1)\n    \n            cds_signal = mean_signal[1::2] - mean_signal[0::2]\n    \n            n_bins = cds_signal.shape[0] // binning\n            binned = np.array([\n                cds_signal[j*binning : (j+1)*binning].mean(axis=0) \n                for j in range(n_bins)\n            ])\n    \n            if sensor == \"FGS1\":\n                binned = binned.reshape((binned.shape[0], 1))\n                \n            return binned\n    \n        def _process_planet_sensor(self, args):\n            planet_id, sensor = args['planet_id'], args['sensor']\n            calibrated = self._calibrate_single_signal(planet_id, sensor)\n            preprocessed = self._preprocess_calibrated_signal(calibrated, sensor)\n            return preprocessed\n    \n        def process_all_data(self):\n            args_fgs1 = [dict(planet_id=planet_id, sensor=\"FGS1\") for planet_id in self.planet_ids]\n            preprocessed_fgs1 = pqdm(args_fgs1, self._process_planet_sensor, n_jobs=self.cfg.N_JOBS)\n    \n            args_airs_ch0 = [dict(planet_id=planet_id, sensor=\"AIRS-CH0\") for planet_id in self.planet_ids]\n            preprocessed_airs_ch0 = pqdm(args_airs_ch0, self._process_planet_sensor, n_jobs=self.cfg.N_JOBS)\n    \n            preprocessed_signal = np.concatenate(\n                [np.stack(preprocessed_fgs1), np.stack(preprocessed_airs_ch0)], axis=2\n            )\n            return preprocessed_signal","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:14.652727Z","iopub.execute_input":"2025-08-11T02:35:14.652998Z","iopub.status.idle":"2025-08-11T02:35:14.672224Z","shell.execute_reply.started":"2025-08-11T02:35:14.652969Z","shell.execute_reply":"2025-08-11T02:35:14.671149Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# config_train = Config(dataset = \"train\")\n    \n# signal_processor_train = SignalProcessor(config_train)\n# preprocessed_traindata = signal_processor_train.process_all_data()\n# np.save(\"/kaggle/working/preprocessed_traindata.npy\", preprocessed_traindata)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:14.672826Z","iopub.execute_input":"2025-08-11T02:35:14.673063Z","iopub.status.idle":"2025-08-11T02:35:14.693796Z","shell.execute_reply.started":"2025-08-11T02:35:14.673044Z","shell.execute_reply":"2025-08-11T02:35:14.692821Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"config_test = Config(dataset = \"test\")\n    \nsignal_processor_test = SignalProcessor(config_test)\npreprocessed_test_data = signal_processor_test.process_all_data()\npreprocessed_test_data.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:14.694749Z","iopub.execute_input":"2025-08-11T02:35:14.695045Z","iopub.status.idle":"2025-08-11T02:35:38.795251Z","shell.execute_reply.started":"2025-08-11T02:35:14.695018Z","shell.execute_reply":"2025-08-11T02:35:38.794022Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Feature Engineering","metadata":{}},{"cell_type":"code","source":"def normalize_and_smooth(data, window_length=7, polyorder=3):\n    \"\"\"\n    Chuẩn hóa từng dòng của dữ liệu 3D và làm trơn tín hiệu bằng Savitzky-Golay filter.\n    \n    Args:\n        data (np.ndarray): Dữ liệu 3D có shape (num_samples, num_timesteps, num_wavelengths)\n        window_length (int): Độ dài cửa sổ làm trơn (số lẻ, >= polyorder + 2)\n        polyorder (int): Bậc của đa thức dùng để làm trơn\n        \n    Returns:\n        np.ndarray: Dữ liệu đã được chuẩn hóa và làm trơn, shape (num_samples, num_timesteps)\n    \"\"\"\n    # Tính trung bình theo trục bước sóng\n    X_mean = np.mean(data, axis=2)\n    X_max = np.max(X_mean, axis=1, keepdims=True)\n    X_max[X_max == 0] = 1  # tránh chia cho 0\n    X_normalized = X_mean / X_max\n    \n    smoothed_data = np.zeros_like(X_normalized)\n    for i in range(X_normalized.shape[0]):\n        smoothed_data[i] = savgol_filter(X_normalized[i], window_length, polyorder)\n\n    return smoothed_data","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:38.796432Z","iopub.execute_input":"2025-08-11T02:35:38.797047Z","iopub.status.idle":"2025-08-11T02:35:38.804946Z","shell.execute_reply.started":"2025-08-11T02:35:38.797016Z","shell.execute_reply":"2025-08-11T02:35:38.804167Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_mean_train = np.mean(preprocessed_train_data, axis=2)\nX_mean_train.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:38.805885Z","iopub.execute_input":"2025-08-11T02:35:38.806228Z","iopub.status.idle":"2025-08-11T02:35:38.874884Z","shell.execute_reply.started":"2025-08-11T02:35:38.806205Z","shell.execute_reply":"2025-08-11T02:35:38.873932Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_smoothed_train = normalize_and_smooth(preprocessed_train_data, window_length=7, polyorder=3)\nX_smoothed_test = normalize_and_smooth(preprocessed_test_data, window_length=7, polyorder=3)\nprint(X_smoothed_train.shape, X_smoothed_test.shape)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:38.87563Z","iopub.execute_input":"2025-08-11T02:35:38.87593Z","iopub.status.idle":"2025-08-11T02:35:39.412344Z","shell.execute_reply.started":"2025-08-11T02:35:38.875907Z","shell.execute_reply":"2025-08-11T02:35:39.411406Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Y_mean = np.mean(df_train_labels.values, axis=1)\nY_mean.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:39.413409Z","iopub.execute_input":"2025-08-11T02:35:39.413742Z","iopub.status.idle":"2025-08-11T02:35:39.420412Z","shell.execute_reply.started":"2025-08-11T02:35:39.413713Z","shell.execute_reply":"2025-08-11T02:35:39.419423Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Data visualization","metadata":{}},{"cell_type":"code","source":"plt.imshow(preprocessed_train_data[0], aspect='auto', cmap='viridis')\nplt.colorbar(label=\"Giá trị\")\nplt.title(\"Tín hiệu đã tiền xử lý số 0 trong tập huấn luyện\")\nplt.xlabel(\"Bước sóng\")\nplt.ylabel(\"Bước thời gian\")\nplt.show()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:39.421463Z","iopub.execute_input":"2025-08-11T02:35:39.421783Z","iopub.status.idle":"2025-08-11T02:35:39.83624Z","shell.execute_reply.started":"2025-08-11T02:35:39.421756Z","shell.execute_reply":"2025-08-11T02:35:39.835256Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"smoothed = X_smoothed_train[0]\nX_train_normalized_0 = X_mean_train[0]/np.max(X_mean_train[0])\n\nplt.plot(X_train_normalized_0, label='Gốc', alpha=0.5)\nplt.plot(smoothed, label='Làm trơn (Savitzky-Golay)', color='red')\nplt.legend()\nplt.title(\"So sánh tín hiệu trước và sau khi làm trơn\")\nplt.xlabel(\"Bước thời gian\")\nplt.ylabel(\"Giá trị thông lượng ánh sáng trung bình\")\nplt.grid(True)\nplt.show()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:39.837495Z","iopub.execute_input":"2025-08-11T02:35:39.837783Z","iopub.status.idle":"2025-08-11T02:35:40.17399Z","shell.execute_reply.started":"2025-08-11T02:35:39.837755Z","shell.execute_reply":"2025-08-11T02:35:40.17318Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.hist(Y_mean, bins=50, edgecolor='blue')\nplt.title(\"Biểu đồ tần suất của giá trị độ sâu quá cảnh\")\nplt.xlabel(\"Giá trị\")\nplt.ylabel(\"Tần suất\")\n\nplt.grid(True)\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:40.177212Z","iopub.execute_input":"2025-08-11T02:35:40.177489Z","iopub.status.idle":"2025-08-11T02:35:40.41534Z","shell.execute_reply.started":"2025-08-11T02:35:40.177468Z","shell.execute_reply":"2025-08-11T02:35:40.414459Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Model and Model evaluation","metadata":{}},{"cell_type":"markdown","source":"## Linear Regression","metadata":{}},{"cell_type":"markdown","source":"### Train - Validation split","metadata":{}},{"cell_type":"code","source":"X_train, X_val, y_train, y_val = train_test_split(X_smoothed_train, Y_mean, test_size=0.2, random_state=42)\n\nlr_model = LinearRegression()\nlr_model.fit(X_train, y_train)\ny_train_pred = lr_model.predict(X_train)\ny_val_pred = lr_model.predict(X_val)\n\ntrain_mse = mean_squared_error(y_train, y_train_pred)\ntrain_mae = mean_absolute_error(y_train, y_train_pred)\ntrain_r2 = r2_score(y_train, y_train_pred)\n\nval_mse = mean_squared_error(y_val, y_val_pred)\nval_mae = mean_absolute_error(y_val, y_val_pred)\nval_r2 = r2_score(y_val, y_val_pred)\n\nprint(\"\\nKết quả trên tập huấn luyện:\")\nprint(f\"  - MSE: {train_mse:.4f}\")\nprint(f\"  - MAE: {train_mae:.4f}\")\nprint(f\"  - R-squared: {train_r2:.4f}\")\n\nprint(\"\\nKết quả trên tập validation:\")\nprint(f\"  - MSE: {val_mse:.4f}\")\nprint(f\"  - MAE: {val_mae:.4f}\")\nprint(f\"  - R-squared: {val_r2:.4f}\")\n\nplt.figure(figsize=(10, 6))\nplt.scatter(y_val, y_val_pred, color='blue', label='Dự đoán vs Thực tế (Validation)')\nplt.plot([y_val.min(), y_val.max()], [y_val.min(), y_val.max()], 'r--', lw=2, label='Đường lý tưởng')\nplt.xlabel('Giá trị thực (Y)')\nplt.ylabel('Giá trị dự đoán')\nplt.title('Hồi quy tuyến tính: Dự đoán vs Giá trị thực trên tập Validation')\nplt.legend()\nplt.grid(True)\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:40.416139Z","iopub.execute_input":"2025-08-11T02:35:40.416427Z","iopub.status.idle":"2025-08-11T02:35:40.751233Z","shell.execute_reply.started":"2025-08-11T02:35:40.416402Z","shell.execute_reply":"2025-08-11T02:35:40.750419Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"### All dataset","metadata":{}},{"cell_type":"code","source":"Y = Y_mean\nX = X_smoothed_train\nlr_model = LinearRegression()\ncv_model = LinearRegression()\nlr_model.fit(X, Y)\ny_pred = lr_model.predict(X)\n\nmse = mean_squared_error(Y, y_pred)\nrmse = np.sqrt(mse)\nmae = mean_absolute_error(Y, y_pred)\nr2 = r2_score(Y, y_pred)\n\nresiduals = y_pred - Y\nmape = np.mean(np.abs(residuals / (Y + 1e-15))) * 100\nrmsle = np.sqrt(np.mean(np.log1p(np.abs(residuals))**2))\nexplained_var = 1 - np.var(residuals, ddof=1) / np.var(Y, ddof=1)\n\nprint(\"\\n📊 Results:\")\nprint(f\"  - MSE:  {mse:.6f}\")\nprint(f\"  - RMSE: {rmse:.6f}\")\nprint(f\"  - MAE:  {mae:.6f}\")\nprint(f\"  - R²:   {r2:.6f}\")\nprint(f\"  - MAPE: {mape:.2f}%\")\nprint(f\"  - RMSLE: {rmsle:.6f}\")\nprint(f\"  - Explained Variance: {explained_var:.6f}\")\n\nplt.figure(figsize=(8, 6))\nplt.scatter(Y, y_pred, alpha=0.6, s=20)\nplt.plot([Y.min(), Y.max()], [Y.min(), Y.max()], 'r--', lw=2)\nplt.xlabel('Actual Values')\nplt.ylabel('Predicted Values')\nplt.title(f'Predictions vs Actual\\nR² = {r2:.4f}')\nplt.grid(True, alpha=0.3)\nplt.tight_layout()\nplt.show()\n\nfeature_importance = np.abs(lr_model.coef_)\ntop_features_idx = np.argsort(feature_importance)[-20:]\n\nplt.figure(figsize=(8, 6))\nplt.barh(range(len(top_features_idx)), feature_importance[top_features_idx])\nplt.xlabel('Feature Importance (Abs Coef)')\nplt.title('Top 20 Feature Importances')\nplt.yticks(range(len(top_features_idx)), [f'Feature {i}' for i in top_features_idx])\nplt.grid(True, alpha=0.3)\nplt.tight_layout()\nplt.show()\n\nprint(\"\\n🔄 5-Fold Cross Validation...\")\ncv = KFold(n_splits=5, shuffle=True, random_state=10)\ncv_rmse_scores = []\ncv_r2_scores = []\n\nfor fold, (train_idx, val_idx) in enumerate(cv.split(X), 1):\n    X_train, X_val = X[train_idx], X[val_idx]\n    y_train, y_val = Y[train_idx], Y[val_idx]\n    cv_model.fit(X_train, y_train)\n    y_val_pred = cv_model.predict(X_val)\n    cv_rmse_scores.append(np.sqrt(mean_squared_error(y_val, y_val_pred)))\n    cv_r2_scores.append(r2_score(y_val, y_val_pred))\n    print(f\"  Fold {fold}: RMSE = {cv_rmse_scores[-1]:.6f}, R² = {cv_r2_scores[-1]:.6f}\")\n\ncv_rmse_mean = np.mean(cv_rmse_scores)\ncv_r2_mean = np.mean(cv_r2_scores)\nprint(f\"\\n📊 CV Results:\")\nprint(f\"  - CV RMSE: {cv_rmse_mean:.6f} (±{np.std(cv_rmse_scores)*2:.6f})\")\nprint(f\"  - CV R²:   {cv_r2_mean:.6f} (±{np.std(cv_r2_scores)*2:.6f})\")\n\nplt.figure(figsize=(10, 4))\nplt.subplot(1, 2, 1)\nplt.bar(range(1, 6), cv_rmse_scores, color='skyblue', edgecolor='navy')\nplt.axhline(y=cv_rmse_mean, color='red', linestyle='--', label=f'Mean: {cv_rmse_mean:.4f}')\nplt.xlabel('Fold')\nplt.ylabel('RMSE')\nplt.title('CV RMSE Scores')\nplt.legend()\nplt.grid(True, alpha=0.3)\n\nplt.subplot(1, 2, 2)\nplt.bar(range(1, 6), cv_r2_scores, color='lightcoral', edgecolor='darkred')\nplt.axhline(y=cv_r2_mean, color='red', linestyle='--', label=f'Mean: {cv_r2_mean:.4f}')\nplt.xlabel('Fold')\nplt.ylabel('R²')\nplt.title('CV R² Scores')\nplt.legend()\nplt.grid(True, alpha=0.3)\n\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:40.752203Z","iopub.execute_input":"2025-08-11T02:35:40.752771Z","iopub.status.idle":"2025-08-11T02:35:41.980855Z","shell.execute_reply.started":"2025-08-11T02:35:40.752746Z","shell.execute_reply":"2025-08-11T02:35:41.97984Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## XGBoosting Regression","metadata":{}},{"cell_type":"markdown","source":"### Train - validation split","metadata":{}},{"cell_type":"code","source":"X_train, X_val, y_train, y_val = train_test_split(X_smoothed_train, Y_mean, test_size=0.2, random_state=42)\n\nxgb_model_check = XGBRegressor(\n    objective='reg:squarederror',  # Hàm loss là MSE\n    max_depth=3,                   # Độ sâu tối đa của cây\n    learning_rate=0.05,             # Tốc độ học\n    # reg_lambda=2.0,\n    # min_child_weight=25,   # số lượng phần tử tối thiểu cho node con\n    n_estimators=100,              # Số lượng cây\n    colsample_bytree=0.8,  # Column sampling % số cột\n    random_state=42\n)\n\neval_set = [(X_train, y_train), (X_val, y_val)]\nxgb_model_check.fit(\n    X_train, y_train,\n    eval_set=eval_set,\n    eval_metric=\"rmse\",  \n    early_stopping_rounds=10,\n    verbose=False\n)\n\nresults = xgb_model_check.evals_result()\ntrain_rmse = results['validation_0']['rmse']\nval_rmse = results['validation_1']['rmse']\nepochs = range(1, len(train_rmse) + 1)\n\ny_train_pred = xgb_model_check.predict(X_train)\ny_val_pred = xgb_model_check.predict(X_val)\n\ntrain_mse = mean_squared_error(y_train, y_train_pred)\ntrain_mae = mean_absolute_error(y_train, y_train_pred)\ntrain_r2 = r2_score(y_train, y_train_pred)\n\nval_mse = mean_squared_error(y_val, y_val_pred)\nval_mae = mean_absolute_error(y_val, y_val_pred)\nval_r2 = r2_score(y_val, y_val_pred)\n\nprint(\"\\nKết quả trên tập huấn luyện:\")\nprint(f\"  - MSE: {train_mse:.4f}\")\nprint(f\"  - MAE: {train_mae:.4f}\")\nprint(f\"  - R-squared: {train_r2:.4f}\")\n\nprint(\"\\nKết quả trên tập validation:\")\nprint(f\"  - MSE: {val_mse:.4f}\")\nprint(f\"  - MAE: {val_mae:.4f}\")\nprint(f\"  - R-squared: {val_r2:.4f}\")\n\nplt.figure(figsize=(10, 6))\nplt.plot(epochs, train_rmse, label='Train RMSE', marker='o')\nplt.plot(epochs, val_rmse, label='Validation RMSE', marker='o')\nplt.xlabel('Boosting Rounds')\nplt.ylabel('RMSE')\nplt.title('Biểu đồ hội tụ của mô hình XGBoosting')\nplt.legend()\nplt.grid(True)\nplt.show()\n\nplt.figure(figsize=(10, 6))\nplt.scatter(y_val, y_val_pred, color='blue', label='Dự đoán vs Thực tế (Validation)')\nplt.plot([y_val.min(), y_val.max()], [y_val.min(), y_val.max()], 'r--', lw=2, label='Đường lý tưởng')\nplt.xlabel('Giá trị thực (Y)')\nplt.ylabel('Giá trị dự đoán')\nplt.title('XGBoosting: Dự đoán vs Giá trị thực trên tập Validation')\nplt.legend()\nplt.grid(True)\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:41.981926Z","iopub.execute_input":"2025-08-11T02:35:41.98231Z","iopub.status.idle":"2025-08-11T02:35:43.086331Z","shell.execute_reply.started":"2025-08-11T02:35:41.982279Z","shell.execute_reply":"2025-08-11T02:35:43.085143Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X = X_smoothed_train \nY = Y_mean\n\nxgb_model = XGBRegressor(\n    objective='reg:squarederror',\n    max_depth=5,\n    learning_rate=0.1,\n    n_estimators=100,\n    random_state=42\n)\nxgb_model.fit(X, Y, eval_set=[(X, Y)], verbose=False)\n\ntrain_rmse = xgb_model.evals_result()['validation_0']['rmse']\nepochs = range(1, len(train_rmse) + 1)\n\ny_pred = xgb_model.predict(X)\n\nmse = mean_squared_error(Y, y_pred)\nrmse = np.sqrt(mse)\nmae = mean_absolute_error(Y, y_pred)\nr2 = r2_score(Y, y_pred)\n\nprint(\"\\n📊 Results:\")\nprint(f\"  - MSE:  {mse:.6f}\")\nprint(f\"  - RMSE: {rmse:.6f}\")\nprint(f\"  - MAE:  {mae:.6f}\")\nprint(f\"  - R²:   {r2:.6f}\")\n\nplt.figure(figsize=(12, 8))\n# Subplot 1: RMSE Convergence\nplt.subplot(2, 2, 1)\nplt.plot(epochs, train_rmse, 'b-', label='Training RMSE', marker='o', markersize=3)\nplt.xlabel('Boosting Rounds')\nplt.ylabel('RMSE')\nplt.title('RMSE Convergence')\nplt.legend()\nplt.grid(True, alpha=0.3)\n\n# Subplot 2: Predictions vs Actual\nplt.subplot(2, 2, 2)\nplt.scatter(Y, y_pred, alpha=0.6, s=20)\nplt.plot([Y.min(), Y.max()], [Y.min(), Y.max()], 'r--', lw=2)\nplt.xlabel('Actual Values')\nplt.ylabel('Predicted Values')\nplt.title(f'Predictions vs Actual\\nR² = {r2:.4f}')\nplt.grid(True, alpha=0.3)\n\nplt.tight_layout()\nplt.show()\n\n# Feature Importance\nfeature_importance = xgb_model.feature_importances_\ntop_features_idx = np.argsort(feature_importance)[-20:]\nplt.figure(figsize=(8, 6))\nplt.barh(range(len(top_features_idx)), feature_importance[top_features_idx])\nplt.xlabel('Feature Importance')\nplt.title('Top 20 Feature Importances')\nplt.yticks(range(len(top_features_idx)), [f'Feature {i}' for i in top_features_idx])\nplt.grid(True, alpha=0.3)\nplt.tight_layout()\nplt.show()\n\n# Cross Validation\nprint(\"\\n🔄 5-Fold Cross Validation...\")\ncv = KFold(n_splits=5, shuffle=True, random_state=10)\ncv_rmse_scores = []\ncv_r2_scores = []\n\nfor fold, (train_idx, val_idx) in enumerate(cv.split(X), 1):\n    X_train, X_val = X[train_idx], X[val_idx]\n    y_train, y_val = Y[train_idx], Y[val_idx]\n    xgb_model.fit(X_train, y_train)\n    y_val_pred = xgb_model.predict(X_val)\n    cv_rmse_scores.append(np.sqrt(mean_squared_error(y_val, y_val_pred)))\n    cv_r2_scores.append(r2_score(y_val, y_val_pred))\n    print(f\"  Fold {fold}: RMSE = {cv_rmse_scores[-1]:.6f}, R² = {cv_r2_scores[-1]:.6f}\")\n\ncv_rmse_mean = np.mean(cv_rmse_scores)\ncv_r2_mean = np.mean(cv_r2_scores)\nprint(f\"\\n📊 CV Results:\")\nprint(f\"  - CV RMSE: {cv_rmse_mean:.6f} (±{np.std(cv_rmse_scores)*2:.6f})\")\nprint(f\"  - CV R²:   {cv_r2_mean:.6f} (±{np.std(cv_r2_scores)*2:.6f})\")\n\n# Vẽ biểu đồ CV\nplt.figure(figsize=(10, 4))\nplt.subplot(1, 2, 1)\nplt.bar(range(1, 6), cv_rmse_scores, color='skyblue', edgecolor='navy')\nplt.axhline(y=cv_rmse_mean, color='red', linestyle='--', label=f'Mean: {cv_rmse_mean:.4f}')\nplt.xlabel('Fold')\nplt.ylabel('RMSE')\nplt.title('CV RMSE Scores')\nplt.legend()\nplt.grid(True, alpha=0.3)\n\nplt.subplot(1, 2, 2)\nplt.bar(range(1, 6), cv_r2_scores, color='lightcoral', edgecolor='darkred')\nplt.axhline(y=cv_r2_mean, color='red', linestyle='--', label=f'Mean: {cv_r2_mean:.4f}')\nplt.xlabel('Fold')\nplt.ylabel('R²')\nplt.title('CV R² Scores')\nplt.legend()\nplt.grid(True, alpha=0.3)\n\nplt.tight_layout()\nplt.show()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:43.087421Z","iopub.execute_input":"2025-08-11T02:35:43.087682Z","iopub.status.idle":"2025-08-11T02:35:51.026165Z","shell.execute_reply.started":"2025-08-11T02:35:43.087661Z","shell.execute_reply":"2025-08-11T02:35:51.025268Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"## Transit Model","metadata":{}},{"cell_type":"code","source":"class TransitModel:\n    def __init__(self, config):\n        self.cfg = config\n\n    def _phase_detector(self, signal):\n        search_slice = self.cfg.MODEL_PHASE_DETECTION_SLICE\n        min_index = np.argmin(signal[search_slice]) + search_slice.start\n        \n        signal1 = signal[:min_index]\n        signal2 = signal[min_index:]\n\n        grad1 = np.gradient(signal1)\n        grad1 /= grad1.max()\n        \n        grad2 = np.gradient(signal2)\n        grad2 /= grad2.max()\n\n        phase1 = np.argmin(grad1)\n        phase2 = np.argmax(grad2) + min_index\n\n        return phase1, phase2\n    \n    def _objective_function(self, s, signal, phase1, phase2):\n        delta = self.cfg.MODEL_OPTIMIZATION_DELTA\n        power = self.cfg.MODEL_POLYNOMIAL_DEGREE\n\n        if phase1 - delta <= 0 or phase2 + delta >= len(signal) or phase2 - delta - (phase1 + delta) < 5:\n            delta = 2\n\n        y = np.concatenate([\n            signal[: phase1 - delta],\n            signal[phase1 + delta : phase2 - delta] * (1 + s),\n            signal[phase2 + delta :]\n        ])\n        x = np.arange(len(y))\n\n        coeffs = np.polyfit(x, y, deg=power)\n        poly = np.poly1d(coeffs)\n        error = np.abs(poly(x) - y).mean()\n        \n        return error\n\n    def predict(self, single_preprocessed_signal):\n        signal_1d = single_preprocessed_signal[:, 1:].mean(axis=1)\n        signal_1d = savgol_filter(signal_1d, 20, 2)\n        \n        phase1, phase2 = self._phase_detector(signal_1d)\n\n        phase1 = max(self.cfg.MODEL_OPTIMIZATION_DELTA, phase1)\n        phase2 = min(len(signal_1d) - self.cfg.MODEL_OPTIMIZATION_DELTA - 1, phase2)    \n\n        result = minimize(\n            fun=self._objective_function,\n            x0=[0.0001],\n            args=(signal_1d, phase1, phase2),\n            method=\"Nelder-Mead\"\n        )\n        \n        return result.x[0]\n\n    def predict_all(self, preprocessed_signals):\n        predictions = [\n            self.predict(preprocessed_signal)\n            for preprocessed_signal in tqdm(preprocessed_signals)\n        ]\n        return np.array(predictions) * self.cfg.SCALE","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:51.027081Z","iopub.execute_input":"2025-08-11T02:35:51.027378Z","iopub.status.idle":"2025-08-11T02:35:51.038016Z","shell.execute_reply.started":"2025-08-11T02:35:51.027351Z","shell.execute_reply":"2025-08-11T02:35:51.037146Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"config = Config()\nnon_ML_model = TransitModel(config)\n\nsignal = preprocessed_train_data[0]\nsignal_1d = signal.mean(axis =1)\n# signal_1d = savgol_filter(signal_1d, 30, 2)\n\nphase1, phase2 = non_ML_model._phase_detector(signal_1d)\nphase1 = max(config.MODEL_OPTIMIZATION_DELTA, phase1)\nphase2 = min(len(signal_1d) - config.MODEL_OPTIMIZATION_DELTA - 1, phase2)\n\ns = non_ML_model.predict(signal)\n\ndelta = config.MODEL_OPTIMIZATION_DELTA\nsignal_adjusted = np.concatenate([\n    signal_1d[: phase1 - delta],\n    signal_1d[phase1 + delta : phase2 - delta] * (1 + s),\n    # signal_1d[phase1 + delta : phase2 - delta] * 1/(1 - s),\n    signal_1d[phase2 + delta :]\n])\nx = np.arange(len(signal_adjusted))\n\npower = config.MODEL_POLYNOMIAL_DEGREE\ncoeffs = np.polyfit(x, signal_adjusted, deg=power)\npoly_pred = np.poly1d(coeffs)(x)\n\nplt.figure(figsize=(12, 5))\nplt.plot(signal_1d, label='signal', color='blue', alpha=0.7)\nplt.plot(x, poly_pred, label=f'polynomial_pred s={s:.5f}', color='green')\n\nplt.axvline(phase1, color='orange', linestyle='--', label='phase 1')\nplt.axvline(phase2, color='red', linestyle='--', label='phase 2')\n\nplt.title(f\"planet_id={df_train_labels.index[0]}\")\nplt.xlabel(\"time\")\nplt.ylabel(\"value\")\nplt.legend()\nplt.grid(True)\nplt.tight_layout()\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:51.038953Z","iopub.execute_input":"2025-08-11T02:35:51.039235Z","iopub.status.idle":"2025-08-11T02:35:51.336905Z","shell.execute_reply.started":"2025-08-11T02:35:51.039208Z","shell.execute_reply":"2025-08-11T02:35:51.335978Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Model prediction and Submission","metadata":{}},{"cell_type":"code","source":"class SubmissionGenerator:\n    def __init__(self, config):\n        self.cfg = config\n        self.sample_submission = pd.read_csv(f\"{self.cfg.DATA_PATH}/sample_submission.csv\", index_col=\"planet_id\")\n        \n\n    def create(self, predictions):\n        planet_ids = self.sample_submission.index\n        repeated_predictions = np.repeat(predictions, \n                                         self.sample_submission.shape[1] // 2).reshape(len(predictions), -1)\n        repeated_predictions = repeated_predictions.clip(0)\n        \n        sigmas = np.ones_like(repeated_predictions) * self.cfg.SIGMA\n\n        submission_df = pd.DataFrame(\n            np.concatenate([repeated_predictions, sigmas], axis=1),\n            columns=self.sample_submission.columns,\n            index=planet_ids\n        )\n        return submission_df","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:35:51.337771Z","iopub.execute_input":"2025-08-11T02:35:51.338047Z","iopub.status.idle":"2025-08-11T02:35:51.344319Z","shell.execute_reply.started":"2025-08-11T02:35:51.338026Z","shell.execute_reply":"2025-08-11T02:35:51.343503Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# y_pred_test = non_ML_model.predict(X_smoothed_test) \ny_pred_test = non_ML_model.predict_all(preprocessed_test_data) \ny_pred_test","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:36:47.051444Z","iopub.execute_input":"2025-08-11T02:36:47.051774Z","iopub.status.idle":"2025-08-11T02:36:47.079266Z","shell.execute_reply.started":"2025-08-11T02:36:47.051752Z","shell.execute_reply":"2025-08-11T02:36:47.078231Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"config = Config()\n\nsub_generator = SubmissionGenerator(config)\nsubmission_df = sub_generator.create(y_pred_test.astype(float))\n\nsubmission_df.to_csv(\"/kaggle/working/submission.csv\")\nsubmission_df","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:36:51.398567Z","iopub.execute_input":"2025-08-11T02:36:51.398966Z","iopub.status.idle":"2025-08-11T02:36:51.457468Z","shell.execute_reply.started":"2025-08-11T02:36:51.398937Z","shell.execute_reply":"2025-08-11T02:36:51.456334Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Calculate Gaussian Log-Likelihood (GLL) score in all train dataset","metadata":{}},{"cell_type":"code","source":"def calculate_gll_score(y_true, mu_pred, sigma_pred):\n    \"\"\"\n    Tính điểm Gaussian Log-Likelihood (GLL) tổng hợp bằng cách lặp qua từng mẫu.\n\n    Điểm GLL đánh giá cả độ chính xác của dự đoán và độ tin cậy của\n    ước tính độ không chắc chắn.\n\n    Args:\n        y_true (Union[np.ndarray, pd.DataFrame]): Phổ thực tế (Ground Truth) \n                                                có shape (số_mẫu, số_bước_sóng).\n        mu_pred (Union[np.ndarray, float]): Phổ dự đoán của mô hình.\n                                           Có thể là một giá trị đơn, một mảng 1D\n                                           (số_bước_sóng), một mảng 2D (số_mẫu, 1),\n                                           hoặc một mảng 2D (số_mẫu, số_bước_sóng).\n        sigma_pred (Union[np.ndarray, float]): Độ không chắc chắn dự đoán của mô hình.\n                                              Có thể là một giá trị đơn, một mảng 1D\n                                              (số_bước_sóng), một mảng 2D (số_mẫu, 1),\n                                              hoặc một mảng 2D (số_mẫu, số_bước_sóng).\n                                              Giá trị này phải lớn hơn 0.\n\n    Returns:\n        float: Điểm GLL tổng hợp.\n    \"\"\"\n\n    n_samples, n_wavelengths = y_true.shape\n    total_gll_score = 0.0\n\n    for i in tqdm(range(n_samples), desc=\"Calculating GLL Score\"):\n        y_true_sample = y_true[i, :]\n\n        if isinstance(mu_pred[i], (float, int)):\n            mu_pred_sample = np.full_like(y_true_sample, mu_pred[i])\n        elif mu_pred.ndim == 1:\n            if mu_pred[i].size != n_wavelengths:\n                 raise ValueError(\n                    f\"Kích thước của mu_pred 1D ({mu_pred.size}) không khớp \"\n                    f\"với số bước sóng của y_true ({n_wavelengths}).\"\n                )\n            mu_pred_sample = mu_pred\n        elif mu_pred.shape[1] == 1:\n            mu_pred_sample = np.full_like(y_true_sample, mu_pred[i, 0])\n        else:\n            mu_pred_sample = mu_pred[i, :]\n\n        if isinstance(sigma_pred, (float, int)):\n            sigma_pred_sample = np.full_like(y_true_sample, sigma_pred)\n        elif sigma_pred.ndim == 1:\n            if sigma_pred.size != n_wavelengths:\n                raise ValueError(\n                    f\"Kích thước của sigma_pred 1D ({sigma_pred.size}) không khớp \"\n                    f\"với số bước sóng của y_true ({n_wavelengths}).\"\n                )\n            sigma_pred_sample = sigma_pred\n        elif sigma_pred.shape[1] == 1:\n            sigma_pred_sample = np.full_like(y_true_sample, sigma_pred[i, 0])\n        else:\n            sigma_pred_sample = sigma_pred[i, :]\n\n        sigma_pred_sample[sigma_pred_sample <= 0] = 1e-6\n\n        gll = -0.5 * (\n            np.log(2 * np.pi) +\n            np.log(sigma_pred_sample**2) +\n            ((y_true_sample - mu_pred_sample)**2) / (sigma_pred_sample**2)\n        )\n        \n        total_gll_score += np.sum(gll)\n        \n    return total_gll_score/1100 # chuẩn hóa ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:36:54.797043Z","iopub.execute_input":"2025-08-11T02:36:54.798089Z","iopub.status.idle":"2025-08-11T02:36:54.809529Z","shell.execute_reply.started":"2025-08-11T02:36:54.798048Z","shell.execute_reply":"2025-08-11T02:36:54.80848Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# predictions_train = model.predict(X_smoothed_train)\npredictions_train = non_ML_model.predict_all(preprocessed_train_data)\npredictions_train.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:37:35.155991Z","iopub.execute_input":"2025-08-11T02:37:35.156477Z","iopub.status.idle":"2025-08-11T02:37:45.082639Z","shell.execute_reply.started":"2025-08-11T02:37:35.156443Z","shell.execute_reply":"2025-08-11T02:37:45.081582Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"total_gll_score_train = calculate_gll_score(df_train_labels.values,\n                                            predictions_train.astype(float),\n                                            0.0009)\ntotal_gll_score_train","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-08-11T02:37:50.602865Z","iopub.execute_input":"2025-08-11T02:37:50.603309Z","iopub.status.idle":"2025-08-11T02:37:50.651787Z","shell.execute_reply.started":"2025-08-11T02:37:50.603276Z","shell.execute_reply":"2025-08-11T02:37:50.650828Z"}},"outputs":[],"execution_count":null}]}