{"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":103436,"databundleVersionId":12476472,"sourceType":"competition"},{"sourceId":12174163,"sourceType":"datasetVersion","datasetId":7667427}],"dockerImageVersionId":31040,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom imblearn.under_sampling import RandomUnderSampler\nfrom sklearn.model_selection import train_test_split\nfrom category_encoders import TargetEncoder\nfrom sklearn.model_selection import RandomizedSearchCV, GridSearchCV\nfrom sklearn.metrics import roc_auc_score\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import precision_score, recall_score\nfrom sklearn.metrics import precision_recall_curve\nfrom sklearn.metrics import classification_report\nfrom sklearn.metrics import average_precision_score, precision_score, recall_score, f1_score\nfrom sklearn.svm import SVC\nimport category_encoders as ce\nimport optuna\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.model_selection import cross_val_score, StratifiedKFold, cross_validate\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.preprocessing import OrdinalEncoder\nfrom sklearn.ensemble import RandomForestClassifier\nimport lightgbm as lgb\nfrom catboost import CatBoostClassifier, Pool, cv\n\nfrom sklearn.inspection import permutation_importance\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom tqdm import tqdm\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:52:40.614553Z","iopub.execute_input":"2025-06-17T09:52:40.614882Z","iopub.status.idle":"2025-06-17T09:52:45.717484Z","shell.execute_reply.started":"2025-06-17T09:52:40.614852Z","shell.execute_reply":"2025-06-17T09:52:45.716964Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!pip install imbalanced-learn==0.11.0\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:52:08.623840Z","iopub.execute_input":"2025-06-17T09:52:08.624502Z","iopub.status.idle":"2025-06-17T09:52:13.094913Z","shell.execute_reply.started":"2025-06-17T09:52:08.624479Z","shell.execute_reply":"2025-06-17T09:52:13.094172Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df79 = pd.read_parquet('/kaggle/input/dataset/data_7_9_silver.parquet')\ndf79.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:53:23.271668Z","iopub.execute_input":"2025-06-17T09:53:23.272817Z","iopub.status.idle":"2025-06-17T09:53:26.479303Z","shell.execute_reply.started":"2025-06-17T09:53:23.272761Z","shell.execute_reply":"2025-06-17T09:53:26.478687Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# tạo thêm 2 thuộc tính mới lấy ngày và thứ của VSD\n# Tạo ngày trong tháng từ VSD\ndf79['SO_DAY_OF_MONTH_VSD'] = df79['VSD'].dt.day\n\n# Tạo thứ trong tuần (Monday=1, ..., Saturday=6, Sunday=7)\ndf79['SO_DAY_OF_WEEK_VSD'] = df79['VSD'].dt.weekday + 1","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:54:22.154566Z","iopub.execute_input":"2025-06-17T09:54:22.154870Z","iopub.status.idle":"2025-06-17T09:54:22.246451Z","shell.execute_reply.started":"2025-06-17T09:54:22.154848Z","shell.execute_reply":"2025-06-17T09:54:22.245737Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df79['SUPPLIER_DIV'] = df79['SUPPLIER_DIV'].astype('Int64')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:54:26.375023Z","iopub.execute_input":"2025-06-17T09:54:26.375311Z","iopub.status.idle":"2025-06-17T09:54:26.526660Z","shell.execute_reply.started":"2025-06-17T09:54:26.375290Z","shell.execute_reply":"2025-06-17T09:54:26.526139Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"columns_79 = df79.columns\ncols_to_drop = ['Order date', 'SUBSIDIARY_CD', 'GLOBAL_NO', 'SO_TIME', 'VSD'] # loại bỏ các cột không cần tính IV\ncolumns_79 = list(columns_79)\ncolumns_79 = [col for col in columns_79 if col not in cols_to_drop]\nprint(columns_79)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:54:28.457155Z","iopub.execute_input":"2025-06-17T09:54:28.457419Z","iopub.status.idle":"2025-06-17T09:54:28.462279Z","shell.execute_reply.started":"2025-06-17T09:54:28.457399Z","shell.execute_reply":"2025-06-17T09:54:28.461056Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df79['OTHER AREA SHIP DIV'] = df79['OTHER AREA SHIP DIV'].fillna('0')\ndf79['OTHER AREA SHIP DIV'] = df79['OTHER AREA SHIP DIV'].astype('int')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:54:35.914551Z","iopub.execute_input":"2025-06-17T09:54:35.915225Z","iopub.status.idle":"2025-06-17T09:54:36.074242Z","shell.execute_reply.started":"2025-06-17T09:54:35.915203Z","shell.execute_reply":"2025-06-17T09:54:36.073671Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"categorical_columns = ['CLASSIFY_CD', 'CUST_CD', 'BRAND_CD', 'INNER_CD', 'SUPPLIER_CD', 'Stock class', 'Consider count hodiday Saturday', 'PACKING RANK', 'PRODUCT_CD', 'PRODUCT ATTRIBUTION', 'SPECIAL DIV', 'LOGICAL PLANT', 'DIRECT SHIP FLG', 'DELI_DIV', 'Ship Mode', 'SHIP DECISION NO', 'SUPPLIER_DIV', 'SPECIAL_DIV', 'SO_DAY_OF_MONTH', 'SO_DAY_OF_WEEK', 'REASON_CD', 'SOUF_RCV_NO', 'QTUF_RCV_NO', 'SO_DAY_OF_MONTH_VSD', 'SO_DAY_OF_WEEK_VSD']\ncontinuous_columns = ['Sales order line number', 'SO QTY', 'OTHER AREA SHIP DIV', 'ALLOCATION QTY', 'SUPPLIER INV AMOUNT', 'PURCHASE AMOUNT', 'PACK QTY', 'WEIGHT PER PIECE',  ]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:54:49.731074Z","iopub.execute_input":"2025-06-17T09:54:49.731320Z","iopub.status.idle":"2025-06-17T09:54:49.735503Z","shell.execute_reply.started":"2025-06-17T09:54:49.731305Z","shell.execute_reply":"2025-06-17T09:54:49.734706Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"features_gr2 = ['DELI_DIV', 'DIRECT SHIP FLG', 'SUPPLIER INV AMOUNT', 'WEIGHT PER PIECE', 'PRODUCT_CD', 'CUST_CD', 'SUPPLIER_CD', 'SO QTY', 'OTHER AREA SHIP DIV', 'CLASSIFY_CD', 'INNER_CD', 'Consider count hodiday Saturday', 'PACKING RANK', 'PRODUCT ATTRIBUTION', 'Ship Mode']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:22:23.622263Z","iopub.execute_input":"2025-06-17T15:22:23.622532Z","iopub.status.idle":"2025-06-17T15:22:23.626234Z","shell.execute_reply.started":"2025-06-17T15:22:23.622514Z","shell.execute_reply":"2025-06-17T15:22:23.625695Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"categorical_cols = ['CUST_CD', 'DIRECT SHIP FLG', 'DELI_DIV', 'PRODUCT_CD', 'SUPPLIER_CD', 'CLASSIFY_CD','INNER_CD', 'Consider count hodiday Saturday', 'PACKING RANK', 'PRODUCT ATTRIBUTION', 'Ship Mode']  # các cột dạng category","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:22:33.948976Z","iopub.execute_input":"2025-06-17T15:22:33.949475Z","iopub.status.idle":"2025-06-17T15:22:33.953143Z","shell.execute_reply.started":"2025-06-17T15:22:33.949455Z","shell.execute_reply":"2025-06-17T15:22:33.952474Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df79[features_gr2].isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:22:37.652346Z","iopub.execute_input":"2025-06-17T15:22:37.652615Z","iopub.status.idle":"2025-06-17T15:22:38.087650Z","shell.execute_reply.started":"2025-06-17T15:22:37.652595Z","shell.execute_reply":"2025-06-17T15:22:38.087054Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X = df79[features_gr2].copy()\nY = df79['label'].copy()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:22:50.928278Z","iopub.execute_input":"2025-06-17T15:22:50.928572Z","iopub.status.idle":"2025-06-17T15:22:51.230456Z","shell.execute_reply.started":"2025-06-17T15:22:50.928552Z","shell.execute_reply":"2025-06-17T15:22:51.229929Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# undersampling\nrus = RandomUnderSampler(sampling_strategy={0: 10 * sum(Y == 1), 1: sum(Y == 1)}, random_state=42) # (1:5)\nX_resampled, Y_resampled = rus.fit_resample(X, Y)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:22:55.530357Z","iopub.execute_input":"2025-06-17T15:22:55.530858Z","iopub.status.idle":"2025-06-17T15:22:56.115197Z","shell.execute_reply.started":"2025-06-17T15:22:55.530836Z","shell.execute_reply":"2025-06-17T15:22:56.114408Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"\n# Chuyển về dạng category để các model tree based có xử lý categorical feature mà không cần encoding có thể dùng\nX_resampled[categorical_cols] = X_resampled[categorical_cols].astype('category')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:22:59.128488Z","iopub.execute_input":"2025-06-17T15:22:59.129225Z","iopub.status.idle":"2025-06-17T15:22:59.778565Z","shell.execute_reply.started":"2025-06-17T15:22:59.129198Z","shell.execute_reply":"2025-06-17T15:22:59.777827Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"N_TRIALS = 30  # Số lượng trials bạn muốn chạy\n\n# Thanh tiến trình tqdm\nprogress_bar = tqdm(total=N_TRIALS, desc=\"Tuning LightGBM\")\n\ndef objective_lightgmb(trial):\n    param = {\n        'objective': 'binary',\n        'metric': 'None',  # Để tránh mâu thuẫn với f1_macro bên ngoài\n        'verbosity': -1,\n        'boosting_type': 'gbdt',\n        'device': 'cpu',  # CHẠY BẰNG CPU\n        'max_depth': trial.suggest_int('max_depth', 10, 20),\n        'num_leaves': trial.suggest_int('num_leaves', 64, 512),\n        'learning_rate': trial.suggest_float('learning_rate', 0.005, 0.1, log=True),\n        'n_estimators': trial.suggest_int('n_estimators', 300, 1000),\n        'min_child_samples': trial.suggest_int('min_child_samples', 1, 20),\n        'subsample': trial.suggest_float('subsample', 0.8, 1.0),\n        'colsample_bytree': trial.suggest_float('colsample_bytree', 0.8, 1.0),\n        'reg_alpha': trial.suggest_float('reg_alpha', 0.0, 0.1),\n        'reg_lambda': trial.suggest_float('reg_lambda', 0.0, 0.1),\n        'max_bin': trial.suggest_int('max_bin', 255, 1024),  # thêm max_bin (dùng tốt với CPU)\n    }\n\n    model_lightgbm = lgb.LGBMClassifier(**param)\n\n    cv = StratifiedKFold(n_splits=3, shuffle=True, random_state=42)\n    scores = cross_val_score(\n        model_lightgbm,\n        X_resampled,\n        Y_resampled,\n        scoring='f1_macro',\n        cv=cv,\n        n_jobs=-1\n    )\n\n    progress_bar.update(1)  # Cập nhật tiến trình\n\n    return np.mean(scores)\n\n# Tạo Optuna study\nstudy = optuna.create_study(direction='maximize')\nstudy.optimize(objective_lightgmb, n_trials=N_TRIALS)\n\n# Kết thúc thanh tiến trình\nprogress_bar.close()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:23:04.659443Z","iopub.execute_input":"2025-06-17T15:23:04.660132Z","iopub.status.idle":"2025-06-17T16:30:06.430468Z","shell.execute_reply.started":"2025-06-17T15:23:04.660108Z","shell.execute_reply":"2025-06-17T16:30:06.429877Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"best_params = study.best_trial.params\nprint(\"Best parameters:\", best_params)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:30:25.823026Z","iopub.execute_input":"2025-06-17T16:30:25.823281Z","iopub.status.idle":"2025-06-17T16:30:25.827658Z","shell.execute_reply.started":"2025-06-17T16:30:25.823263Z","shell.execute_reply":"2025-06-17T16:30:25.826907Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Cập nhật tham số\nbest_params.update({\n    'device': 'cpu',\n    'random_state': 42,\n    'objective': 'binary',\n    'metric': 'auc',\n    'verbosity': -1,\n    'boosting_type': 'gbdt',\n})\n\n# Train lại mô hình với toàn bộ dữ liệu đã resample\nfinal_model_2_2 = lgb.LGBMClassifier(**best_params)\nfinal_model_2_2.fit(X_resampled, Y_resampled)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:30:30.368889Z","iopub.execute_input":"2025-06-17T16:30:30.369336Z","iopub.status.idle":"2025-06-17T16:31:44.727533Z","shell.execute_reply.started":"2025-06-17T16:30:30.369313Z","shell.execute_reply":"2025-06-17T16:31:44.726821Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# preprocessing input feature from pilot_10","metadata":{}},{"cell_type":"code","source":"df10 = pd.read_csv('/kaggle/input/dataset/PILOT_10.csv')\ndf10.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:01.074220Z","iopub.execute_input":"2025-06-17T16:32:01.074918Z","iopub.status.idle":"2025-06-17T16:32:01.581126Z","shell.execute_reply.started":"2025-06-17T16:32:01.074893Z","shell.execute_reply":"2025-06-17T16:32:01.580504Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Kiểu ngày\ndf10['Order date'] = pd.to_datetime(df10['Order date']) # Đã biết theo format deffault là YYYY-MN-DD => áp hàm chuyển kiểu luôn.\ndf10['VSD'] = pd.to_datetime(df10['VSD'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:04.730675Z","iopub.execute_input":"2025-06-17T16:32:04.731493Z","iopub.status.idle":"2025-06-17T16:32:04.763042Z","shell.execute_reply.started":"2025-06-17T16:32:04.731471Z","shell.execute_reply":"2025-06-17T16:32:04.762495Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df10.dtypes","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:07.391442Z","iopub.execute_input":"2025-06-17T16:32:07.391698Z","iopub.status.idle":"2025-06-17T16:32:07.398069Z","shell.execute_reply.started":"2025-06-17T16:32:07.391681Z","shell.execute_reply":"2025-06-17T16:32:07.397403Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# features có số giá trị rỗng > 0\nblank_counts = df10.apply(lambda col: (col == ' ').sum() if col.dtype == 'object' else 0)\nblank_counts = blank_counts[blank_counts > 0]  # chỉ giữ lại những cột có > 0 giá trị rỗng\nprint(blank_counts)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:09.681506Z","iopub.execute_input":"2025-06-17T16:32:09.681742Z","iopub.status.idle":"2025-06-17T16:32:09.764358Z","shell.execute_reply.started":"2025-06-17T16:32:09.681727Z","shell.execute_reply":"2025-06-17T16:32:09.763761Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"(df10 == '').sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:18:07.544829Z","iopub.execute_input":"2025-06-17T15:18:07.545477Z","iopub.status.idle":"2025-06-17T15:18:07.627919Z","shell.execute_reply.started":"2025-06-17T15:18:07.545456Z","shell.execute_reply":"2025-06-17T15:18:07.627326Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# tạo thêm 2 thuộc tính mới lấy ngày và thứ của VSD\n# Tạo ngày trong tháng từ VSD\ndf10['SO_DAY_OF_MONTH_VSD'] = df10['VSD'].dt.day\n\n# Tạo thứ trong tuần (Monday=1, ..., Saturday=6, Sunday=7)\ndf10['SO_DAY_OF_WEEK_VSD'] = df10['VSD'].dt.weekday + 1","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:12.536294Z","iopub.execute_input":"2025-06-17T16:32:12.536566Z","iopub.status.idle":"2025-06-17T16:32:12.551378Z","shell.execute_reply.started":"2025-06-17T16:32:12.536546Z","shell.execute_reply":"2025-06-17T16:32:12.550525Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df10['SUPPLIER_DIV'] = df10['SUPPLIER_DIV'].astype('Int64')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:14.490741Z","iopub.execute_input":"2025-06-17T16:32:14.491347Z","iopub.status.idle":"2025-06-17T16:32:14.511803Z","shell.execute_reply.started":"2025-06-17T16:32:14.491323Z","shell.execute_reply":"2025-06-17T16:32:14.511175Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"features_gr2","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:18:14.181405Z","iopub.execute_input":"2025-06-17T15:18:14.182080Z","iopub.status.idle":"2025-06-17T15:18:14.186453Z","shell.execute_reply.started":"2025-06-17T15:18:14.182058Z","shell.execute_reply":"2025-06-17T15:18:14.185900Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df10[features_gr2].isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:17.216610Z","iopub.execute_input":"2025-06-17T16:32:17.216990Z","iopub.status.idle":"2025-06-17T16:32:17.267124Z","shell.execute_reply.started":"2025-06-17T16:32:17.216969Z","shell.execute_reply":"2025-06-17T16:32:17.266474Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df10[features_gr2].dtypes","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:19.589845Z","iopub.execute_input":"2025-06-17T16:32:19.590397Z","iopub.status.idle":"2025-06-17T16:32:19.604711Z","shell.execute_reply.started":"2025-06-17T16:32:19.590377Z","shell.execute_reply":"2025-06-17T16:32:19.604144Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_10 = df10[features_gr2]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:21.974620Z","iopub.execute_input":"2025-06-17T16:32:21.974961Z","iopub.status.idle":"2025-06-17T16:32:21.985083Z","shell.execute_reply.started":"2025-06-17T16:32:21.974940Z","shell.execute_reply":"2025-06-17T16:32:21.984401Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_10[categorical_cols] = X_10[categorical_cols].astype('category')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:32:24.679056Z","iopub.execute_input":"2025-06-17T16:32:24.679757Z","iopub.status.idle":"2025-06-17T16:32:24.920485Z","shell.execute_reply.started":"2025-06-17T16:32:24.679724Z","shell.execute_reply":"2025-06-17T16:32:24.919959Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_10","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T15:18:31.754707Z","iopub.execute_input":"2025-06-17T15:18:31.755180Z","iopub.status.idle":"2025-06-17T15:18:31.771166Z","shell.execute_reply.started":"2025-06-17T15:18:31.755157Z","shell.execute_reply":"2025-06-17T15:18:31.770541Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Dự đoán trên X_10\ny_pred_10_2_2 = final_model_2_2.predict(X_10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:45:09.880247Z","iopub.execute_input":"2025-06-17T16:45:09.880847Z","iopub.status.idle":"2025-06-17T16:45:35.304652Z","shell.execute_reply.started":"2025-06-17T16:45:09.880826Z","shell.execute_reply":"2025-06-17T16:45:35.303848Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Tạo DataFrame kết quả\ndf_result_2_2 = pd.DataFrame({\n    'ID': df10['ID'].values,\n    'label': y_pred_10_2_2\n})\ndf_result_2_2.to_csv(\"df_results_2_lan6.csv\", index=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T16:45:44.805463Z","iopub.execute_input":"2025-06-17T16:45:44.805950Z","iopub.status.idle":"2025-06-17T16:45:44.888180Z","shell.execute_reply.started":"2025-06-17T16:45:44.805918Z","shell.execute_reply":"2025-06-17T16:45:44.887638Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"---","metadata":{}},{"cell_type":"code","source":"pip install -U optuna","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-06-17T09:52:31.554856Z","iopub.execute_input":"2025-06-17T09:52:31.555607Z","iopub.status.idle":"2025-06-17T09:52:35.446996Z","shell.execute_reply.started":"2025-06-17T09:52:31.555577Z","shell.execute_reply":"2025-06-17T09:52:35.446116Z"}},"outputs":[],"execution_count":null}]}