{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.11","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":10384,"databundleVersionId":120379,"sourceType":"competition"},{"sourceId":390298,"sourceType":"modelInstanceVersion","isSourceIdPinned":true,"modelInstanceId":321473,"modelId":342076}],"dockerImageVersionId":31041,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:44:21.582338Z","iopub.execute_input":"2025-05-13T17:44:21.582559Z","iopub.status.idle":"2025-05-13T17:44:21.888052Z","shell.execute_reply.started":"2025-05-13T17:44:21.582541Z","shell.execute_reply":"2025-05-13T17:44:21.887392Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!pip install deep-lightcurve lightkurve --quiet\n","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import torch\nmodel_dict = torch.load(\n    \"/kaggle/input/combined_17_conformal.ckpt/other/default/1/combined_17_conformal_calibrated.ckpt\",\n    map_location=\"cuda\",\n    weights_only=False  # ← important!\n)\n\nimport deep_lc as dl\ndl_combined = dl.DeepLC(\n    combined_model=model_dict,\n    conformal_calibration=True,\n    device=\"cuda\"\n)\n","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"raw","source":"startung from here","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"pip install deep-lightcurve -U","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:44:46.486511Z","iopub.execute_input":"2025-05-13T17:44:46.486804Z","iopub.status.idle":"2025-05-13T17:46:41.653434Z","shell.execute_reply.started":"2025-05-13T17:44:46.486780Z","shell.execute_reply":"2025-05-13T17:46:41.652352Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pip install lightkurve lightkurve-ext\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:46:56.052188Z","iopub.execute_input":"2025-05-13T17:46:56.053500Z","iopub.status.idle":"2025-05-13T17:47:01.859597Z","shell.execute_reply.started":"2025-05-13T17:46:56.053447Z","shell.execute_reply":"2025-05-13T17:47:01.858660Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!pip install numpy matplotlib torch\n\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:47:04.549720Z","iopub.execute_input":"2025-05-13T17:47:04.550041Z","iopub.status.idle":"2025-05-13T17:47:08.050089Z","shell.execute_reply.started":"2025-05-13T17:47:04.550015Z","shell.execute_reply":"2025-05-13T17:47:08.049322Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"%reload_ext autoreload\n%autoreload 2","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import numpy as np\nimport deep_lc as dl\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:47:13.318539Z","iopub.execute_input":"2025-05-13T17:47:13.319259Z","iopub.status.idle":"2025-05-13T17:47:25.796895Z","shell.execute_reply.started":"2025-05-13T17:47:13.319218Z","shell.execute_reply":"2025-05-13T17:47:25.796268Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import torch\nmodel_dict = torch.load(\n    \"/kaggle/input/combined_17_conformal.ckpt/other/default/1/combined_17_conformal_calibrated.ckpt\",\n    map_location=\"cuda\",\n    weights_only=False  # ← important!\n)\n\nimport deep_lc as dl\ndl_combined = dl.DeepLC(\n    combined_model=model_dict,\n    conformal_calibration=True,\n    device=\"cuda\"\n)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:47:30.912611Z","iopub.execute_input":"2025-05-13T17:47:30.913043Z","iopub.status.idle":"2025-05-13T17:47:34.575343Z","shell.execute_reply.started":"2025-05-13T17:47:30.913021Z","shell.execute_reply":"2025-05-13T17:47:34.574442Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import lightkurve as lk\nimport lightkurve_ext as lkx  # This is part of their package\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:47:37.022512Z","iopub.execute_input":"2025-05-13T17:47:37.023291Z","iopub.status.idle":"2025-05-13T17:47:39.918102Z","shell.execute_reply.started":"2025-05-13T17:47:37.023266Z","shell.execute_reply":"2025-05-13T17:47:39.917226Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"lc_data_list = lk.search_lightcurve(\n    \"TIC 470109695\", mission=\"TESS\", exptime=\"short\", author=\"SPOC\"\n).download_all()\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:47:41.781476Z","iopub.execute_input":"2025-05-13T17:47:41.782541Z","iopub.status.idle":"2025-05-13T17:47:44.836585Z","shell.execute_reply.started":"2025-05-13T17:47:41.782502Z","shell.execute_reply":"2025-05-13T17:47:44.835685Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"lc_data = lkx.LightCurveCollection(lc_data_list).stitch()\nlc = dl.light_curve_preparation(time=lc_data.time.value, flux=lc_data.flux)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:47:48.995850Z","iopub.execute_input":"2025-05-13T17:47:48.996632Z","iopub.status.idle":"2025-05-13T17:47:49.116055Z","shell.execute_reply.started":"2025-05-13T17:47:48.996606Z","shell.execute_reply":"2025-05-13T17:47:49.115373Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pred, figs = dl_combined.predict(\n    lc,\n    show_intermediate_results=True,\n    return_conformal_predictive_sets=True\n)\nprint(\"Prediction:\", pred)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T15:45:49.601671Z","iopub.execute_input":"2025-05-13T15:45:49.602286Z","iopub.status.idle":"2025-05-13T15:45:55.974576Z","shell.execute_reply.started":"2025-05-13T15:45:49.602263Z","shell.execute_reply":"2025-05-13T15:45:55.973829Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pred = dl_combined.predict(\n    lc,\n    show_intermediate_results=False,\n    return_conformal_predictive_sets=False\n)\nprint(\"Prediction:\", pred)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-05-13T17:50:36.391609Z","iopub.execute_input":"2025-05-13T17:50:36.392388Z","iopub.status.idle":"2025-05-13T17:50:40.620692Z","shell.execute_reply.started":"2025-05-13T17:50:36.392353Z","shell.execute_reply":"2025-05-13T17:50:40.619821Z"}},"outputs":[],"execution_count":null}]}