checkpoint
Browse files- Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_daegu.py +97 -0
- Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_daejeon.py +97 -0
- Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_gwangju.py +97 -0
- Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_incheon.py +97 -0
- Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_seoul.py +97 -0
- Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_daegu.py +96 -0
- Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_daejeon.py +96 -0
- Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_gwangju.py +96 -0
- Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_incheon.py +96 -0
- Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_seoul.py +96 -0
- Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_daegu.py +317 -0
- Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_daejeon.py +317 -0
- Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_gwangju.py +317 -0
- Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_incheon.py +317 -0
- Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_seoul.py +317 -0
- Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_daegu.py +97 -0
- Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_daejeon.py +97 -0
- Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_gwangju.py +97 -0
- Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_incheon.py +97 -0
- Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_seoul.py +97 -0
- Analysis_code/5.optima/run_bash/deepgbm/deepgbm_ctgan10000 +0 -0
- Analysis_code/5.optima/run_bash/deepgbm/deepgbm_ctgan10000.log +0 -0
- Analysis_code/5.optima/run_bash/deepgbm/run_deepgbm_ctgan10000.sh +5 -0
- Analysis_code/5.optima/run_bash/ft_transformer/ft_transformer_ctgan10000 +0 -0
- Analysis_code/5.optima/run_bash/ft_transformer/ft_transformer_ctgan10000.log +0 -0
- Analysis_code/5.optima/run_bash/ft_transformer/run_ft_transformer_ctgan10000.sh +5 -0
- Analysis_code/5.optima/run_bash/lgb/lgb_ctgan10000.log +219 -156
- Analysis_code/5.optima/run_bash/lgb/run_lgb_ctgan10000.sh +1 -1
- Analysis_code/5.optima/run_bash/resnet_like/resnet_like_ctgan10000 +0 -0
- Analysis_code/5.optima/run_bash/resnet_like/resnet_like_ctgan10000.log +0 -0
- Analysis_code/5.optima/run_bash/resnet_like/run_resnet_like_ctgan10000.sh +5 -0
- Analysis_code/5.optima/run_bash/xgb/xgb_ctgan10000.log +219 -156
- Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_daegu.py +305 -0
- Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_daejeon.py +305 -0
- Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_gwangju.py +305 -0
- Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_incheon.py +305 -0
- Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_seoul.py +305 -0
- Analysis_code/6.optima_models_analysis/analysis_for_.ipynb +0 -0
- Analysis_code/6.optima_models_analysis/best_samples_best_datasample_per_model_per_region.csv +31 -0
- Analysis_code/6.optima_models_analysis/extract_result.ipynb +0 -690
- Analysis_code/6.optima_models_analysis/extract_result_from_omptimized_models.ipynb +0 -0
- Analysis_code/6.optima_models_analysis/optimization_result.csv +121 -0
- Analysis_code/6.optima_models_analysis/utils.py +1077 -0
- Analysis_code/find_reason/wasserstein_distance.ipynb +46 -35
Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_daegu.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="deepgbm", region="daegu", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/deepgbm_ctgan10000_daegu_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="deepgbm",
|
| 79 |
+
region="daegu",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_daejeon.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="deepgbm", region="daejeon", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/deepgbm_ctgan10000_daejeon_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="deepgbm",
|
| 79 |
+
region="daejeon",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_gwangju.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="deepgbm", region="gwangju", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/deepgbm_ctgan10000_gwangju_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="deepgbm",
|
| 79 |
+
region="gwangju",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_incheon.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="deepgbm", region="incheon", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/deepgbm_ctgan10000_incheon_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="deepgbm",
|
| 79 |
+
region="incheon",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/deepgbm_ctgan10000/deepgbm_ctgan10000_seoul.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="deepgbm", region="seoul", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/deepgbm_ctgan10000_seoul_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="deepgbm",
|
| 79 |
+
region="seoul",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_daegu.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 16 |
+
def print_trial_callback(study, trial):
|
| 17 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 18 |
+
print(f"\n{'='*80}")
|
| 19 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 20 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 21 |
+
print(f" Parameters: {trial.params}")
|
| 22 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 23 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 24 |
+
print(f" Best Parameters: {study.best_params}")
|
| 25 |
+
print(f"{'='*80}\n")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 29 |
+
study = optuna.create_study(
|
| 30 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 31 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="ft_transformer", region="daegu", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100,
|
| 38 |
+
callbacks=[print_trial_callback]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 42 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 43 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 44 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 48 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 49 |
+
|
| 50 |
+
if len(csi_scores) > 0:
|
| 51 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 52 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 53 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 54 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 55 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 56 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 57 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 58 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 59 |
+
|
| 60 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 61 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 62 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 63 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 64 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 65 |
+
study_path = os.path.join(base_dir, "optimization_history/ft_transformer_ctgan10000_daegu_trials.pkl")
|
| 66 |
+
joblib.dump(study, study_path)
|
| 67 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 68 |
+
|
| 69 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 70 |
+
print("\n" + "="*50)
|
| 71 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 72 |
+
print("="*50)
|
| 73 |
+
|
| 74 |
+
best_params = study.best_params
|
| 75 |
+
model_path = train_final_model(
|
| 76 |
+
best_params=best_params,
|
| 77 |
+
model_choose="ft_transformer",
|
| 78 |
+
region="daegu",
|
| 79 |
+
data_sample='ctgan10000',
|
| 80 |
+
target='multi',
|
| 81 |
+
n_folds=3,
|
| 82 |
+
random_state=seed
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 86 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 87 |
+
|
| 88 |
+
except Exception as e:
|
| 89 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 90 |
+
import traceback
|
| 91 |
+
traceback.print_exc()
|
| 92 |
+
|
| 93 |
+
# ์ ์ ์ข
๋ฃ
|
| 94 |
+
import sys
|
| 95 |
+
sys.exit(0)
|
| 96 |
+
|
Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_daejeon.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 16 |
+
def print_trial_callback(study, trial):
|
| 17 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 18 |
+
print(f"\n{'='*80}")
|
| 19 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 20 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 21 |
+
print(f" Parameters: {trial.params}")
|
| 22 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 23 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 24 |
+
print(f" Best Parameters: {study.best_params}")
|
| 25 |
+
print(f"{'='*80}\n")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 29 |
+
study = optuna.create_study(
|
| 30 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 31 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="ft_transformer", region="daejeon", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100,
|
| 38 |
+
callbacks=[print_trial_callback]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 42 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 43 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 44 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 48 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 49 |
+
|
| 50 |
+
if len(csi_scores) > 0:
|
| 51 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 52 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 53 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 54 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 55 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 56 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 57 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 58 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 59 |
+
|
| 60 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 61 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 62 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 63 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 64 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 65 |
+
study_path = os.path.join(base_dir, "optimization_history/ft_transformer_ctgan10000_daejeon_trials.pkl")
|
| 66 |
+
joblib.dump(study, study_path)
|
| 67 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 68 |
+
|
| 69 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 70 |
+
print("\n" + "="*50)
|
| 71 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 72 |
+
print("="*50)
|
| 73 |
+
|
| 74 |
+
best_params = study.best_params
|
| 75 |
+
model_path = train_final_model(
|
| 76 |
+
best_params=best_params,
|
| 77 |
+
model_choose="ft_transformer",
|
| 78 |
+
region="daejeon",
|
| 79 |
+
data_sample='ctgan10000',
|
| 80 |
+
target='multi',
|
| 81 |
+
n_folds=3,
|
| 82 |
+
random_state=seed
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 86 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 87 |
+
|
| 88 |
+
except Exception as e:
|
| 89 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 90 |
+
import traceback
|
| 91 |
+
traceback.print_exc()
|
| 92 |
+
|
| 93 |
+
# ์ ์ ์ข
๋ฃ
|
| 94 |
+
import sys
|
| 95 |
+
sys.exit(0)
|
| 96 |
+
|
Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_gwangju.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 16 |
+
def print_trial_callback(study, trial):
|
| 17 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 18 |
+
print(f"\n{'='*80}")
|
| 19 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 20 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 21 |
+
print(f" Parameters: {trial.params}")
|
| 22 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 23 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 24 |
+
print(f" Best Parameters: {study.best_params}")
|
| 25 |
+
print(f"{'='*80}\n")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 29 |
+
study = optuna.create_study(
|
| 30 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 31 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="ft_transformer", region="gwangju", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100,
|
| 38 |
+
callbacks=[print_trial_callback]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 42 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 43 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 44 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 48 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 49 |
+
|
| 50 |
+
if len(csi_scores) > 0:
|
| 51 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 52 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 53 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 54 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 55 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 56 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 57 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 58 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 59 |
+
|
| 60 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 61 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 62 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 63 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 64 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 65 |
+
study_path = os.path.join(base_dir, "optimization_history/ft_transformer_ctgan10000_gwangju_trials.pkl")
|
| 66 |
+
joblib.dump(study, study_path)
|
| 67 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 68 |
+
|
| 69 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 70 |
+
print("\n" + "="*50)
|
| 71 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 72 |
+
print("="*50)
|
| 73 |
+
|
| 74 |
+
best_params = study.best_params
|
| 75 |
+
model_path = train_final_model(
|
| 76 |
+
best_params=best_params,
|
| 77 |
+
model_choose="ft_transformer",
|
| 78 |
+
region="gwangju",
|
| 79 |
+
data_sample='ctgan10000',
|
| 80 |
+
target='multi',
|
| 81 |
+
n_folds=3,
|
| 82 |
+
random_state=seed
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 86 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 87 |
+
|
| 88 |
+
except Exception as e:
|
| 89 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 90 |
+
import traceback
|
| 91 |
+
traceback.print_exc()
|
| 92 |
+
|
| 93 |
+
# ์ ์ ์ข
๋ฃ
|
| 94 |
+
import sys
|
| 95 |
+
sys.exit(0)
|
| 96 |
+
|
Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_incheon.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 16 |
+
def print_trial_callback(study, trial):
|
| 17 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 18 |
+
print(f"\n{'='*80}")
|
| 19 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 20 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 21 |
+
print(f" Parameters: {trial.params}")
|
| 22 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 23 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 24 |
+
print(f" Best Parameters: {study.best_params}")
|
| 25 |
+
print(f"{'='*80}\n")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 29 |
+
study = optuna.create_study(
|
| 30 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 31 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="ft_transformer", region="incheon", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100,
|
| 38 |
+
callbacks=[print_trial_callback]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 42 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 43 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 44 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 48 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 49 |
+
|
| 50 |
+
if len(csi_scores) > 0:
|
| 51 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 52 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 53 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 54 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 55 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 56 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 57 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 58 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 59 |
+
|
| 60 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 61 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 62 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 63 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 64 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 65 |
+
study_path = os.path.join(base_dir, "optimization_history/ft_transformer_ctgan10000_incheon_trials.pkl")
|
| 66 |
+
joblib.dump(study, study_path)
|
| 67 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 68 |
+
|
| 69 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 70 |
+
print("\n" + "="*50)
|
| 71 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 72 |
+
print("="*50)
|
| 73 |
+
|
| 74 |
+
best_params = study.best_params
|
| 75 |
+
model_path = train_final_model(
|
| 76 |
+
best_params=best_params,
|
| 77 |
+
model_choose="ft_transformer",
|
| 78 |
+
region="incheon",
|
| 79 |
+
data_sample='ctgan10000',
|
| 80 |
+
target='multi',
|
| 81 |
+
n_folds=3,
|
| 82 |
+
random_state=seed
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 86 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 87 |
+
|
| 88 |
+
except Exception as e:
|
| 89 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 90 |
+
import traceback
|
| 91 |
+
traceback.print_exc()
|
| 92 |
+
|
| 93 |
+
# ์ ์ ์ข
๋ฃ
|
| 94 |
+
import sys
|
| 95 |
+
sys.exit(0)
|
| 96 |
+
|
Analysis_code/5.optima/ft_transformer_ctgan10000/ft_transformer_ctgan10000_seoul.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 16 |
+
def print_trial_callback(study, trial):
|
| 17 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 18 |
+
print(f"\n{'='*80}")
|
| 19 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 20 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 21 |
+
print(f" Parameters: {trial.params}")
|
| 22 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 23 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 24 |
+
print(f" Best Parameters: {study.best_params}")
|
| 25 |
+
print(f"{'='*80}\n")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 29 |
+
study = optuna.create_study(
|
| 30 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 31 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="ft_transformer", region="seoul", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100,
|
| 38 |
+
callbacks=[print_trial_callback]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 42 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 43 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 44 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 45 |
+
|
| 46 |
+
try:
|
| 47 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 48 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 49 |
+
|
| 50 |
+
if len(csi_scores) > 0:
|
| 51 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 52 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 53 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 54 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 55 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 56 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 57 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 58 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 59 |
+
|
| 60 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 61 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 62 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 63 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 64 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 65 |
+
study_path = os.path.join(base_dir, "optimization_history/ft_transformer_ctgan10000_seoul_trials.pkl")
|
| 66 |
+
joblib.dump(study, study_path)
|
| 67 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 68 |
+
|
| 69 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 70 |
+
print("\n" + "="*50)
|
| 71 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 72 |
+
print("="*50)
|
| 73 |
+
|
| 74 |
+
best_params = study.best_params
|
| 75 |
+
model_path = train_final_model(
|
| 76 |
+
best_params=best_params,
|
| 77 |
+
model_choose="ft_transformer",
|
| 78 |
+
region="seoul",
|
| 79 |
+
data_sample='ctgan10000',
|
| 80 |
+
target='multi',
|
| 81 |
+
n_folds=3,
|
| 82 |
+
random_state=seed
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 86 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 87 |
+
|
| 88 |
+
except Exception as e:
|
| 89 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 90 |
+
import traceback
|
| 91 |
+
traceback.print_exc()
|
| 92 |
+
|
| 93 |
+
# ์ ์ ์ข
๋ฃ
|
| 94 |
+
import sys
|
| 95 |
+
sys.exit(0)
|
| 96 |
+
|
Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_daegu.py
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
import joblib
|
| 4 |
+
import os
|
| 5 |
+
from warnings import filterwarnings
|
| 6 |
+
from sklearn.metrics import confusion_matrix
|
| 7 |
+
from lightgbm import LGBMClassifier
|
| 8 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 9 |
+
|
| 10 |
+
filterwarnings('ignore')
|
| 11 |
+
|
| 12 |
+
# ์์ ์ ์
|
| 13 |
+
RANDOM_STATE = 42
|
| 14 |
+
N_ESTIMATORS = 4000
|
| 15 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 16 |
+
MAX_EVALS = 100
|
| 17 |
+
DEVICE = 'gpu'
|
| 18 |
+
OBJECTIVE = 'multiclassova'
|
| 19 |
+
|
| 20 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 21 |
+
FOLD_CONFIGS = [
|
| 22 |
+
([2018, 2019], 2020), # Fold 1
|
| 23 |
+
([2018, 2020], 2019), # Fold 2
|
| 24 |
+
([2019, 2020], 2018), # Fold 3
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
def calculate_csi(y_true, y_pred):
|
| 28 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 29 |
+
|
| 30 |
+
Args:
|
| 31 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 32 |
+
y_pred: ์์ธก ๋ ์ด๋ธ
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 36 |
+
"""
|
| 37 |
+
cm = confusion_matrix(y_true, y_pred)
|
| 38 |
+
|
| 39 |
+
# ํผ๋ ํ๋ ฌ์์ H(Hit), F(False alarm), M(Miss) ์ถ์ถ
|
| 40 |
+
H = cm[0, 0] + cm[1, 1]
|
| 41 |
+
F = cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1]
|
| 42 |
+
M = cm[0, 2] + cm[1, 2]
|
| 43 |
+
|
| 44 |
+
# CSI ๊ณ์ฐ
|
| 45 |
+
csi = H / (H + F + M + 1e-10)
|
| 46 |
+
return csi
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def csi_metric(y_true, pred_prob):
|
| 50 |
+
"""LightGBM์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 51 |
+
|
| 52 |
+
Args:
|
| 53 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 54 |
+
pred_prob: ์์ธก ํ๋ฅ (shape: [n_samples, n_classes])
|
| 55 |
+
|
| 56 |
+
Returns:
|
| 57 |
+
('CSI', score, higher_better) ํํ
|
| 58 |
+
"""
|
| 59 |
+
y_pred_binary = np.argmax(pred_prob, axis=1)
|
| 60 |
+
score = calculate_csi(y_true, y_pred_binary)
|
| 61 |
+
return 'CSI', score, True
|
| 62 |
+
|
| 63 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 64 |
+
"""
|
| 65 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 66 |
+
|
| 67 |
+
Args:
|
| 68 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 69 |
+
|
| 70 |
+
Returns:
|
| 71 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 72 |
+
"""
|
| 73 |
+
df = df.copy()
|
| 74 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 75 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 76 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 77 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 78 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 79 |
+
return df
|
| 80 |
+
|
| 81 |
+
def preprocessing(df):
|
| 82 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 83 |
+
|
| 84 |
+
Args:
|
| 85 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 86 |
+
|
| 87 |
+
Returns:
|
| 88 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 89 |
+
"""
|
| 90 |
+
df = df[df.columns].copy()
|
| 91 |
+
df['year'] = df['year'].astype('int')
|
| 92 |
+
df['month'] = df['month'].astype('int')
|
| 93 |
+
df['hour'] = df['hour'].astype('int')
|
| 94 |
+
df = add_derived_features(df).copy()
|
| 95 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 96 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 97 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 98 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 99 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 100 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 101 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 102 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 103 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 104 |
+
return df
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 108 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 109 |
+
|
| 110 |
+
Args:
|
| 111 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 112 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 113 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 114 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 115 |
+
|
| 116 |
+
Returns:
|
| 117 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 118 |
+
"""
|
| 119 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 120 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 121 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 122 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 123 |
+
|
| 124 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 125 |
+
val_mask = df_original['year'] == val_year
|
| 126 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 127 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 128 |
+
|
| 129 |
+
# 'year' ์ปฌ๋ผ ์ ๊ฑฐ
|
| 130 |
+
X_train = X_train.drop(columns=['year'])
|
| 131 |
+
X_val = X_val.drop(columns=['year'])
|
| 132 |
+
|
| 133 |
+
return X_train, X_val, y_train, y_val
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
def create_lgb_model(search_space=None, best_params=None):
|
| 137 |
+
"""LightGBM ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 138 |
+
|
| 139 |
+
Args:
|
| 140 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 141 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 142 |
+
|
| 143 |
+
Returns:
|
| 144 |
+
LGBMClassifier ์ธ์คํด์ค
|
| 145 |
+
"""
|
| 146 |
+
base_params = {
|
| 147 |
+
'n_estimators': N_ESTIMATORS,
|
| 148 |
+
'device': DEVICE,
|
| 149 |
+
'objective': OBJECTIVE,
|
| 150 |
+
'random_state': RANDOM_STATE,
|
| 151 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 152 |
+
'verbose': -1,
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
if search_space is not None:
|
| 156 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 157 |
+
params = {
|
| 158 |
+
**base_params,
|
| 159 |
+
'learning_rate': search_space['learning_rate'],
|
| 160 |
+
'max_depth': int(search_space['max_depth']),
|
| 161 |
+
'num_leaves': int(search_space['num_leaves']),
|
| 162 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 163 |
+
'subsample': search_space['subsample'],
|
| 164 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 165 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 166 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 167 |
+
}
|
| 168 |
+
elif best_params is not None:
|
| 169 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 170 |
+
params = {
|
| 171 |
+
**base_params,
|
| 172 |
+
'learning_rate': best_params['learning_rate'],
|
| 173 |
+
'max_depth': int(best_params['max_depth']),
|
| 174 |
+
'num_leaves': int(best_params['num_leaves']),
|
| 175 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 176 |
+
'subsample': best_params['subsample'],
|
| 177 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 178 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 179 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 180 |
+
}
|
| 181 |
+
else:
|
| 182 |
+
params = base_params
|
| 183 |
+
|
| 184 |
+
return LGBMClassifier(**params)
|
| 185 |
+
|
| 186 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ
|
| 187 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 188 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 189 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 190 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 191 |
+
df_daegu = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/daegu_train.csv"))
|
| 192 |
+
df_ctgan_daegu_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_daegu.csv"))
|
| 193 |
+
df_ctgan_daegu_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_daegu.csv"))
|
| 194 |
+
df_ctgan_daegu_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_daegu.csv"))
|
| 195 |
+
|
| 196 |
+
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
|
| 197 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 198 |
+
df_ctgan_daegu_1 = preprocessing(df_ctgan_daegu_1)
|
| 199 |
+
df_ctgan_daegu_2 = preprocessing(df_ctgan_daegu_2)
|
| 200 |
+
df_ctgan_daegu_3 = preprocessing(df_ctgan_daegu_3)
|
| 201 |
+
df_daegu = preprocessing(df_daegu)
|
| 202 |
+
|
| 203 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 204 |
+
df_ctgan_list = [df_ctgan_daegu_1, df_ctgan_daegu_2, df_ctgan_daegu_3]
|
| 205 |
+
|
| 206 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 207 |
+
lgb_search_space = {
|
| 208 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 209 |
+
'max_depth': hp.quniform('max_depth', 3, 15, 1),
|
| 210 |
+
'num_leaves': hp.quniform('num_leaves', 20, 150, 1), # 2^max_depth ๋ณด๋ค๋ ์๊ฒ
|
| 211 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 212 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 213 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 214 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 215 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def objective_func(search_space):
|
| 220 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 221 |
+
|
| 222 |
+
Args:
|
| 223 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 224 |
+
|
| 225 |
+
Returns:
|
| 226 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 227 |
+
"""
|
| 228 |
+
lgb_model = create_lgb_model(search_space=search_space)
|
| 229 |
+
csi_scores = []
|
| 230 |
+
|
| 231 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 232 |
+
for df_ctgan, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 233 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 234 |
+
df_ctgan, df_daegu, train_years, val_year
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
lgb_model.fit(
|
| 238 |
+
X_train, y_train,
|
| 239 |
+
eval_set=[(X_val, y_val)],
|
| 240 |
+
eval_metric=csi_metric
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 244 |
+
csi_scores.append(csi)
|
| 245 |
+
|
| 246 |
+
# ํ๊ท CSI์ ์์๊ฐ ๋ฐํ (hyperopt๋ ์ต์ํ๋ฅผ ์ํ)
|
| 247 |
+
return -1 * round(np.mean(csi_scores), 4)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 251 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 252 |
+
trials = Trials()
|
| 253 |
+
lgb_best = fmin(
|
| 254 |
+
fn=objective_func,
|
| 255 |
+
space=lgb_search_space,
|
| 256 |
+
algo=tpe.suggest,
|
| 257 |
+
max_evals=MAX_EVALS,
|
| 258 |
+
trials=trials
|
| 259 |
+
)
|
| 260 |
+
|
| 261 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 262 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {lgb_best}")
|
| 263 |
+
|
| 264 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 265 |
+
best_loss = trials.best_trial['result']['loss']
|
| 266 |
+
best_csi = -best_loss
|
| 267 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 268 |
+
|
| 269 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 270 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 271 |
+
csi_scores = [-loss for loss in losses]
|
| 272 |
+
|
| 273 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 274 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 275 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 276 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 277 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 278 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 279 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 280 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 281 |
+
|
| 282 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 283 |
+
import os
|
| 284 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 285 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 286 |
+
trials_path = os.path.join(base_dir, "optimization_history/lgb_ctgan10000_daegu_trials.pkl")
|
| 287 |
+
joblib.dump(trials, trials_path)
|
| 288 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 289 |
+
|
| 290 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 291 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 292 |
+
models = []
|
| 293 |
+
|
| 294 |
+
for fold_idx, (df_ctgan, (train_years, val_year)) in enumerate(
|
| 295 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 296 |
+
):
|
| 297 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 298 |
+
|
| 299 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 300 |
+
df_ctgan, df_daegu, train_years, val_year
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
lgb_model = create_lgb_model(best_params=lgb_best)
|
| 304 |
+
lgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)])
|
| 305 |
+
|
| 306 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 307 |
+
val_csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 308 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 309 |
+
|
| 310 |
+
models.append(lgb_model)
|
| 311 |
+
|
| 312 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 313 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 314 |
+
model_save_path = os.path.join(base_dir, "save_model/lgb_optima/lgb_ctgan10000_daegu.pkl")
|
| 315 |
+
joblib.dump(models, model_save_path)
|
| 316 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 317 |
+
|
Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_daejeon.py
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
import joblib
|
| 4 |
+
import os
|
| 5 |
+
from warnings import filterwarnings
|
| 6 |
+
from sklearn.metrics import confusion_matrix
|
| 7 |
+
from lightgbm import LGBMClassifier
|
| 8 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 9 |
+
|
| 10 |
+
filterwarnings('ignore')
|
| 11 |
+
|
| 12 |
+
# ์์ ์ ์
|
| 13 |
+
RANDOM_STATE = 42
|
| 14 |
+
N_ESTIMATORS = 4000
|
| 15 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 16 |
+
MAX_EVALS = 100
|
| 17 |
+
DEVICE = 'gpu'
|
| 18 |
+
OBJECTIVE = 'multiclassova'
|
| 19 |
+
|
| 20 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 21 |
+
FOLD_CONFIGS = [
|
| 22 |
+
([2018, 2019], 2020), # Fold 1
|
| 23 |
+
([2018, 2020], 2019), # Fold 2
|
| 24 |
+
([2019, 2020], 2018), # Fold 3
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
def calculate_csi(y_true, y_pred):
|
| 28 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 29 |
+
|
| 30 |
+
Args:
|
| 31 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 32 |
+
y_pred: ์์ธก ๋ ์ด๋ธ
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 36 |
+
"""
|
| 37 |
+
cm = confusion_matrix(y_true, y_pred)
|
| 38 |
+
|
| 39 |
+
# ํผ๋ ํ๋ ฌ์์ H(Hit), F(False alarm), M(Miss) ์ถ์ถ
|
| 40 |
+
H = cm[0, 0] + cm[1, 1]
|
| 41 |
+
F = cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1]
|
| 42 |
+
M = cm[0, 2] + cm[1, 2]
|
| 43 |
+
|
| 44 |
+
# CSI ๊ณ์ฐ
|
| 45 |
+
csi = H / (H + F + M + 1e-10)
|
| 46 |
+
return csi
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def csi_metric(y_true, pred_prob):
|
| 50 |
+
"""LightGBM์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 51 |
+
|
| 52 |
+
Args:
|
| 53 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 54 |
+
pred_prob: ์์ธก ํ๋ฅ (shape: [n_samples, n_classes])
|
| 55 |
+
|
| 56 |
+
Returns:
|
| 57 |
+
('CSI', score, higher_better) ํํ
|
| 58 |
+
"""
|
| 59 |
+
y_pred_binary = np.argmax(pred_prob, axis=1)
|
| 60 |
+
score = calculate_csi(y_true, y_pred_binary)
|
| 61 |
+
return 'CSI', score, True
|
| 62 |
+
|
| 63 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 64 |
+
"""
|
| 65 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 66 |
+
|
| 67 |
+
Args:
|
| 68 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 69 |
+
|
| 70 |
+
Returns:
|
| 71 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 72 |
+
"""
|
| 73 |
+
df = df.copy()
|
| 74 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 75 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 76 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 77 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 78 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 79 |
+
return df
|
| 80 |
+
|
| 81 |
+
def preprocessing(df):
|
| 82 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 83 |
+
|
| 84 |
+
Args:
|
| 85 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 86 |
+
|
| 87 |
+
Returns:
|
| 88 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 89 |
+
"""
|
| 90 |
+
df = df[df.columns].copy()
|
| 91 |
+
df['year'] = df['year'].astype('int')
|
| 92 |
+
df['month'] = df['month'].astype('int')
|
| 93 |
+
df['hour'] = df['hour'].astype('int')
|
| 94 |
+
df = add_derived_features(df).copy()
|
| 95 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 96 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 97 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 98 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 99 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 100 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 101 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 102 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 103 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 104 |
+
return df
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 108 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 109 |
+
|
| 110 |
+
Args:
|
| 111 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 112 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 113 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 114 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 115 |
+
|
| 116 |
+
Returns:
|
| 117 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 118 |
+
"""
|
| 119 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 120 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 121 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 122 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 123 |
+
|
| 124 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 125 |
+
val_mask = df_original['year'] == val_year
|
| 126 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 127 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 128 |
+
|
| 129 |
+
# 'year' ์ปฌ๋ผ ์ ๊ฑฐ
|
| 130 |
+
X_train = X_train.drop(columns=['year'])
|
| 131 |
+
X_val = X_val.drop(columns=['year'])
|
| 132 |
+
|
| 133 |
+
return X_train, X_val, y_train, y_val
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
def create_lgb_model(search_space=None, best_params=None):
|
| 137 |
+
"""LightGBM ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 138 |
+
|
| 139 |
+
Args:
|
| 140 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 141 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 142 |
+
|
| 143 |
+
Returns:
|
| 144 |
+
LGBMClassifier ์ธ์คํด์ค
|
| 145 |
+
"""
|
| 146 |
+
base_params = {
|
| 147 |
+
'n_estimators': N_ESTIMATORS,
|
| 148 |
+
'device': DEVICE,
|
| 149 |
+
'objective': OBJECTIVE,
|
| 150 |
+
'random_state': RANDOM_STATE,
|
| 151 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 152 |
+
'verbose': -1,
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
if search_space is not None:
|
| 156 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 157 |
+
params = {
|
| 158 |
+
**base_params,
|
| 159 |
+
'learning_rate': search_space['learning_rate'],
|
| 160 |
+
'max_depth': int(search_space['max_depth']),
|
| 161 |
+
'num_leaves': int(search_space['num_leaves']),
|
| 162 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 163 |
+
'subsample': search_space['subsample'],
|
| 164 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 165 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 166 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 167 |
+
}
|
| 168 |
+
elif best_params is not None:
|
| 169 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 170 |
+
params = {
|
| 171 |
+
**base_params,
|
| 172 |
+
'learning_rate': best_params['learning_rate'],
|
| 173 |
+
'max_depth': int(best_params['max_depth']),
|
| 174 |
+
'num_leaves': int(best_params['num_leaves']),
|
| 175 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 176 |
+
'subsample': best_params['subsample'],
|
| 177 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 178 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 179 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 180 |
+
}
|
| 181 |
+
else:
|
| 182 |
+
params = base_params
|
| 183 |
+
|
| 184 |
+
return LGBMClassifier(**params)
|
| 185 |
+
|
| 186 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ
|
| 187 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 188 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 189 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 190 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 191 |
+
df_daejeon = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/daejeon_train.csv"))
|
| 192 |
+
df_ctgan_daejeon_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_daejeon.csv"))
|
| 193 |
+
df_ctgan_daejeon_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_daejeon.csv"))
|
| 194 |
+
df_ctgan_daejeon_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_daejeon.csv"))
|
| 195 |
+
|
| 196 |
+
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
|
| 197 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 198 |
+
df_ctgan_daejeon_1 = preprocessing(df_ctgan_daejeon_1)
|
| 199 |
+
df_ctgan_daejeon_2 = preprocessing(df_ctgan_daejeon_2)
|
| 200 |
+
df_ctgan_daejeon_3 = preprocessing(df_ctgan_daejeon_3)
|
| 201 |
+
df_daejeon = preprocessing(df_daejeon)
|
| 202 |
+
|
| 203 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 204 |
+
df_ctgan_list = [df_ctgan_daejeon_1, df_ctgan_daejeon_2, df_ctgan_daejeon_3]
|
| 205 |
+
|
| 206 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 207 |
+
lgb_search_space = {
|
| 208 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 209 |
+
'max_depth': hp.quniform('max_depth', 3, 15, 1),
|
| 210 |
+
'num_leaves': hp.quniform('num_leaves', 20, 150, 1), # 2^max_depth ๋ณด๋ค๋ ์๊ฒ
|
| 211 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 212 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 213 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 214 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 215 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def objective_func(search_space):
|
| 220 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 221 |
+
|
| 222 |
+
Args:
|
| 223 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 224 |
+
|
| 225 |
+
Returns:
|
| 226 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 227 |
+
"""
|
| 228 |
+
lgb_model = create_lgb_model(search_space=search_space)
|
| 229 |
+
csi_scores = []
|
| 230 |
+
|
| 231 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 232 |
+
for df_ctgan, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 233 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 234 |
+
df_ctgan, df_daejeon, train_years, val_year
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
lgb_model.fit(
|
| 238 |
+
X_train, y_train,
|
| 239 |
+
eval_set=[(X_val, y_val)],
|
| 240 |
+
eval_metric=csi_metric
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 244 |
+
csi_scores.append(csi)
|
| 245 |
+
|
| 246 |
+
# ํ๊ท CSI์ ์์๊ฐ ๋ฐํ (hyperopt๋ ์ต์ํ๋ฅผ ์ํ)
|
| 247 |
+
return -1 * round(np.mean(csi_scores), 4)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 251 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 252 |
+
trials = Trials()
|
| 253 |
+
lgb_best = fmin(
|
| 254 |
+
fn=objective_func,
|
| 255 |
+
space=lgb_search_space,
|
| 256 |
+
algo=tpe.suggest,
|
| 257 |
+
max_evals=MAX_EVALS,
|
| 258 |
+
trials=trials
|
| 259 |
+
)
|
| 260 |
+
|
| 261 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 262 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {lgb_best}")
|
| 263 |
+
|
| 264 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 265 |
+
best_loss = trials.best_trial['result']['loss']
|
| 266 |
+
best_csi = -best_loss
|
| 267 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 268 |
+
|
| 269 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 270 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 271 |
+
csi_scores = [-loss for loss in losses]
|
| 272 |
+
|
| 273 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 274 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 275 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 276 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 277 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 278 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 279 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 280 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 281 |
+
|
| 282 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 283 |
+
import os
|
| 284 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๏ฟฝ๏ฟฝ๏ฟฝ๋ ํ ๋ฆฌ
|
| 285 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 286 |
+
trials_path = os.path.join(base_dir, "optimization_history/lgb_ctgan10000_daejeon_trials.pkl")
|
| 287 |
+
joblib.dump(trials, trials_path)
|
| 288 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 289 |
+
|
| 290 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 291 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 292 |
+
models = []
|
| 293 |
+
|
| 294 |
+
for fold_idx, (df_ctgan, (train_years, val_year)) in enumerate(
|
| 295 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 296 |
+
):
|
| 297 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 298 |
+
|
| 299 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 300 |
+
df_ctgan, df_daejeon, train_years, val_year
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
lgb_model = create_lgb_model(best_params=lgb_best)
|
| 304 |
+
lgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)])
|
| 305 |
+
|
| 306 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 307 |
+
val_csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 308 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 309 |
+
|
| 310 |
+
models.append(lgb_model)
|
| 311 |
+
|
| 312 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 313 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 314 |
+
model_save_path = os.path.join(base_dir, "save_model/lgb_optima/lgb_ctgan10000_daejeon.pkl")
|
| 315 |
+
joblib.dump(models, model_save_path)
|
| 316 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 317 |
+
|
Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_gwangju.py
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
import joblib
|
| 4 |
+
import os
|
| 5 |
+
from warnings import filterwarnings
|
| 6 |
+
from sklearn.metrics import confusion_matrix
|
| 7 |
+
from lightgbm import LGBMClassifier
|
| 8 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 9 |
+
|
| 10 |
+
filterwarnings('ignore')
|
| 11 |
+
|
| 12 |
+
# ์์ ์ ์
|
| 13 |
+
RANDOM_STATE = 42
|
| 14 |
+
N_ESTIMATORS = 4000
|
| 15 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 16 |
+
MAX_EVALS = 100
|
| 17 |
+
DEVICE = 'gpu'
|
| 18 |
+
OBJECTIVE = 'multiclassova'
|
| 19 |
+
|
| 20 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 21 |
+
FOLD_CONFIGS = [
|
| 22 |
+
([2018, 2019], 2020), # Fold 1
|
| 23 |
+
([2018, 2020], 2019), # Fold 2
|
| 24 |
+
([2019, 2020], 2018), # Fold 3
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
def calculate_csi(y_true, y_pred):
|
| 28 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 29 |
+
|
| 30 |
+
Args:
|
| 31 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 32 |
+
y_pred: ์์ธก ๋ ์ด๋ธ
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 36 |
+
"""
|
| 37 |
+
cm = confusion_matrix(y_true, y_pred)
|
| 38 |
+
|
| 39 |
+
# ํผ๋ ํ๋ ฌ์์ H(Hit), F(False alarm), M(Miss) ์ถ์ถ
|
| 40 |
+
H = cm[0, 0] + cm[1, 1]
|
| 41 |
+
F = cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1]
|
| 42 |
+
M = cm[0, 2] + cm[1, 2]
|
| 43 |
+
|
| 44 |
+
# CSI ๊ณ์ฐ
|
| 45 |
+
csi = H / (H + F + M + 1e-10)
|
| 46 |
+
return csi
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def csi_metric(y_true, pred_prob):
|
| 50 |
+
"""LightGBM์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 51 |
+
|
| 52 |
+
Args:
|
| 53 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 54 |
+
pred_prob: ์์ธก ํ๋ฅ (shape: [n_samples, n_classes])
|
| 55 |
+
|
| 56 |
+
Returns:
|
| 57 |
+
('CSI', score, higher_better) ํํ
|
| 58 |
+
"""
|
| 59 |
+
y_pred_binary = np.argmax(pred_prob, axis=1)
|
| 60 |
+
score = calculate_csi(y_true, y_pred_binary)
|
| 61 |
+
return 'CSI', score, True
|
| 62 |
+
|
| 63 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 64 |
+
"""
|
| 65 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 66 |
+
|
| 67 |
+
Args:
|
| 68 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 69 |
+
|
| 70 |
+
Returns:
|
| 71 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 72 |
+
"""
|
| 73 |
+
df = df.copy()
|
| 74 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 75 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 76 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 77 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 78 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 79 |
+
return df
|
| 80 |
+
|
| 81 |
+
def preprocessing(df):
|
| 82 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 83 |
+
|
| 84 |
+
Args:
|
| 85 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 86 |
+
|
| 87 |
+
Returns:
|
| 88 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 89 |
+
"""
|
| 90 |
+
df = df[df.columns].copy()
|
| 91 |
+
df['year'] = df['year'].astype('int')
|
| 92 |
+
df['month'] = df['month'].astype('int')
|
| 93 |
+
df['hour'] = df['hour'].astype('int')
|
| 94 |
+
df = add_derived_features(df).copy()
|
| 95 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 96 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 97 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 98 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 99 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 100 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 101 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 102 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 103 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 104 |
+
return df
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 108 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 109 |
+
|
| 110 |
+
Args:
|
| 111 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 112 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 113 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 114 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 115 |
+
|
| 116 |
+
Returns:
|
| 117 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 118 |
+
"""
|
| 119 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 120 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 121 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 122 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 123 |
+
|
| 124 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 125 |
+
val_mask = df_original['year'] == val_year
|
| 126 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 127 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 128 |
+
|
| 129 |
+
# 'year' ์ปฌ๋ผ ์ ๊ฑฐ
|
| 130 |
+
X_train = X_train.drop(columns=['year'])
|
| 131 |
+
X_val = X_val.drop(columns=['year'])
|
| 132 |
+
|
| 133 |
+
return X_train, X_val, y_train, y_val
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
def create_lgb_model(search_space=None, best_params=None):
|
| 137 |
+
"""LightGBM ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 138 |
+
|
| 139 |
+
Args:
|
| 140 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 141 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 142 |
+
|
| 143 |
+
Returns:
|
| 144 |
+
LGBMClassifier ์ธ์คํด์ค
|
| 145 |
+
"""
|
| 146 |
+
base_params = {
|
| 147 |
+
'n_estimators': N_ESTIMATORS,
|
| 148 |
+
'device': DEVICE,
|
| 149 |
+
'objective': OBJECTIVE,
|
| 150 |
+
'random_state': RANDOM_STATE,
|
| 151 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 152 |
+
'verbose': -1,
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
if search_space is not None:
|
| 156 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 157 |
+
params = {
|
| 158 |
+
**base_params,
|
| 159 |
+
'learning_rate': search_space['learning_rate'],
|
| 160 |
+
'max_depth': int(search_space['max_depth']),
|
| 161 |
+
'num_leaves': int(search_space['num_leaves']),
|
| 162 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 163 |
+
'subsample': search_space['subsample'],
|
| 164 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 165 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 166 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 167 |
+
}
|
| 168 |
+
elif best_params is not None:
|
| 169 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 170 |
+
params = {
|
| 171 |
+
**base_params,
|
| 172 |
+
'learning_rate': best_params['learning_rate'],
|
| 173 |
+
'max_depth': int(best_params['max_depth']),
|
| 174 |
+
'num_leaves': int(best_params['num_leaves']),
|
| 175 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 176 |
+
'subsample': best_params['subsample'],
|
| 177 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 178 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 179 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 180 |
+
}
|
| 181 |
+
else:
|
| 182 |
+
params = base_params
|
| 183 |
+
|
| 184 |
+
return LGBMClassifier(**params)
|
| 185 |
+
|
| 186 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ
|
| 187 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 188 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 189 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 190 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 191 |
+
df_gwangju = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/gwangju_train.csv"))
|
| 192 |
+
df_ctgan_gwangju_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_gwangju.csv"))
|
| 193 |
+
df_ctgan_gwangju_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_gwangju.csv"))
|
| 194 |
+
df_ctgan_gwangju_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_gwangju.csv"))
|
| 195 |
+
|
| 196 |
+
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
|
| 197 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 198 |
+
df_ctgan_gwangju_1 = preprocessing(df_ctgan_gwangju_1)
|
| 199 |
+
df_ctgan_gwangju_2 = preprocessing(df_ctgan_gwangju_2)
|
| 200 |
+
df_ctgan_gwangju_3 = preprocessing(df_ctgan_gwangju_3)
|
| 201 |
+
df_gwangju = preprocessing(df_gwangju)
|
| 202 |
+
|
| 203 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 204 |
+
df_ctgan_list = [df_ctgan_gwangju_1, df_ctgan_gwangju_2, df_ctgan_gwangju_3]
|
| 205 |
+
|
| 206 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 207 |
+
lgb_search_space = {
|
| 208 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 209 |
+
'max_depth': hp.quniform('max_depth', 3, 15, 1),
|
| 210 |
+
'num_leaves': hp.quniform('num_leaves', 20, 150, 1), # 2^max_depth ๋ณด๋ค๋ ์๊ฒ
|
| 211 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 212 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 213 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 214 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 215 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def objective_func(search_space):
|
| 220 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 221 |
+
|
| 222 |
+
Args:
|
| 223 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 224 |
+
|
| 225 |
+
Returns:
|
| 226 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 227 |
+
"""
|
| 228 |
+
lgb_model = create_lgb_model(search_space=search_space)
|
| 229 |
+
csi_scores = []
|
| 230 |
+
|
| 231 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 232 |
+
for df_ctgan, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 233 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 234 |
+
df_ctgan, df_gwangju, train_years, val_year
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
lgb_model.fit(
|
| 238 |
+
X_train, y_train,
|
| 239 |
+
eval_set=[(X_val, y_val)],
|
| 240 |
+
eval_metric=csi_metric
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 244 |
+
csi_scores.append(csi)
|
| 245 |
+
|
| 246 |
+
# ํ๊ท CSI์ ์์๊ฐ ๋ฐํ (hyperopt๋ ์ต์ํ๋ฅผ ์ํ)
|
| 247 |
+
return -1 * round(np.mean(csi_scores), 4)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 251 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 252 |
+
trials = Trials()
|
| 253 |
+
lgb_best = fmin(
|
| 254 |
+
fn=objective_func,
|
| 255 |
+
space=lgb_search_space,
|
| 256 |
+
algo=tpe.suggest,
|
| 257 |
+
max_evals=MAX_EVALS,
|
| 258 |
+
trials=trials
|
| 259 |
+
)
|
| 260 |
+
|
| 261 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 262 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {lgb_best}")
|
| 263 |
+
|
| 264 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 265 |
+
best_loss = trials.best_trial['result']['loss']
|
| 266 |
+
best_csi = -best_loss
|
| 267 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 268 |
+
|
| 269 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 270 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 271 |
+
csi_scores = [-loss for loss in losses]
|
| 272 |
+
|
| 273 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 274 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 275 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 276 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 277 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 278 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 279 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 280 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 281 |
+
|
| 282 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 283 |
+
import os
|
| 284 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๏ฟฝ๏ฟฝ๏ฟฝ๋ ํ ๋ฆฌ
|
| 285 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 286 |
+
trials_path = os.path.join(base_dir, "optimization_history/lgb_ctgan10000_gwangju_trials.pkl")
|
| 287 |
+
joblib.dump(trials, trials_path)
|
| 288 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 289 |
+
|
| 290 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 291 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 292 |
+
models = []
|
| 293 |
+
|
| 294 |
+
for fold_idx, (df_ctgan, (train_years, val_year)) in enumerate(
|
| 295 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 296 |
+
):
|
| 297 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 298 |
+
|
| 299 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 300 |
+
df_ctgan, df_gwangju, train_years, val_year
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
lgb_model = create_lgb_model(best_params=lgb_best)
|
| 304 |
+
lgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)])
|
| 305 |
+
|
| 306 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 307 |
+
val_csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 308 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 309 |
+
|
| 310 |
+
models.append(lgb_model)
|
| 311 |
+
|
| 312 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 313 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 314 |
+
model_save_path = os.path.join(base_dir, "save_model/lgb_optima/lgb_ctgan10000_gwangju.pkl")
|
| 315 |
+
joblib.dump(models, model_save_path)
|
| 316 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 317 |
+
|
Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_incheon.py
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
import joblib
|
| 4 |
+
import os
|
| 5 |
+
from warnings import filterwarnings
|
| 6 |
+
from sklearn.metrics import confusion_matrix
|
| 7 |
+
from lightgbm import LGBMClassifier
|
| 8 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 9 |
+
|
| 10 |
+
filterwarnings('ignore')
|
| 11 |
+
|
| 12 |
+
# ์์ ์ ์
|
| 13 |
+
RANDOM_STATE = 42
|
| 14 |
+
N_ESTIMATORS = 4000
|
| 15 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 16 |
+
MAX_EVALS = 100
|
| 17 |
+
DEVICE = 'gpu'
|
| 18 |
+
OBJECTIVE = 'multiclassova'
|
| 19 |
+
|
| 20 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 21 |
+
FOLD_CONFIGS = [
|
| 22 |
+
([2018, 2019], 2020), # Fold 1
|
| 23 |
+
([2018, 2020], 2019), # Fold 2
|
| 24 |
+
([2019, 2020], 2018), # Fold 3
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
def calculate_csi(y_true, y_pred):
|
| 28 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 29 |
+
|
| 30 |
+
Args:
|
| 31 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 32 |
+
y_pred: ์์ธก ๋ ์ด๋ธ
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 36 |
+
"""
|
| 37 |
+
cm = confusion_matrix(y_true, y_pred)
|
| 38 |
+
|
| 39 |
+
# ํผ๋ ํ๋ ฌ์์ H(Hit), F(False alarm), M(Miss) ์ถ์ถ
|
| 40 |
+
H = cm[0, 0] + cm[1, 1]
|
| 41 |
+
F = cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1]
|
| 42 |
+
M = cm[0, 2] + cm[1, 2]
|
| 43 |
+
|
| 44 |
+
# CSI ๊ณ์ฐ
|
| 45 |
+
csi = H / (H + F + M + 1e-10)
|
| 46 |
+
return csi
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def csi_metric(y_true, pred_prob):
|
| 50 |
+
"""LightGBM์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 51 |
+
|
| 52 |
+
Args:
|
| 53 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 54 |
+
pred_prob: ์์ธก ํ๋ฅ (shape: [n_samples, n_classes])
|
| 55 |
+
|
| 56 |
+
Returns:
|
| 57 |
+
('CSI', score, higher_better) ํํ
|
| 58 |
+
"""
|
| 59 |
+
y_pred_binary = np.argmax(pred_prob, axis=1)
|
| 60 |
+
score = calculate_csi(y_true, y_pred_binary)
|
| 61 |
+
return 'CSI', score, True
|
| 62 |
+
|
| 63 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 64 |
+
"""
|
| 65 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 66 |
+
|
| 67 |
+
Args:
|
| 68 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 69 |
+
|
| 70 |
+
Returns:
|
| 71 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 72 |
+
"""
|
| 73 |
+
df = df.copy()
|
| 74 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 75 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 76 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 77 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 78 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 79 |
+
return df
|
| 80 |
+
|
| 81 |
+
def preprocessing(df):
|
| 82 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 83 |
+
|
| 84 |
+
Args:
|
| 85 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 86 |
+
|
| 87 |
+
Returns:
|
| 88 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 89 |
+
"""
|
| 90 |
+
df = df[df.columns].copy()
|
| 91 |
+
df['year'] = df['year'].astype('int')
|
| 92 |
+
df['month'] = df['month'].astype('int')
|
| 93 |
+
df['hour'] = df['hour'].astype('int')
|
| 94 |
+
df = add_derived_features(df).copy()
|
| 95 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 96 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 97 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 98 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 99 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 100 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 101 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 102 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 103 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 104 |
+
return df
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 108 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 109 |
+
|
| 110 |
+
Args:
|
| 111 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 112 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 113 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 114 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 115 |
+
|
| 116 |
+
Returns:
|
| 117 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 118 |
+
"""
|
| 119 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 120 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 121 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 122 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 123 |
+
|
| 124 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 125 |
+
val_mask = df_original['year'] == val_year
|
| 126 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 127 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 128 |
+
|
| 129 |
+
# 'year' ์ปฌ๋ผ ์ ๊ฑฐ
|
| 130 |
+
X_train = X_train.drop(columns=['year'])
|
| 131 |
+
X_val = X_val.drop(columns=['year'])
|
| 132 |
+
|
| 133 |
+
return X_train, X_val, y_train, y_val
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
def create_lgb_model(search_space=None, best_params=None):
|
| 137 |
+
"""LightGBM ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 138 |
+
|
| 139 |
+
Args:
|
| 140 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 141 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 142 |
+
|
| 143 |
+
Returns:
|
| 144 |
+
LGBMClassifier ์ธ์คํด์ค
|
| 145 |
+
"""
|
| 146 |
+
base_params = {
|
| 147 |
+
'n_estimators': N_ESTIMATORS,
|
| 148 |
+
'device': DEVICE,
|
| 149 |
+
'objective': OBJECTIVE,
|
| 150 |
+
'random_state': RANDOM_STATE,
|
| 151 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 152 |
+
'verbose': -1,
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
if search_space is not None:
|
| 156 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 157 |
+
params = {
|
| 158 |
+
**base_params,
|
| 159 |
+
'learning_rate': search_space['learning_rate'],
|
| 160 |
+
'max_depth': int(search_space['max_depth']),
|
| 161 |
+
'num_leaves': int(search_space['num_leaves']),
|
| 162 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 163 |
+
'subsample': search_space['subsample'],
|
| 164 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 165 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 166 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 167 |
+
}
|
| 168 |
+
elif best_params is not None:
|
| 169 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 170 |
+
params = {
|
| 171 |
+
**base_params,
|
| 172 |
+
'learning_rate': best_params['learning_rate'],
|
| 173 |
+
'max_depth': int(best_params['max_depth']),
|
| 174 |
+
'num_leaves': int(best_params['num_leaves']),
|
| 175 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 176 |
+
'subsample': best_params['subsample'],
|
| 177 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 178 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 179 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 180 |
+
}
|
| 181 |
+
else:
|
| 182 |
+
params = base_params
|
| 183 |
+
|
| 184 |
+
return LGBMClassifier(**params)
|
| 185 |
+
|
| 186 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ
|
| 187 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 188 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 189 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 190 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 191 |
+
df_incheon = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/incheon_train.csv"))
|
| 192 |
+
df_ctgan_incheon_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_incheon.csv"))
|
| 193 |
+
df_ctgan_incheon_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_incheon.csv"))
|
| 194 |
+
df_ctgan_incheon_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_incheon.csv"))
|
| 195 |
+
|
| 196 |
+
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
|
| 197 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 198 |
+
df_ctgan_incheon_1 = preprocessing(df_ctgan_incheon_1)
|
| 199 |
+
df_ctgan_incheon_2 = preprocessing(df_ctgan_incheon_2)
|
| 200 |
+
df_ctgan_incheon_3 = preprocessing(df_ctgan_incheon_3)
|
| 201 |
+
df_incheon = preprocessing(df_incheon)
|
| 202 |
+
|
| 203 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 204 |
+
df_ctgan_list = [df_ctgan_incheon_1, df_ctgan_incheon_2, df_ctgan_incheon_3]
|
| 205 |
+
|
| 206 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 207 |
+
lgb_search_space = {
|
| 208 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 209 |
+
'max_depth': hp.quniform('max_depth', 3, 15, 1),
|
| 210 |
+
'num_leaves': hp.quniform('num_leaves', 20, 150, 1), # 2^max_depth ๋ณด๋ค๋ ์๊ฒ
|
| 211 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 212 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 213 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 214 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 215 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def objective_func(search_space):
|
| 220 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 221 |
+
|
| 222 |
+
Args:
|
| 223 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 224 |
+
|
| 225 |
+
Returns:
|
| 226 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 227 |
+
"""
|
| 228 |
+
lgb_model = create_lgb_model(search_space=search_space)
|
| 229 |
+
csi_scores = []
|
| 230 |
+
|
| 231 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 232 |
+
for df_ctgan, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 233 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 234 |
+
df_ctgan, df_incheon, train_years, val_year
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
lgb_model.fit(
|
| 238 |
+
X_train, y_train,
|
| 239 |
+
eval_set=[(X_val, y_val)],
|
| 240 |
+
eval_metric=csi_metric
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 244 |
+
csi_scores.append(csi)
|
| 245 |
+
|
| 246 |
+
# ํ๊ท CSI์ ์์๊ฐ ๋ฐํ (hyperopt๋ ์ต์ํ๋ฅผ ์ํ)
|
| 247 |
+
return -1 * round(np.mean(csi_scores), 4)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 251 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 252 |
+
trials = Trials()
|
| 253 |
+
lgb_best = fmin(
|
| 254 |
+
fn=objective_func,
|
| 255 |
+
space=lgb_search_space,
|
| 256 |
+
algo=tpe.suggest,
|
| 257 |
+
max_evals=MAX_EVALS,
|
| 258 |
+
trials=trials
|
| 259 |
+
)
|
| 260 |
+
|
| 261 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 262 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {lgb_best}")
|
| 263 |
+
|
| 264 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 265 |
+
best_loss = trials.best_trial['result']['loss']
|
| 266 |
+
best_csi = -best_loss
|
| 267 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 268 |
+
|
| 269 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 270 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 271 |
+
csi_scores = [-loss for loss in losses]
|
| 272 |
+
|
| 273 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 274 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 275 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 276 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 277 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 278 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 279 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 280 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 281 |
+
|
| 282 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 283 |
+
import os
|
| 284 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๏ฟฝ๏ฟฝ๏ฟฝ๋ ํ ๋ฆฌ
|
| 285 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 286 |
+
trials_path = os.path.join(base_dir, "optimization_history/lgb_ctgan10000_incheon_trials.pkl")
|
| 287 |
+
joblib.dump(trials, trials_path)
|
| 288 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 289 |
+
|
| 290 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 291 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 292 |
+
models = []
|
| 293 |
+
|
| 294 |
+
for fold_idx, (df_ctgan, (train_years, val_year)) in enumerate(
|
| 295 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 296 |
+
):
|
| 297 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 298 |
+
|
| 299 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 300 |
+
df_ctgan, df_incheon, train_years, val_year
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
lgb_model = create_lgb_model(best_params=lgb_best)
|
| 304 |
+
lgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)])
|
| 305 |
+
|
| 306 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 307 |
+
val_csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 308 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 309 |
+
|
| 310 |
+
models.append(lgb_model)
|
| 311 |
+
|
| 312 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 313 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 314 |
+
model_save_path = os.path.join(base_dir, "save_model/lgb_optima/lgb_ctgan10000_incheon.pkl")
|
| 315 |
+
joblib.dump(models, model_save_path)
|
| 316 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 317 |
+
|
Analysis_code/5.optima/lgb_ctgan10000/LGB_ctgan10000_seoul.py
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
import joblib
|
| 4 |
+
import os
|
| 5 |
+
from warnings import filterwarnings
|
| 6 |
+
from sklearn.metrics import confusion_matrix
|
| 7 |
+
from lightgbm import LGBMClassifier
|
| 8 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 9 |
+
|
| 10 |
+
filterwarnings('ignore')
|
| 11 |
+
|
| 12 |
+
# ์์ ์ ์
|
| 13 |
+
RANDOM_STATE = 42
|
| 14 |
+
N_ESTIMATORS = 4000
|
| 15 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 16 |
+
MAX_EVALS = 100
|
| 17 |
+
DEVICE = 'gpu'
|
| 18 |
+
OBJECTIVE = 'multiclassova'
|
| 19 |
+
|
| 20 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 21 |
+
FOLD_CONFIGS = [
|
| 22 |
+
([2018, 2019], 2020), # Fold 1
|
| 23 |
+
([2018, 2020], 2019), # Fold 2
|
| 24 |
+
([2019, 2020], 2018), # Fold 3
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
def calculate_csi(y_true, y_pred):
|
| 28 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 29 |
+
|
| 30 |
+
Args:
|
| 31 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 32 |
+
y_pred: ์์ธก ๋ ์ด๋ธ
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 36 |
+
"""
|
| 37 |
+
cm = confusion_matrix(y_true, y_pred)
|
| 38 |
+
|
| 39 |
+
# ํผ๋ ํ๋ ฌ์์ H(Hit), F(False alarm), M(Miss) ์ถ์ถ
|
| 40 |
+
H = cm[0, 0] + cm[1, 1]
|
| 41 |
+
F = cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1]
|
| 42 |
+
M = cm[0, 2] + cm[1, 2]
|
| 43 |
+
|
| 44 |
+
# CSI ๊ณ์ฐ
|
| 45 |
+
csi = H / (H + F + M + 1e-10)
|
| 46 |
+
return csi
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def csi_metric(y_true, pred_prob):
|
| 50 |
+
"""LightGBM์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 51 |
+
|
| 52 |
+
Args:
|
| 53 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 54 |
+
pred_prob: ์์ธก ํ๋ฅ (shape: [n_samples, n_classes])
|
| 55 |
+
|
| 56 |
+
Returns:
|
| 57 |
+
('CSI', score, higher_better) ํํ
|
| 58 |
+
"""
|
| 59 |
+
y_pred_binary = np.argmax(pred_prob, axis=1)
|
| 60 |
+
score = calculate_csi(y_true, y_pred_binary)
|
| 61 |
+
return 'CSI', score, True
|
| 62 |
+
|
| 63 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 64 |
+
"""
|
| 65 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 66 |
+
|
| 67 |
+
Args:
|
| 68 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 69 |
+
|
| 70 |
+
Returns:
|
| 71 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 72 |
+
"""
|
| 73 |
+
df = df.copy()
|
| 74 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 75 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 76 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 77 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 78 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 79 |
+
return df
|
| 80 |
+
|
| 81 |
+
def preprocessing(df):
|
| 82 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 83 |
+
|
| 84 |
+
Args:
|
| 85 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 86 |
+
|
| 87 |
+
Returns:
|
| 88 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 89 |
+
"""
|
| 90 |
+
df = df[df.columns].copy()
|
| 91 |
+
df['year'] = df['year'].astype('int')
|
| 92 |
+
df['month'] = df['month'].astype('int')
|
| 93 |
+
df['hour'] = df['hour'].astype('int')
|
| 94 |
+
df = add_derived_features(df).copy()
|
| 95 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 96 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 97 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 98 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 99 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 100 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 101 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 102 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 103 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 104 |
+
return df
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 108 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 109 |
+
|
| 110 |
+
Args:
|
| 111 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 112 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 113 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 114 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 115 |
+
|
| 116 |
+
Returns:
|
| 117 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 118 |
+
"""
|
| 119 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 120 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 121 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 122 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 123 |
+
|
| 124 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 125 |
+
val_mask = df_original['year'] == val_year
|
| 126 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 127 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 128 |
+
|
| 129 |
+
# 'year' ์ปฌ๋ผ ์ ๊ฑฐ
|
| 130 |
+
X_train = X_train.drop(columns=['year'])
|
| 131 |
+
X_val = X_val.drop(columns=['year'])
|
| 132 |
+
|
| 133 |
+
return X_train, X_val, y_train, y_val
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
def create_lgb_model(search_space=None, best_params=None):
|
| 137 |
+
"""LightGBM ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 138 |
+
|
| 139 |
+
Args:
|
| 140 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 141 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 142 |
+
|
| 143 |
+
Returns:
|
| 144 |
+
LGBMClassifier ์ธ์คํด์ค
|
| 145 |
+
"""
|
| 146 |
+
base_params = {
|
| 147 |
+
'n_estimators': N_ESTIMATORS,
|
| 148 |
+
'device': DEVICE,
|
| 149 |
+
'objective': OBJECTIVE,
|
| 150 |
+
'random_state': RANDOM_STATE,
|
| 151 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 152 |
+
'verbose': -1,
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
if search_space is not None:
|
| 156 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 157 |
+
params = {
|
| 158 |
+
**base_params,
|
| 159 |
+
'learning_rate': search_space['learning_rate'],
|
| 160 |
+
'max_depth': int(search_space['max_depth']),
|
| 161 |
+
'num_leaves': int(search_space['num_leaves']),
|
| 162 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 163 |
+
'subsample': search_space['subsample'],
|
| 164 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 165 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 166 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 167 |
+
}
|
| 168 |
+
elif best_params is not None:
|
| 169 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 170 |
+
params = {
|
| 171 |
+
**base_params,
|
| 172 |
+
'learning_rate': best_params['learning_rate'],
|
| 173 |
+
'max_depth': int(best_params['max_depth']),
|
| 174 |
+
'num_leaves': int(best_params['num_leaves']),
|
| 175 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 176 |
+
'subsample': best_params['subsample'],
|
| 177 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 178 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 179 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 180 |
+
}
|
| 181 |
+
else:
|
| 182 |
+
params = base_params
|
| 183 |
+
|
| 184 |
+
return LGBMClassifier(**params)
|
| 185 |
+
|
| 186 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ
|
| 187 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 188 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 189 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 190 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 191 |
+
df_seoul = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/seoul_train.csv"))
|
| 192 |
+
df_ctgan_seoul_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_seoul.csv"))
|
| 193 |
+
df_ctgan_seoul_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_seoul.csv"))
|
| 194 |
+
df_ctgan_seoul_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_seoul.csv"))
|
| 195 |
+
|
| 196 |
+
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
|
| 197 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 198 |
+
df_ctgan_seoul_1 = preprocessing(df_ctgan_seoul_1)
|
| 199 |
+
df_ctgan_seoul_2 = preprocessing(df_ctgan_seoul_2)
|
| 200 |
+
df_ctgan_seoul_3 = preprocessing(df_ctgan_seoul_3)
|
| 201 |
+
df_seoul = preprocessing(df_seoul)
|
| 202 |
+
|
| 203 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 204 |
+
df_ctgan_list = [df_ctgan_seoul_1, df_ctgan_seoul_2, df_ctgan_seoul_3]
|
| 205 |
+
|
| 206 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 207 |
+
lgb_search_space = {
|
| 208 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 209 |
+
'max_depth': hp.quniform('max_depth', 3, 15, 1),
|
| 210 |
+
'num_leaves': hp.quniform('num_leaves', 20, 150, 1), # 2^max_depth ๋ณด๋ค๋ ์๊ฒ
|
| 211 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 212 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 213 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 214 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 215 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def objective_func(search_space):
|
| 220 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 221 |
+
|
| 222 |
+
Args:
|
| 223 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 224 |
+
|
| 225 |
+
Returns:
|
| 226 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 227 |
+
"""
|
| 228 |
+
lgb_model = create_lgb_model(search_space=search_space)
|
| 229 |
+
csi_scores = []
|
| 230 |
+
|
| 231 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 232 |
+
for df_ctgan, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 233 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 234 |
+
df_ctgan, df_seoul, train_years, val_year
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
lgb_model.fit(
|
| 238 |
+
X_train, y_train,
|
| 239 |
+
eval_set=[(X_val, y_val)],
|
| 240 |
+
eval_metric=csi_metric
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 244 |
+
csi_scores.append(csi)
|
| 245 |
+
|
| 246 |
+
# ํ๊ท CSI์ ์์๊ฐ ๋ฐํ (hyperopt๋ ์ต์ํ๋ฅผ ์ํ)
|
| 247 |
+
return -1 * round(np.mean(csi_scores), 4)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 251 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 252 |
+
trials = Trials()
|
| 253 |
+
lgb_best = fmin(
|
| 254 |
+
fn=objective_func,
|
| 255 |
+
space=lgb_search_space,
|
| 256 |
+
algo=tpe.suggest,
|
| 257 |
+
max_evals=MAX_EVALS,
|
| 258 |
+
trials=trials
|
| 259 |
+
)
|
| 260 |
+
|
| 261 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 262 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {lgb_best}")
|
| 263 |
+
|
| 264 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 265 |
+
best_loss = trials.best_trial['result']['loss']
|
| 266 |
+
best_csi = -best_loss
|
| 267 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 268 |
+
|
| 269 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 270 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 271 |
+
csi_scores = [-loss for loss in losses]
|
| 272 |
+
|
| 273 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 274 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 275 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 276 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 277 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 278 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 279 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 280 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 281 |
+
|
| 282 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 283 |
+
import os
|
| 284 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 285 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 286 |
+
trials_path = os.path.join(base_dir, "optimization_history/lgb_ctgan10000_seoul_trials.pkl")
|
| 287 |
+
joblib.dump(trials, trials_path)
|
| 288 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 289 |
+
|
| 290 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 291 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 292 |
+
models = []
|
| 293 |
+
|
| 294 |
+
for fold_idx, (df_ctgan, (train_years, val_year)) in enumerate(
|
| 295 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 296 |
+
):
|
| 297 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 298 |
+
|
| 299 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 300 |
+
df_ctgan, df_seoul, train_years, val_year
|
| 301 |
+
)
|
| 302 |
+
|
| 303 |
+
lgb_model = create_lgb_model(best_params=lgb_best)
|
| 304 |
+
lgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)])
|
| 305 |
+
|
| 306 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 307 |
+
val_csi = calculate_csi(y_val, lgb_model.predict(X_val))
|
| 308 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 309 |
+
|
| 310 |
+
models.append(lgb_model)
|
| 311 |
+
|
| 312 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 313 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 314 |
+
model_save_path = os.path.join(base_dir, "save_model/lgb_optima/lgb_ctgan10000_seoul.pkl")
|
| 315 |
+
joblib.dump(models, model_save_path)
|
| 316 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 317 |
+
|
Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_daegu.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="resnet_like", region="daegu", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/resnet_like_ctgan10000_daegu_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="resnet_like",
|
| 79 |
+
region="daegu",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_daejeon.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="resnet_like", region="daejeon", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/resnet_like_ctgan10000_daejeon_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="resnet_like",
|
| 79 |
+
region="daejeon",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_gwangju.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="resnet_like", region="gwangju", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/resnet_like_ctgan10000_gwangju_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="resnet_like",
|
| 79 |
+
region="gwangju",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_incheon.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="resnet_like", region="incheon", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/resnet_like_ctgan10000_incheon_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="resnet_like",
|
| 79 |
+
region="incheon",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/resnet_like_ctgan10000/resnet_like_ctgan10000_seoul.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import optuna
|
| 2 |
+
import numpy as np
|
| 3 |
+
import random
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import joblib
|
| 6 |
+
import os
|
| 7 |
+
import torch
|
| 8 |
+
from utils import *
|
| 9 |
+
# Python ๋ฐ Numpy ์๋ ๊ณ ์
|
| 10 |
+
seed = 42
|
| 11 |
+
random.seed(seed)
|
| 12 |
+
np.random.seed(seed)
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 1. Study ์์ฑ ์ 'maximize'๋ก ์ค์
|
| 16 |
+
study = optuna.create_study(
|
| 17 |
+
direction="maximize", # CSI ์ ์๊ฐ ๋์์๋ก ์ข์ผ๋ฏ๋ก maximize
|
| 18 |
+
pruner=optuna.pruners.MedianPruner(n_warmup_steps=10) # ์ด๋ฐ 10์ํญ์ ์ง์ผ๋ณด๊ณ ์ดํ ๊ฐ์ง์น๊ธฐ
|
| 19 |
+
)
|
| 20 |
+
# Trial ์๋ฃ ์ ์์ธ ์ ๋ณด ์ถ๋ ฅํ๋ callback ํจ์
|
| 21 |
+
def print_trial_callback(study, trial):
|
| 22 |
+
"""๊ฐ trial ์๋ฃ ์ best value๋ฅผ ํฌํจํ ์์ธ ์ ๋ณด ์ถ๋ ฅ"""
|
| 23 |
+
print(f"\n{'='*80}")
|
| 24 |
+
print(f"Trial {trial.number} ์๋ฃ")
|
| 25 |
+
print(f" Value (CSI): {trial.value:.6f}" if trial.value is not None else f" Value: {trial.value}")
|
| 26 |
+
print(f" Parameters: {trial.params}")
|
| 27 |
+
print(f" Best Value (CSI): {study.best_value:.6f}" if study.best_value is not None else f" Best Value: {study.best_value}")
|
| 28 |
+
print(f" Best Trial: {study.best_trial.number}")
|
| 29 |
+
print(f" Best Parameters: {study.best_params}")
|
| 30 |
+
print(f"{'='*80}\n")
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# 2. ์ต์ ํ ์คํ
|
| 35 |
+
study.optimize(
|
| 36 |
+
lambda trial: objective(trial, model_choose="resnet_like", region="seoul", data_sample='ctgan10000'),
|
| 37 |
+
n_trials=100
|
| 38 |
+
,
|
| 39 |
+
callbacks=[print_trial_callback]
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
# 3. ๊ฒฐ๊ณผ ํ์ธ ๋ฐ ์์ฝ
|
| 43 |
+
print(f"\n์ต์ ํ ์๋ฃ.")
|
| 44 |
+
print(f"Best CSI Score: {study.best_value:.4f}")
|
| 45 |
+
print(f"Best Hyperparameters: {study.best_params}")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
# ๋ชจ๋ trial์ CSI ์ ์ ์ถ์ถ
|
| 49 |
+
csi_scores = [trial.value for trial in study.trials if trial.value is not None]
|
| 50 |
+
|
| 51 |
+
if len(csi_scores) > 0:
|
| 52 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 53 |
+
print(f" - ์ด ์๋ ํ์: {len(study.trials)}")
|
| 54 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(csi_scores)}")
|
| 55 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 56 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 57 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 58 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 59 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 60 |
+
|
| 61 |
+
# Study ๊ฐ์ฒด ์ ์ฅ
|
| 62 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 63 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 64 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 65 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 66 |
+
study_path = os.path.join(base_dir, "optimization_history/resnet_like_ctgan10000_seoul_trials.pkl")
|
| 67 |
+
joblib.dump(study, study_path)
|
| 68 |
+
print(f"\n์ต์ ํ Study ๊ฐ์ฒด๊ฐ {study_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 69 |
+
|
| 70 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ
|
| 71 |
+
print("\n" + "="*50)
|
| 72 |
+
print("์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต ์์")
|
| 73 |
+
print("="*50)
|
| 74 |
+
|
| 75 |
+
best_params = study.best_params
|
| 76 |
+
model_path = train_final_model(
|
| 77 |
+
best_params=best_params,
|
| 78 |
+
model_choose="resnet_like",
|
| 79 |
+
region="seoul",
|
| 80 |
+
data_sample='ctgan10000',
|
| 81 |
+
target='multi',
|
| 82 |
+
n_folds=3,
|
| 83 |
+
random_state=seed
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
print(f"\n์ต์ข
๋ชจ๋ธ ํ์ต ๋ฐ ์ ์ฅ ์๋ฃ!")
|
| 87 |
+
print(f"์ ์ฅ๋ ๋ชจ๋ธ ๊ฒฝ๋ก: {model_path}")
|
| 88 |
+
|
| 89 |
+
except Exception as e:
|
| 90 |
+
print(f"\nโ ๏ธ ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 91 |
+
import traceback
|
| 92 |
+
traceback.print_exc()
|
| 93 |
+
|
| 94 |
+
# ์ ์ ์ข
๋ฃ
|
| 95 |
+
import sys
|
| 96 |
+
sys.exit(0)
|
| 97 |
+
|
Analysis_code/5.optima/run_bash/deepgbm/deepgbm_ctgan10000
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/5.optima/run_bash/deepgbm/deepgbm_ctgan10000.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/5.optima/run_bash/deepgbm/run_deepgbm_ctgan10000.sh
CHANGED
|
@@ -15,6 +15,11 @@ echo ""
|
|
| 15 |
# ์คํํ ํ์ผ ๋ชฉ๋ก
|
| 16 |
FILES=(
|
| 17 |
"deepgbm_ctgan10000_busan.py"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
# ์๋ฌ ๋ฐ์ ์ ์ค๋จ ์ฌ๋ถ (set -e๋ฅผ ์ฌ์ฉํ๋ฉด ์๋ฌ ๋ฐ์ ์ ์ฆ์ ์ค๋จ)
|
|
|
|
| 15 |
# ์คํํ ํ์ผ ๋ชฉ๋ก
|
| 16 |
FILES=(
|
| 17 |
"deepgbm_ctgan10000_busan.py"
|
| 18 |
+
"deepgbm_ctgan10000_daegu.py"
|
| 19 |
+
"deepgbm_ctgan10000_daejeon.py"
|
| 20 |
+
"deepgbm_ctgan10000_gwangju.py"
|
| 21 |
+
"deepgbm_ctgan10000_incheon.py"
|
| 22 |
+
"deepgbm_ctgan10000_seoul.py"
|
| 23 |
)
|
| 24 |
|
| 25 |
# ์๋ฌ ๋ฐ์ ์ ์ค๋จ ์ฌ๋ถ (set -e๋ฅผ ์ฌ์ฉํ๋ฉด ์๋ฌ ๋ฐ์ ์ ์ฆ์ ์ค๋จ)
|
Analysis_code/5.optima/run_bash/ft_transformer/ft_transformer_ctgan10000
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/5.optima/run_bash/ft_transformer/ft_transformer_ctgan10000.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/5.optima/run_bash/ft_transformer/run_ft_transformer_ctgan10000.sh
CHANGED
|
@@ -15,6 +15,11 @@ echo ""
|
|
| 15 |
# ์คํํ ํ์ผ ๋ชฉ๋ก
|
| 16 |
FILES=(
|
| 17 |
"ft_transformer_ctgan10000_busan.py"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
# ์๋ฌ ๋ฐ์ ์ ์ค๋จ ์ฌ๋ถ (set -e๋ฅผ ์ฌ์ฉํ๋ฉด ์๋ฌ ๋ฐ์ ์ ์ฆ์ ์ค๋จ)
|
|
|
|
| 15 |
# ์คํํ ํ์ผ ๋ชฉ๋ก
|
| 16 |
FILES=(
|
| 17 |
"ft_transformer_ctgan10000_busan.py"
|
| 18 |
+
"ft_transformer_ctgan10000_daegu.py"
|
| 19 |
+
"ft_transformer_ctgan10000_daejeon.py"
|
| 20 |
+
"ft_transformer_ctgan10000_gwangju.py"
|
| 21 |
+
"ft_transformer_ctgan10000_incheon.py"
|
| 22 |
+
"ft_transformer_ctgan10000_seoul.py"
|
| 23 |
)
|
| 24 |
|
| 25 |
# ์๋ฌ ๋ฐ์ ์ ์ค๋จ ์ฌ๋ถ (set -e๋ฅผ ์ฌ์ฉํ๋ฉด ์๋ฌ ๋ฐ์ ์ ์ฆ์ ์ค๋จ)
|
Analysis_code/5.optima/run_bash/lgb/lgb_ctgan10000.log
CHANGED
|
@@ -1,156 +1,219 @@
|
|
| 1 |
-
nohup: ignoring input
|
| 2 |
-
/bin/bash: /opt/conda/lib/libtinfo.so.6: no version information available (required by /bin/bash)
|
| 3 |
-
==========================================
|
| 4 |
-
LGB CTGAN10000 ํ์ผ ์คํ ์์
|
| 5 |
-
์์ ์๊ฐ: 2025-12-
|
| 6 |
-
GPU: 1๋ฒ (CUDA_VISIBLE_DEVICES=1)
|
| 7 |
-
==========================================
|
| 8 |
-
|
| 9 |
-
----------------------------------------
|
| 10 |
-
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_busan.py
|
| 11 |
-
์์ ์๊ฐ: 2025-12-
|
| 12 |
-
----------------------------------------
|
| 13 |
-
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 14 |
-
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 15 |
-
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 16 |
-
|
| 17 |
-
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 18 |
-
1%| | 1/100 [00:17<29:00, 17.58s/trial, best loss: -0.4607]
|
| 19 |
-
2%|โ | 2/100 [00:36<30:05, 18.43s/trial, best loss: -0.4607]
|
| 20 |
-
3%|โ | 3/100 [01:18<47:04, 29.12s/trial, best loss: -0.4607]
|
| 21 |
-
4%|โ | 4/100 [01:56<52:20, 32.72s/trial, best loss: -0.4725]
|
| 22 |
-
5%|โ | 5/100 [02:33<54:17, 34.29s/trial, best loss: -0.4738]
|
| 23 |
-
6%|โ | 6/100 [03:41<1:11:47, 45.82s/trial, best loss: -0.4738]
|
| 24 |
-
7%|โ | 7/100 [04:05<59:46, 38.56s/trial, best loss: -0.4742]
|
| 25 |
-
8%|โ | 8/100 [04:23<49:11, 32.08s/trial, best loss: -0.4742]
|
| 26 |
-
9%|โ | 9/100 [04:47<44:38, 29.43s/trial, best loss: -0.4742]
|
| 27 |
-
10%|โ | 10/100 [05:03<37:59, 25.33s/trial, best loss: -0.4742]
|
| 28 |
-
11%|โ | 11/100 [05:43<44:23, 29.93s/trial, best loss: -0.4742]
|
| 29 |
-
12%|โโ | 12/100 [06:06<40:31, 27.63s/trial, best loss: -0.4742]
|
| 30 |
-
13%|โโ | 13/100 [06:29<38:06, 26.28s/trial, best loss: -0.4742]
|
| 31 |
-
14%|โโ | 14/100 [07:01<40:12, 28.06s/trial, best loss: -0.4742]
|
| 32 |
-
15%|โโ | 15/100 [07:22<36:37, 25.86s/trial, best loss: -0.4742]
|
| 33 |
-
16%|โโ | 16/100 [07:43<34:21, 24.54s/trial, best loss: -0.4742]
|
| 34 |
-
17%|โโ | 17/100 [08:12<35:43, 25.83s/trial, best loss: -0.4742]
|
| 35 |
-
18%|โโ | 18/100 [08:49<39:51, 29.17s/trial, best loss: -0.4742]
|
| 36 |
-
19%|โโ | 19/100 [09:24<41:40, 30.88s/trial, best loss: -0.4785]
|
| 37 |
-
20%|โโ | 20/100 [09:45<37:10, 27.88s/trial, best loss: -0.4785]
|
| 38 |
-
21%|โโ | 21/100 [10:11<36:01, 27.37s/trial, best loss: -0.4785]
|
| 39 |
-
22%|โโโ | 22/100 [10:34<33:49, 26.02s/trial, best loss: -0.4819]
|
| 40 |
-
23%|โโโ | 23/100 [10:57<32:18, 25.17s/trial, best loss: -0.4819]
|
| 41 |
-
24%|โโโ | 24/100 [11:34<36:16, 28.64s/trial, best loss: -0.4822]
|
| 42 |
-
25%|โโโ | 25/100 [11:57<33:52, 27.10s/trial, best loss: -0.486]
|
| 43 |
-
26%|โโโ | 26/100 [12:24<33:21, 27.05s/trial, best loss: -0.486]
|
| 44 |
-
27%|โโโ | 27/100 [12:56<34:44, 28.55s/trial, best loss: -0.486]
|
| 45 |
-
28%|โโโ | 28/100 [13:16<30:54, 25.76s/trial, best loss: -0.486]
|
| 46 |
-
29%|โโโ | 29/100 [13:48<32:49, 27.74s/trial, best loss: -0.486]
|
| 47 |
-
30%|โโโ | 30/100 [14:21<34:06, 29.24s/trial, best loss: -0.486]
|
| 48 |
-
31%|โโโ | 31/100 [14:59<36:48, 32.01s/trial, best loss: -0.486]
|
| 49 |
-
32%|โโโโ | 32/100 [15:17<31:20, 27.66s/trial, best loss: -0.486]
|
| 50 |
-
33%|โโโโ | 33/100 [15:41<29:43, 26.62s/trial, best loss: -0.486]
|
| 51 |
-
34%|โโโโ | 34/100 [16:22<33:56, 30.86s/trial, best loss: -0.486]
|
| 52 |
-
35%|โโโโ | 35/100 [16:40<29:20, 27.08s/trial, best loss: -0.486]
|
| 53 |
-
36%|โโโโ | 36/100 [16:57<25:33, 23.97s/trial, best loss: -0.486]
|
| 54 |
-
37%|โโโโ | 37/100 [17:22<25:39, 24.44s/trial, best loss: -0.486]
|
| 55 |
-
38%|โโโโ | 38/100 [18:01<29:35, 28.64s/trial, best loss: -0.486]
|
| 56 |
-
39%|โโโโ | 39/100 [18:17<25:31, 25.11s/trial, best loss: -0.486]
|
| 57 |
-
40%|โโโโ | 40/100 [18:42<24:52, 24.88s/trial, best loss: -0.486]
|
| 58 |
-
41%|โโโโ | 41/100 [19:01<22:44, 23.13s/trial, best loss: -0.486]
|
| 59 |
-
42%|โโโโโ | 42/100 [19:25<22:48, 23.60s/trial, best loss: -0.486]
|
| 60 |
-
43%|โโโโโ | 43/100 [20:06<27:17, 28.73s/trial, best loss: -0.486]
|
| 61 |
-
44%|โโโโโ | 44/100 [20:35<26:57, 28.88s/trial, best loss: -0.486]
|
| 62 |
-
45%|โโโโโ | 45/100 [21:03<26:12, 28.60s/trial, best loss: -0.486]
|
| 63 |
-
46%|โโโโโ | 46/100 [21:22<22:59, 25.54s/trial, best loss: -0.486]
|
| 64 |
-
47%|โโโโโ | 47/100 [21:47<22:34, 25.56s/trial, best loss: -0.486]
|
| 65 |
-
48%|โโโโโ | 48/100 [22:08<20:50, 24.04s/trial, best loss: -0.486]
|
| 66 |
-
49%|โโโโโ | 49/100 [23:09<29:53, 35.18s/trial, best loss: -0.486]
|
| 67 |
-
50%|โโโโโ | 50/100 [23:34<26:42, 32.05s/trial, best loss: -0.486]
|
| 68 |
-
51%|โโโโโ | 51/100 [23:53<23:03, 28.24s/trial, best loss: -0.486]
|
| 69 |
-
52%|โโโโโโ | 52/100 [24:27<24:01, 30.03s/trial, best loss: -0.486]
|
| 70 |
-
53%|โโโโโโ | 53/100 [24:56<23:19, 29.77s/trial, best loss: -0.486]
|
| 71 |
-
54%|โโโโโโ | 54/100 [25:21<21:40, 28.28s/trial, best loss: -0.486]
|
| 72 |
-
55%|โโโโโโ | 55/100 [25:43<19:46, 26.36s/trial, best loss: -0.486]
|
| 73 |
-
56%|โโโโโโ | 56/100 [26:16<20:46, 28.33s/trial, best loss: -0.486]
|
| 74 |
-
57%|โโโโโโ | 57/100 [26:36<18:23, 25.67s/trial, best loss: -0.486]
|
| 75 |
-
58%|โโโโโโ | 58/100 [27:07<19:06, 27.30s/trial, best loss: -0.486]
|
| 76 |
-
59%|โโโโโโ | 59/100 [27:45<20:57, 30.66s/trial, best loss: -0.486]
|
| 77 |
-
60%|โโโโโโ | 60/100 [28:13<19:56, 29.90s/trial, best loss: -0.486]
|
| 78 |
-
61%|โโโโโโ | 61/100 [28:49<20:38, 31.75s/trial, best loss: -0.486]
|
| 79 |
-
62%|โโโโโโโ | 62/100 [29:25<20:45, 32.78s/trial, best loss: -0.486]
|
| 80 |
-
63%|โโโโโโโ | 63/100 [29:42<17:21, 28.16s/trial, best loss: -0.486]
|
| 81 |
-
64%|โโโโโโโ | 64/100 [30:01<15:15, 25.44s/trial, best loss: -0.486]
|
| 82 |
-
65%|โโโโโโโ | 65/100 [30:27<15:00, 25.73s/trial, best loss: -0.486]
|
| 83 |
-
66%|โโโโโโโ | 66/100 [31:03<16:16, 28.71s/trial, best loss: -0.486]
|
| 84 |
-
67%|โโโโโโโ | 67/100 [31:40<17:08, 31.18s/trial, best loss: -0.486]
|
| 85 |
-
68%|โโโโโโโ | 68/100 [32:18<17:45, 33.31s/trial, best loss: -0.486]
|
| 86 |
-
69%|โโโโโโโ | 69/100 [32:52<17:16, 33.45s/trial, best loss: -0.486]
|
| 87 |
-
70%|โโโโโโโ | 70/100 [33:30<17:26, 34.89s/trial, best loss: -0.486]
|
| 88 |
-
71%|โโโโโโโ | 71/100 [34:01<16:12, 33.53s/trial, best loss: -0.486]
|
| 89 |
-
72%|โโโโโโโโ | 72/100 [34:27<14:40, 31.46s/trial, best loss: -0.486]
|
| 90 |
-
73%|โโโโโโโโ | 73/100 [34:58<14:01, 31.18s/trial, best loss: -0.486]
|
| 91 |
-
74%|โโโโโโโโ | 74/100 [35:38<14:37, 33.77s/trial, best loss: -0.486]
|
| 92 |
-
75%|โโโโโโโโ | 75/100 [36:00<12:41, 30.44s/trial, best loss: -0.486]
|
| 93 |
-
76%|โโโโโโโโ | 76/100 [36:31<12:11, 30.48s/trial, best loss: -0.486]
|
| 94 |
-
77%|โโโโโโโโ | 77/100 [36:52<10:32, 27.52s/trial, best loss: -0.486]
|
| 95 |
-
78%|โโโโโโโโ | 78/100 [37:18<10:01, 27.35s/trial, best loss: -0.486]
|
| 96 |
-
79%|โโโโโโโโ | 79/100 [37:46<09:35, 27.40s/trial, best loss: -0.486]
|
| 97 |
-
80%|โโโโโโโโ | 80/100 [38:13<09:07, 27.38s/trial, best loss: -0.486]
|
| 98 |
-
81%|โโโโโโโโ | 81/100 [38:37<08:19, 26.29s/trial, best loss: -0.486]
|
| 99 |
-
82%|โโโโโโโโโ | 82/100 [39:00<07:36, 25.38s/trial, best loss: -0.486]
|
| 100 |
-
83%|โโโโโโโโโ | 83/100 [39:23<06:55, 24.45s/trial, best loss: -0.486]
|
| 101 |
-
84%|โโโโโโโโโ | 84/100 [39:46<06:24, 24.03s/trial, best loss: -0.486]
|
| 102 |
-
85%|โโโโโโโโโ | 85/100 [40:07<05:46, 23.12s/trial, best loss: -0.486]
|
| 103 |
-
86%|โโโโโโโโโ | 86/100 [40:36<05:51, 25.10s/trial, best loss: -0.486]
|
| 104 |
-
87%|โโโโโโโโโ | 87/100 [41:03<05:32, 25.55s/trial, best loss: -0.486]
|
| 105 |
-
88%|โโโโโโโโโ | 88/100 [41:26<04:57, 24.77s/trial, best loss: -0.486]
|
| 106 |
-
89%|โโโโโโโโโ | 89/100 [41:49<04:25, 24.13s/trial, best loss: -0.486]
|
| 107 |
-
90%|โโโโโโโโโ | 90/100 [42:15<04:08, 24.81s/trial, best loss: -0.486]
|
| 108 |
-
91%|โโโโโโโโโ | 91/100 [42:34<03:28, 23.19s/trial, best loss: -0.486]
|
| 109 |
-
92%|โโโโโโโโโโ| 92/100 [42:56<03:01, 22.66s/trial, best loss: -0.486]
|
| 110 |
-
93%|โโโโโโโโโโ| 93/100 [43:21<02:43, 23.39s/trial, best loss: -0.486]
|
| 111 |
-
94%|โโโโโโโโโโ| 94/100 [43:47<02:25, 24.18s/trial, best loss: -0.486]
|
| 112 |
-
95%|โโโโโโโโโโ| 95/100 [44:21<02:15, 27.10s/trial, best loss: -0.486]
|
| 113 |
-
96%|โโโโโโโโโโ| 96/100 [44:44<01:43, 25.89s/trial, best loss: -0.486]
|
| 114 |
-
97%|โโโโโโโโโโ| 97/100 [45:06<01:14, 24.90s/trial, best loss: -0.486]
|
| 115 |
-
98%|โโโโโโโโโโ| 98/100 [45:37<00:52, 26.46s/trial, best loss: -0.486]
|
| 116 |
-
99%|โโโโโโโโโโ| 99/100 [46:04<00:26, 26.65s/trial, best loss: -0.488]
|
| 117 |
-
100%|โโโโโโโโโโ| 100/100 [46:24<00:00, 24.62s/trial, best loss: -0.488]
|
| 118 |
-
100%|โโโโโโโโโโ| 100/100 [46:24<00:00, 27.84s/trial, best loss: -0.488]
|
| 119 |
-
|
| 120 |
-
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.7801064403987199, 'learning_rate': 0.04039992222321611, 'max_depth': 13.0, 'min_child_weight': 8.0, 'num_leaves': 119.0, 'reg_alpha': 0.6320948905725006, 'reg_lambda': 0.018408747449243035, 'subsample': 0.8868375113319782}
|
| 121 |
-
์ต์ CSI ์ ์: 0.4880 (loss: -0.4880)
|
| 122 |
-
|
| 123 |
-
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 124 |
-
- ์ด ์๋ ํ์: 100
|
| 125 |
-
- ์ฑ๊ณตํ ์๋: 100
|
| 126 |
-
- ์ต์ด CSI: 0.4607
|
| 127 |
-
- ์ต์ข
CSI: 0.4751
|
| 128 |
-
- ์ต๊ณ CSI: 0.4880
|
| 129 |
-
- ์ต์ CSI: 0.3744
|
| 130 |
-
- ํ๊ท CSI: 0.4699
|
| 131 |
-
|
| 132 |
-
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_busan_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 133 |
-
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 134 |
-
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 135 |
-
Fold 1 ๊ฒ์ฆ CSI: 0.3920
|
| 136 |
-
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 137 |
-
Fold 2 ๊ฒ์ฆ CSI: 0.5059
|
| 138 |
-
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 139 |
-
Fold 3 ๊ฒ์ฆ CSI: 0.5052
|
| 140 |
-
๋ชจ๋ธ ์ ์ฅ ๏ฟฝ๏ฟฝ...
|
| 141 |
-
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_busan.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 142 |
-
|
| 143 |
-
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_busan.py (์์ ์๊ฐ: 2798์ด)
|
| 144 |
-
|
| 145 |
-
โ ๏ธ ๊ฒฝ๊ณ : lgb_ctgan10000/LGB_ctgan10000_daegu.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 146 |
-
โ ๏ธ ๊ฒฝ๊ณ : lgb_ctgan10000/LGB_ctgan10000_daejeon.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 147 |
-
โ ๏ธ ๊ฒฝ๊ณ : lgb_ctgan10000/LGB_ctgan10000_gwangju.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 148 |
-
โ ๏ธ ๊ฒฝ๊ณ : lgb_ctgan10000/LGB_ctgan10000_incheon.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 149 |
-
โ ๏ธ ๊ฒฝ๊ณ : lgb_ctgan10000/LGB_ctgan10000_seoul.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 150 |
-
==========================================
|
| 151 |
-
LGB CTGAN10000 ํ์ผ ์คํ ์๋ฃ
|
| 152 |
-
์ข
๋ฃ ์๊ฐ: 2025-12-26 14:49:18
|
| 153 |
-
์ด ์์ ์๊ฐ: 0์๊ฐ 46๋ถ 38์ด
|
| 154 |
-
์ฑ๊ณต: 1๊ฐ
|
| 155 |
-
์คํจ: 5๊ฐ
|
| 156 |
-
==========================================
|
| 157 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 158 |
1%| | 1/100 [01:04<1:47:14, 65.00s/trial, best loss: -0.4238]
|
| 159 |
2%|โ | 2/100 [01:54<1:31:25, 55.98s/trial, best loss: -0.4576]
|
| 160 |
3%|โ | 3/100 [02:31<1:16:36, 47.39s/trial, best loss: -0.4733]
|
| 161 |
4%|โ | 4/100 [03:21<1:17:24, 48.38s/trial, best loss: -0.4758]
|
| 162 |
5%|โ | 5/100 [04:00<1:10:52, 44.77s/trial, best loss: -0.4758]
|
| 163 |
6%|โ | 6/100 [04:24<59:01, 37.68s/trial, best loss: -0.4758]
|
| 164 |
7%|โ | 7/100 [04:54<54:54, 35.42s/trial, best loss: -0.4758]
|
| 165 |
8%|โ | 8/100 [05:41<59:49, 39.02s/trial, best loss: -0.4758]
|
| 166 |
9%|โ | 9/100 [06:04<51:22, 33.87s/trial, best loss: -0.4758]
|
| 167 |
10%|โ | 10/100 [06:52<57:39, 38.44s/trial, best loss: -0.4758]
|
| 168 |
11%|โ | 11/100 [07:30<56:39, 38.20s/trial, best loss: -0.4835]
|
| 169 |
12%|โโ | 12/100 [08:01<52:39, 35.90s/trial, best loss: -0.4835]
|
| 170 |
13%|โโ | 13/100 [08:23<46:16, 31.91s/trial, best loss: -0.4835]
|
| 171 |
14%|โโ | 14/100 [08:46<41:36, 29.03s/trial, best loss: -0.4835]
|
| 172 |
15%|โโ | 15/100 [09:24<44:58, 31.74s/trial, best loss: -0.4835]
|
| 173 |
16%|โโ | 16/100 [10:12<51:30, 36.80s/trial, best loss: -0.4835]
|
| 174 |
17%|โโ | 17/100 [10:47<50:13, 36.30s/trial, best loss: -0.4835]
|
| 175 |
18%|โโ | 18/100 [11:15<46:03, 33.70s/trial, best loss: -0.4835]
|
| 176 |
19%|โโ | 19/100 [11:52<46:41, 34.58s/trial, best loss: -0.4835]
|
| 177 |
20%|โโ | 20/100 [12:13<40:56, 30.71s/trial, best loss: -0.4835]
|
| 178 |
21%|โโ | 21/100 [12:44<40:26, 30.71s/trial, best loss: -0.4835]
|
| 179 |
22%|โโโ | 22/100 [13:14<39:43, 30.56s/trial, best loss: -0.4836]
|
| 180 |
23%|โโโ | 23/100 [13:40<37:14, 29.02s/trial, best loss: -0.4836]
|
| 181 |
24%|โโโ | 24/100 [14:23<42:05, 33.24s/trial, best loss: -0.4836]
|
| 182 |
25%|โโโ | 25/100 [14:53<40:20, 32.27s/trial, best loss: -0.4836]
|
| 183 |
26%|โโโ | 26/100 [15:18<37:18, 30.25s/trial, best loss: -0.4836]
|
| 184 |
27%|โโโ | 27/100 [15:47<36:22, 29.90s/trial, best loss: -0.4836]
|
| 185 |
28%|โโโ | 28/100 [16:40<44:02, 36.70s/trial, best loss: -0.4836]
|
| 186 |
29%|โโโ | 29/100 [17:20<44:27, 37.57s/trial, best loss: -0.4836]
|
| 187 |
30%|โโโ | 30/100 [18:02<45:34, 39.06s/trial, best loss: -0.4836]
|
| 188 |
31%|โโโ | 31/100 [18:26<39:34, 34.42s/trial, best loss: -0.4836]
|
| 189 |
32%|โโโโ | 32/100 [19:00<39:06, 34.51s/trial, best loss: -0.4836]
|
| 190 |
33%|โโโโ | 33/100 [19:37<39:24, 35.29s/trial, best loss: -0.4836]
|
| 191 |
34%|โโโโ | 34/100 [20:20<41:17, 37.54s/trial, best loss: -0.4836]
|
| 192 |
35%|โโโโ | 35/100 [20:46<36:49, 33.99s/trial, best loss: -0.4836]
|
| 193 |
36%|โโโโ | 36/100 [21:42<43:21, 40.65s/trial, best loss: -0.4836]
|
| 194 |
37%|โโโโ | 37/100 [22:19<41:21, 39.38s/trial, best loss: -0.4836]
|
| 195 |
38%|โโโโ | 38/100 [23:07<43:38, 42.23s/trial, best loss: -0.4836]
|
| 196 |
39%|โโโโ | 39/100 [23:30<36:47, 36.19s/trial, best loss: -0.4836]
|
| 197 |
40%|โโโโ | 40/100 [24:00<34:29, 34.49s/trial, best loss: -0.4836]
|
| 198 |
41%|โโโโ | 41/100 [24:30<32:32, 33.10s/trial, best loss: -0.4836]
|
| 199 |
42%|โโโโโ | 42/100 [24:56<29:53, 30.93s/trial, best loss: -0.4836]
|
| 200 |
43%|โโโโโ | 43/100 [25:27<29:21, 30.90s/trial, best loss: -0.4836]
|
| 201 |
44%|โโโโโ | 44/100 [25:50<26:44, 28.65s/trial, best loss: -0.4836]
|
| 202 |
45%|โโโโโ | 45/100 [26:40<32:11, 35.13s/trial, best loss: -0.4836]
|
| 203 |
46%|โโโโโ | 46/100 [27:16<31:53, 35.43s/trial, best loss: -0.4836]
|
| 204 |
47%|โโโโโ | 47/100 [27:57<32:41, 37.01s/trial, best loss: -0.4836]
|
| 205 |
48%|โโโโโ | 48/100 [28:48<35:47, 41.30s/trial, best loss: -0.4836]
|
| 206 |
49%|โโโโโ | 49/100 [29:27<34:26, 40.53s/trial, best loss: -0.4836]
|
| 207 |
50%|โโโโโ | 50/100 [29:54<30:25, 36.51s/trial, best loss: -0.4836]
|
| 208 |
51%|โโโโโ | 51/100 [30:53<35:10, 43.06s/trial, best loss: -0.4836]
|
| 209 |
52%|โโโโโโ | 52/100 [31:20<30:35, 38.24s/trial, best loss: -0.4836]
|
| 210 |
53%|โโโโโโ | 53/100 [31:53<28:54, 36.90s/trial, best loss: -0.4836]
|
| 211 |
54%|โโโโโโ | 54/100 [33:09<37:07, 48.43s/trial, best loss: -0.4836]
|
| 212 |
55%|โโโโโโ | 55/100 [33:34<31:10, 41.56s/trial, best loss: -0.4836]
|
| 213 |
56%|โโโโโโ | 56/100 [33:56<26:01, 35.48s/trial, best loss: -0.4836]
|
| 214 |
57%|โโโโโโ | 57/100 [34:25<24:02, 33.54s/trial, best loss: -0.4836]
|
| 215 |
58%|โโโโโโ | 58/100 [35:00<23:51, 34.09s/trial, best loss: -0.4836]
|
| 216 |
59%|โโโโโโ | 59/100 [35:53<27:15, 39.88s/trial, best loss: -0.4836]
|
| 217 |
60%|โโโโโโ | 60/100 [36:31<26:10, 39.26s/trial, best loss: -0.4836]
|
| 218 |
61%|โโโโโโ | 61/100 [36:57<22:56, 35.30s/trial, best loss: -0.4836]
|
| 219 |
62%|โโโโโโโ | 62/100 [37:32<22:11, 35.04s/trial, best loss: -0.4836]
|
| 220 |
63%|โโโโโโโ | 63/100 [37:57<19:47, 32.11s/trial, best loss: -0.4836]
|
| 221 |
64%|โโโโโโโ | 64/100 [38:23<18:11, 30.33s/trial, best loss: -0.4836]
|
| 222 |
65%|โโโโโโโ | 65/100 [39:08<20:11, 34.62s/trial, best loss: -0.4836]
|
| 223 |
66%|โโโโโโโ | 66/100 [39:40<19:14, 33.96s/trial, best loss: -0.4836]
|
| 224 |
67%|โโโโโโโ | 67/100 [40:11<18:06, 32.93s/trial, best loss: -0.4836]
|
| 225 |
68%|โโโโโโโ | 68/100 [40:36<16:23, 30.74s/trial, best loss: -0.4836]
|
| 226 |
69%|โโโโโโโ | 69/100 [41:04<15:20, 29.70s/trial, best loss: -0.4836]
|
| 227 |
70%|โโโโโโโ | 70/100 [41:31<14:34, 29.15s/trial, best loss: -0.4836]
|
| 228 |
71%|โโโโโโโ | 71/100 [41:55<13:17, 27.51s/trial, best loss: -0.4836]
|
| 229 |
72%|โโโโโโโโ | 72/100 [42:36<14:45, 31.64s/trial, best loss: -0.4836]
|
| 230 |
73%|โโโโโโโโ | 73/100 [43:06<13:58, 31.06s/trial, best loss: -0.4836]
|
| 231 |
74%|โโโโโโโโ | 74/100 [43:34<12:59, 29.97s/trial, best loss: -0.4836]
|
| 232 |
75%|โโโโโโโโ | 75/100 [44:05<12:43, 30.53s/trial, best loss: -0.4836]
|
| 233 |
76%|โโโโโโโโ | 76/100 [44:46<13:24, 33.52s/trial, best loss: -0.4836]
|
| 234 |
77%|โโโโโโโโ | 77/100 [45:22<13:09, 34.35s/trial, best loss: -0.4836]
|
| 235 |
78%|โโโโโโโโ | 78/100 [45:53<12:11, 33.24s/trial, best loss: -0.4836]
|
| 236 |
79%|โโโโโโโโ | 79/100 [46:20<10:58, 31.38s/trial, best loss: -0.4836]
|
| 237 |
80%|โโโโโโโโ | 80/100 [46:45<09:51, 29.59s/trial, best loss: -0.4836]
|
| 238 |
81%|โโโโโโโโ | 81/100 [47:20<09:53, 31.23s/trial, best loss: -0.4836]
|
| 239 |
82%|โโโโโโโโโ | 82/100 [47:51<09:19, 31.11s/trial, best loss: -0.4836]
|
| 240 |
83%|โโโโโโโโโ | 83/100 [48:23<08:55, 31.49s/trial, best loss: -0.4836]
|
| 241 |
84%|โโโโโโโโโ | 84/100 [49:06<09:14, 34.66s/trial, best loss: -0.4836]
|
| 242 |
85%|โโโโโโโโโ | 85/100 [49:31<07:59, 31.94s/trial, best loss: -0.4836]
|
| 243 |
86%|โโโโโโโโโ | 86/100 [50:18<08:28, 36.32s/trial, best loss: -0.4836]
|
| 244 |
87%|โโโโโโโโโ | 87/100 [51:01<08:20, 38.50s/trial, best loss: -0.4836]
|
| 245 |
88%|โโโโโโโโโ | 88/100 [52:08<09:24, 47.02s/trial, best loss: -0.4836]
|
| 246 |
89%|โโโโโโโโโ | 89/100 [52:57<08:43, 47.60s/trial, best loss: -0.4836]
|
| 247 |
90%|โโโโโโโโโ | 90/100 [53:37<07:31, 45.17s/trial, best loss: -0.4836]
|
| 248 |
91%|โโโโโโโโโ | 91/100 [54:28<07:04, 47.18s/trial, best loss: -0.4836]
|
| 249 |
92%|โโโโโโโโโโ| 92/100 [55:14<06:13, 46.70s/trial, best loss: -0.4836]
|
| 250 |
93%|โโโโโโโโโโ| 93/100 [56:21<06:08, 52.71s/trial, best loss: -0.4836]
|
| 251 |
94%|โโโโโโโโโโ| 94/100 [57:02<04:55, 49.27s/trial, best loss: -0.4836]
|
| 252 |
95%|โโโโโโโโโโ| 95/100 [57:39<03:48, 45.62s/trial, best loss: -0.4836]
|
| 253 |
96%|โโโโโโโโโโ| 96/100 [58:33<03:12, 48.15s/trial, best loss: -0.4836]
|
| 254 |
97%|โโโโโโโโโโ| 97/100 [59:14<02:17, 45.95s/trial, best loss: -0.4836]
|
| 255 |
98%|โโโโโโโโโโ| 98/100 [59:54<01:28, 44.22s/trial, best loss: -0.4836]
|
| 256 |
99%|โโโโโโโโโโ| 99/100 [1:00:48<00:47, 47.12s/trial, best loss: -0.4836]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 258 |
1%| | 1/100 [00:18<31:06, 18.85s/trial, best loss: -0.3977]
|
| 259 |
2%|โ | 2/100 [00:59<52:04, 31.88s/trial, best loss: -0.4107]
|
| 260 |
3%|โ | 3/100 [01:25<46:42, 28.89s/trial, best loss: -0.4107]
|
| 261 |
4%|โ | 4/100 [02:15<59:36, 37.25s/trial, best loss: -0.4107]
|
| 262 |
5%|โ | 5/100 [02:48<56:54, 35.94s/trial, best loss: -0.4107]
|
| 263 |
6%|โ | 6/100 [03:16<52:00, 33.20s/trial, best loss: -0.4107]
|
| 264 |
7%|โ | 7/100 [04:01<57:30, 37.10s/trial, best loss: -0.4107]
|
| 265 |
8%|โ | 8/100 [04:43<58:56, 38.44s/trial, best loss: -0.4107]
|
| 266 |
9%|โ | 9/100 [05:10<52:53, 34.88s/trial, best loss: -0.4107]
|
| 267 |
10%|โ | 10/100 [05:34<47:28, 31.65s/trial, best loss: -0.4107]
|
| 268 |
11%|โ | 11/100 [06:25<55:28, 37.39s/trial, best loss: -0.4107]
|
| 269 |
12%|โโ | 12/100 [06:52<50:33, 34.47s/trial, best loss: -0.4107]
|
| 270 |
13%|โโ | 13/100 [07:15<44:44, 30.85s/trial, best loss: -0.4155]
|
| 271 |
14%|โโ | 14/100 [07:47<44:52, 31.31s/trial, best loss: -0.4155]
|
| 272 |
15%|โโ | 15/100 [08:10<40:45, 28.77s/trial, best loss: -0.4161]
|
| 273 |
16%|โโ | 16/100 [08:33<37:35, 26.85s/trial, best loss: -0.4161]
|
| 274 |
17%|โโ | 17/100 [09:15<43:36, 31.53s/trial, best loss: -0.4161]
|
| 275 |
18%|โโ | 18/100 [09:51<45:05, 32.99s/trial, best loss: -0.4161]
|
| 276 |
19%|โโ | 19/100 [10:14<40:11, 29.77s/trial, best loss: -0.4161]
|
| 277 |
20%|โโ | 20/100 [11:04<48:02, 36.03s/trial, best loss: -0.4161]
|
| 278 |
21%|โโ | 21/100 [11:25<41:14, 31.32s/trial, best loss: -0.4203]
|
| 279 |
22%|โโโ | 22/100 [11:51<38:51, 29.89s/trial, best loss: -0.4203]
|
| 280 |
23%|โโโ | 23/100 [12:16<36:18, 28.29s/trial, best loss: -0.4203]
|
| 281 |
24%|โโโ | 24/100 [12:42<35:07, 27.72s/trial, best loss: -0.4203]
|
| 282 |
25%|โโโ | 25/100 [13:04<32:21, 25.88s/trial, best loss: -0.4203]
|
| 283 |
26%|โโโ | 26/100 [13:25<30:16, 24.54s/trial, best loss: -0.4203]
|
| 284 |
27%|โโโ | 27/100 [13:46<28:42, 23.60s/trial, best loss: -0.4203]
|
| 285 |
28%|โโโ | 28/100 [14:08<27:40, 23.06s/trial, best loss: -0.4203]
|
| 286 |
29%|โโโ | 29/100 [14:33<27:46, 23.47s/trial, best loss: -0.4203]
|
| 287 |
30%|โโโ | 30/100 [14:53<26:12, 22.46s/trial, best loss: -0.4207]
|
| 288 |
31%|โโโ | 31/100 [15:14<25:33, 22.22s/trial, best loss: -0.4254]
|
| 289 |
32%|โโโโ | 32/100 [15:36<24:48, 21.90s/trial, best loss: -0.4254]
|
| 290 |
33%|โโโโ | 33/100 [15:57<24:20, 21.80s/trial, best loss: -0.4254]
|
| 291 |
34%|โโโโ | 34/100 [16:19<23:58, 21.79s/trial, best loss: -0.4254]
|
| 292 |
35%|โโโโ | 35/100 [16:47<25:30, 23.55s/trial, best loss: -0.4254]
|
| 293 |
36%|โโโโ | 36/100 [17:12<25:35, 24.00s/trial, best loss: -0.4254]
|
| 294 |
37%|โโโโ | 37/100 [17:34<24:35, 23.42s/trial, best loss: -0.4254]
|
| 295 |
38%|โโโโ | 38/100 [18:02<25:41, 24.86s/trial, best loss: -0.4254]
|
| 296 |
39%|โโโโ | 39/100 [18:24<24:19, 23.93s/trial, best loss: -0.4254]
|
| 297 |
40%|โโโโ | 40/100 [18:50<24:31, 24.52s/trial, best loss: -0.4254]
|
| 298 |
41%|โโโโ | 41/100 [19:17<25:04, 25.51s/trial, best loss: -0.4254]
|
| 299 |
42%|โโโโโ | 42/100 [19:50<26:51, 27.78s/trial, best loss: -0.4254]
|
| 300 |
43%|โโโโโ | 43/100 [20:16<25:36, 26.96s/trial, best loss: -0.4254]
|
| 301 |
44%|โโโโโ | 44/100 [20:49<27:04, 29.00s/trial, best loss: -0.4254]
|
| 302 |
45%|โโโโโ | 45/100 [21:07<23:36, 25.75s/trial, best loss: -0.4254]
|
| 303 |
46%|โโโโโ | 46/100 [21:26<21:14, 23.60s/trial, best loss: -0.4254]
|
| 304 |
47%|โโโโโ | 47/100 [21:49<20:41, 23.42s/trial, best loss: -0.4254]
|
| 305 |
48%|โโโโโ | 48/100 [22:09<19:27, 22.45s/trial, best loss: -0.4254]
|
| 306 |
49%|โโโโโ | 49/100 [23:08<28:18, 33.30s/trial, best loss: -0.4254]
|
| 307 |
50%|โโโโโ | 50/100 [23:33<25:45, 30.90s/trial, best loss: -0.4254]
|
| 308 |
51%|โโโโโ | 51/100 [23:54<22:51, 27.99s/trial, best loss: -0.4254]
|
| 309 |
52%|โโโโโโ | 52/100 [24:46<28:08, 35.17s/trial, best loss: -0.4255]
|
| 310 |
53%|โโโโโโ | 53/100 [25:19<26:54, 34.35s/trial, best loss: -0.4255]
|
| 311 |
54%|โโโโโโ | 54/100 [26:00<27:54, 36.41s/trial, best loss: -0.4255]
|
| 312 |
55%|โโโโโโ | 55/100 [26:52<30:51, 41.14s/trial, best loss: -0.4255]
|
| 313 |
56%|โโโโโโ | 56/100 [27:21<27:32, 37.55s/trial, best loss: -0.4255]
|
| 314 |
57%|โโโโโโ | 57/100 [27:54<25:48, 36.01s/trial, best loss: -0.4255]
|
| 315 |
58%|โโโโโโ | 58/100 [28:38<27:00, 38.59s/trial, best loss: -0.4308]
|
| 316 |
59%|โโโโโโ | 59/100 [29:22<27:21, 40.03s/trial, best loss: -0.4308]
|
| 317 |
60%|โโโโโโ | 60/100 [29:55<25:16, 37.92s/trial, best loss: -0.4308]
|
| 318 |
61%|โโโโโโ | 61/100 [30:42<26:27, 40.70s/trial, best loss: -0.4308]
|
| 319 |
62%|โโโโโโโ | 62/100 [31:22<25:35, 40.40s/trial, best loss: -0.4308]
|
| 320 |
63%|โโโโโโโ | 63/100 [32:08<26:04, 42.29s/trial, best loss: -0.4308]
|
| 321 |
64%|โโโโโโโ | 64/100 [32:58<26:41, 44.49s/trial, best loss: -0.4308]
|
| 322 |
65%|โโโโโโโ | 65/100 [33:35<24:39, 42.28s/trial, best loss: -0.4308]
|
| 323 |
66%|โโโโโโโ | 66/100 [34:26<25:30, 45.01s/trial, best loss: -0.4308]
|
| 324 |
67%|โโโโโโโ | 67/100 [35:12<24:52, 45.21s/trial, best loss: -0.4308]
|
| 325 |
68%|โโโโโโโ | 68/100 [36:03<25:03, 47.00s/trial, best loss: -0.4308]
|
| 326 |
69%|โโโโโโโ | 69/100 [36:49<24:05, 46.63s/trial, best loss: -0.4308]
|
| 327 |
70%|โโโโโโโ | 70/100 [37:31<22:40, 45.35s/trial, best loss: -0.4308]
|
| 328 |
71%|โโโโโโโ | 71/100 [38:07<20:28, 42.35s/trial, best loss: -0.4308]
|
| 329 |
72%|โโโโโโโโ | 72/100 [38:45<19:12, 41.15s/trial, best loss: -0.4308]
|
| 330 |
73%|โโโโโโโโ | 73/100 [39:21<17:45, 39.48s/trial, best loss: -0.4308]
|
| 331 |
74%|โโโโโโโโ | 74/100 [39:55<16:22, 37.80s/trial, best loss: -0.4308]
|
| 332 |
75%|โโโโโโโโ | 75/100 [40:30<15:26, 37.07s/trial, best loss: -0.4308]
|
| 333 |
76%|โโโโโโโโ | 76/100 [41:12<15:22, 38.43s/trial, best loss: -0.4308]
|
| 334 |
77%|โโโโโโโโ | 77/100 [41:43<13:55, 36.31s/trial, best loss: -0.4308]
|
| 335 |
78%|โโโโโโโโ | 78/100 [42:09<12:10, 33.21s/trial, best loss: -0.4308]
|
| 336 |
79%|โโโโโโโโ | 79/100 [42:37<11:02, 31.57s/trial, best loss: -0.4308]
|
| 337 |
80%|โโโโโโโโ | 80/100 [43:10<10:44, 32.23s/trial, best loss: -0.4308]
|
| 338 |
81%|โโโโโโโโ | 81/100 [43:46<10:28, 33.10s/trial, best loss: -0.4308]
|
| 339 |
82%|โโโโโโโโโ | 82/100 [44:40<11:49, 39.44s/trial, best loss: -0.4317]
|
| 340 |
83%|โโโโโโโโโ | 83/100 [45:16<10:55, 38.57s/trial, best loss: -0.4317]
|
| 341 |
84%|โโโโโโโโโ | 84/100 [46:07<11:13, 42.10s/trial, best loss: -0.4317]
|
| 342 |
85%|โโโโโโโโโ | 85/100 [47:05<11:43, 46.91s/trial, best loss: -0.4317]
|
| 343 |
86%|โโโโโโโโโ | 86/100 [47:54<11:05, 47.51s/trial, best loss: -0.4317]
|
| 344 |
87%|โโโโโโโโโ | 87/100 [48:33<09:44, 44.98s/trial, best loss: -0.4317]
|
| 345 |
88%|โโโโโโโโโ | 88/100 [48:57<07:46, 38.87s/trial, best loss: -0.4317]
|
| 346 |
89%|โโโโโโโโโ | 89/100 [49:25<06:31, 35.56s/trial, best loss: -0.4317]
|
| 347 |
90%|โโโโโโโโโ | 90/100 [50:23<07:01, 42.18s/trial, best loss: -0.4339]
|
| 348 |
91%|โโโโโโโโโ | 91/100 [51:11<06:35, 43.97s/trial, best loss: -0.4339]
|
| 349 |
92%|โโโโโโโโโโ| 92/100 [52:08<06:21, 47.75s/trial, best loss: -0.4339]
|
| 350 |
93%|โโโโโโโโโโ| 93/100 [52:49<05:21, 45.99s/trial, best loss: -0.4339]
|
| 351 |
94%|โโโโโโโโโโ| 94/100 [53:41<04:45, 47.66s/trial, best loss: -0.4339]
|
| 352 |
95%|โโโโโโโโโโ| 95/100 [54:27<03:56, 47.24s/trial, best loss: -0.4339]
|
| 353 |
96%|โโโโโโโโโโ| 96/100 [55:20<03:14, 48.75s/trial, best loss: -0.4339]
|
| 354 |
97%|โโโโโโโโโโ| 97/100 [55:47<02:06, 42.27s/trial, best loss: -0.4339]
|
| 355 |
98%|โโโโโโโโโโ| 98/100 [56:52<01:38, 49.05s/trial, best loss: -0.4339]
|
| 356 |
99%|โโโโโโโโโโ| 99/100 [57:25<00:44, 44.40s/trial, best loss: -0.4339]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 358 |
1%| | 1/100 [00:28<47:17, 28.66s/trial, best loss: -0.4792]
|
| 359 |
2%|โ | 2/100 [01:38<1:25:59, 52.65s/trial, best loss: -0.4833]
|
| 360 |
3%|โ | 3/100 [02:12<1:11:30, 44.23s/trial, best loss: -0.4833]
|
| 361 |
4%|โ | 4/100 [02:44<1:02:52, 39.29s/trial, best loss: -0.4833]
|
| 362 |
5%|โ | 5/100 [03:08<53:32, 33.81s/trial, best loss: -0.4833]
|
| 363 |
6%|โ | 6/100 [03:41<52:46, 33.68s/trial, best loss: -0.4833]
|
| 364 |
7%|โ | 7/100 [04:23<56:25, 36.40s/trial, best loss: -0.4833]
|
| 365 |
8%|โ | 8/100 [05:32<1:11:34, 46.68s/trial, best loss: -0.4833]
|
| 366 |
9%|โ | 9/100 [06:02<1:02:47, 41.41s/trial, best loss: -0.4864]
|
| 367 |
10%|โ | 10/100 [07:04<1:12:04, 48.05s/trial, best loss: -0.4864]
|
| 368 |
11%|โ | 11/100 [07:31<1:01:24, 41.40s/trial, best loss: -0.4864]
|
| 369 |
12%|โโ | 12/100 [07:54<52:32, 35.82s/trial, best loss: -0.4864]
|
| 370 |
13%|โโ | 13/100 [09:06<1:07:45, 46.72s/trial, best loss: -0.4878]
|
| 371 |
14%|โโ | 14/100 [09:35<59:23, 41.44s/trial, best loss: -0.4878]
|
| 372 |
15%|โโ | 15/100 [10:15<58:02, 40.98s/trial, best loss: -0.4878]
|
| 373 |
16%|โโ | 16/100 [10:42<51:40, 36.91s/trial, best loss: -0.4878]
|
| 374 |
17%|โโ | 17/100 [11:16<49:36, 35.86s/trial, best loss: -0.4878]
|
| 375 |
18%|โโ | 18/100 [11:59<52:13, 38.21s/trial, best loss: -0.4878]
|
| 376 |
19%|โโ | 19/100 [12:54<58:10, 43.09s/trial, best loss: -0.4878]
|
| 377 |
20%|โโ | 20/100 [13:18<50:04, 37.56s/trial, best loss: -0.4878]
|
| 378 |
21%|โโ | 21/100 [14:05<53:03, 40.30s/trial, best loss: -0.4878]
|
| 379 |
22%|โโโ | 22/100 [14:40<50:06, 38.54s/trial, best loss: -0.4878]
|
| 380 |
23%|โโโ | 23/100 [15:37<56:52, 44.32s/trial, best loss: -0.4878]
|
| 381 |
24%|โโโ | 24/100 [16:00<47:53, 37.81s/trial, best loss: -0.4878]
|
| 382 |
25%|โโโ | 25/100 [17:12<1:00:06, 48.08s/trial, best loss: -0.4878]
|
| 383 |
26%|โโโ | 26/100 [17:39<51:24, 41.69s/trial, best loss: -0.4878]
|
| 384 |
27%|โโโ | 27/100 [18:33<55:09, 45.34s/trial, best loss: -0.4878]
|
| 385 |
28%|โโโ | 28/100 [19:15<53:28, 44.56s/trial, best loss: -0.4878]
|
| 386 |
29%|โโโ | 29/100 [19:59<52:25, 44.30s/trial, best loss: -0.4878]
|
| 387 |
30%|โโโ | 30/100 [20:24<44:59, 38.56s/trial, best loss: -0.4878]
|
| 388 |
31%|โโโ | 31/100 [21:21<50:25, 43.84s/trial, best loss: -0.4878]
|
| 389 |
32%|โโโโ | 32/100 [22:25<56:51, 50.17s/trial, best loss: -0.4878]
|
| 390 |
33%|โโโโ | 33/100 [22:54<48:42, 43.62s/trial, best loss: -0.4878]
|
| 391 |
34%|โโโโ | 34/100 [23:21<42:43, 38.84s/trial, best loss: -0.4894]
|
| 392 |
35%|โโโโ | 35/100 [23:52<39:29, 36.46s/trial, best loss: -0.4894]
|
| 393 |
36%|โโโโ | 36/100 [24:14<34:09, 32.02s/trial, best loss: -0.4894]
|
| 394 |
37%|โโโโ | 37/100 [25:02<38:37, 36.79s/trial, best loss: -0.4894]
|
| 395 |
38%|โโโโ | 38/100 [25:30<35:24, 34.27s/trial, best loss: -0.4894]
|
| 396 |
39%|โโโโ | 39/100 [26:02<34:10, 33.62s/trial, best loss: -0.4894]
|
| 397 |
40%|โโโโ | 40/100 [26:31<31:57, 31.97s/trial, best loss: -0.4894]
|
| 398 |
41%|โโโโ | 41/100 [27:05<32:16, 32.82s/trial, best loss: -0.4894]
|
| 399 |
42%|โโโโโ | 42/100 [27:45<33:44, 34.91s/trial, best loss: -0.4894]
|
| 400 |
43%|โโโโโ | 43/100 [28:17<32:15, 33.95s/trial, best loss: -0.4894]
|
| 401 |
44%|โโโโโ | 44/100 [28:50<31:28, 33.72s/trial, best loss: -0.4894]
|
| 402 |
45%|โโโโโ | 45/100 [29:24<30:56, 33.75s/trial, best loss: -0.4894]
|
| 403 |
46%|โโโโโ | 46/100 [30:01<31:23, 34.88s/trial, best loss: -0.4894]
|
| 404 |
47%|โโโโโ | 47/100 [30:38<31:23, 35.54s/trial, best loss: -0.4894]
|
| 405 |
48%|โโโโโ | 48/100 [31:05<28:20, 32.71s/trial, best loss: -0.4894]
|
| 406 |
49%|โโโโโ | 49/100 [31:46<30:03, 35.36s/trial, best loss: -0.4894]
|
| 407 |
50%|โโโโโ | 50/100 [32:24<30:08, 36.17s/trial, best loss: -0.4894]
|
| 408 |
51%|โโโโโ | 51/100 [33:17<33:40, 41.24s/trial, best loss: -0.4894]
|
| 409 |
52%|โโโโโโ | 52/100 [33:40<28:34, 35.72s/trial, best loss: -0.4894]
|
| 410 |
53%|โโโโโโ | 53/100 [34:57<37:33, 47.95s/trial, best loss: -0.4894]
|
| 411 |
54%|โโโโโโ | 54/100 [35:22<31:33, 41.17s/trial, best loss: -0.4894]
|
| 412 |
55%|โโโโโโ | 55/100 [36:12<32:59, 43.98s/trial, best loss: -0.4894]
|
| 413 |
56%|โโโโโโ | 56/100 [36:39<28:21, 38.67s/trial, best loss: -0.4894]
|
| 414 |
57%|โโโโโโ | 57/100 [37:38<32:05, 44.79s/trial, best loss: -0.4894]
|
| 415 |
58%|โโโโโโ | 58/100 [38:18<30:26, 43.49s/trial, best loss: -0.4894]
|
| 416 |
59%|โโโโโโ | 59/100 [38:46<26:35, 38.90s/trial, best loss: -0.4894]
|
| 417 |
60%|โโโโโโ | 60/100 [39:14<23:41, 35.55s/trial, best loss: -0.4894]
|
| 418 |
61%|โโโโโโ | 61/100 [40:09<26:51, 41.32s/trial, best loss: -0.4894]
|
| 419 |
62%|โโโโโโโ | 62/100 [40:48<25:48, 40.76s/trial, best loss: -0.4894]
|
| 420 |
63%|โโโโโโโ | 63/100 [41:20<23:25, 37.97s/trial, best loss: -0.4894]
|
| 421 |
64%|โโโโโโโ | 64/100 [41:54<22:03, 36.77s/trial, best loss: -0.4894]
|
| 422 |
65%|โโโโโโโ | 65/100 [42:27<20:53, 35.82s/trial, best loss: -0.4894]
|
| 423 |
66%|โโโโโโโ | 66/100 [43:12<21:46, 38.42s/trial, best loss: -0.4894]
|
| 424 |
67%|โโโโโโโ | 67/100 [43:46<20:25, 37.13s/trial, best loss: -0.4894]
|
| 425 |
68%|โโโโโโโ | 68/100 [44:18<19:00, 35.65s/trial, best loss: -0.4894]
|
| 426 |
69%|โโโโโโโ | 69/100 [44:52<18:09, 35.16s/trial, best loss: -0.4894]
|
| 427 |
70%|โโโโโโโ | 70/100 [45:42<19:50, 39.67s/trial, best loss: -0.4894]
|
| 428 |
71%|โโโโโโโ | 71/100 [46:24<19:24, 40.15s/trial, best loss: -0.4894]
|
| 429 |
72%|โโโโโโโโ | 72/100 [46:52<17:05, 36.63s/trial, best loss: -0.4901]
|
| 430 |
73%|โโโโโโโโ | 73/100 [47:36<17:26, 38.74s/trial, best loss: -0.4901]
|
| 431 |
74%|โโโโโโโโ | 74/100 [48:08<15:56, 36.80s/trial, best loss: -0.4901]
|
| 432 |
75%|โโโโโโโโ | 75/100 [48:34<14:00, 33.61s/trial, best loss: -0.4908]
|
| 433 |
76%|โโโโโโโโ | 76/100 [49:02<12:44, 31.84s/trial, best loss: -0.4908]
|
| 434 |
77%|โโโโโโโโ | 77/100 [49:28<11:29, 29.97s/trial, best loss: -0.4908]
|
| 435 |
78%|โโโโโโโโ | 78/100 [49:52<10:22, 28.28s/trial, best loss: -0.4908]
|
| 436 |
79%|โโโโโโโโ | 79/100 [50:21<10:01, 28.64s/trial, best loss: -0.4908]
|
| 437 |
80%|โโโโโโโโ | 80/100 [50:46<09:11, 27.56s/trial, best loss: -0.4908]
|
| 438 |
81%|โโโโโโโโ | 81/100 [51:16<08:53, 28.06s/trial, best loss: -0.4908]
|
| 439 |
82%|โโโโโโโโโ | 82/100 [51:46<08:36, 28.69s/trial, best loss: -0.4908]
|
| 440 |
83%|โโโโโโโโโ | 83/100 [52:15<08:10, 28.85s/trial, best loss: -0.4908]
|
| 441 |
84%|โโโโโโโโโ | 84/100 [52:46<07:51, 29.44s/trial, best loss: -0.4908]
|
| 442 |
85%|โโโโโโโโโ | 85/100 [53:12<07:08, 28.55s/trial, best loss: -0.4908]
|
| 443 |
86%|โโโโโโโโโ | 86/100 [53:43<06:48, 29.21s/trial, best loss: -0.4908]
|
| 444 |
87%|โโโโโโโโโ | 87/100 [54:08<06:03, 27.99s/trial, best loss: -0.4908]
|
| 445 |
88%|โโโโโโโโโ | 88/100 [54:32<05:20, 26.69s/trial, best loss: -0.4908]
|
| 446 |
89%|โโโโโโโโโ | 89/100 [54:56<04:45, 26.00s/trial, best loss: -0.4908]
|
| 447 |
90%|โโโโโโโโโ | 90/100 [55:31<04:45, 28.51s/trial, best loss: -0.4908]
|
| 448 |
91%|โโโโโโโโโ | 91/100 [56:00<04:20, 28.91s/trial, best loss: -0.4908]
|
| 449 |
92%|โโโโโโโโโโ| 92/100 [56:37<04:09, 31.18s/trial, best loss: -0.4908]
|
| 450 |
93%|โโโโโโโโโโ| 93/100 [57:05<03:31, 30.15s/trial, best loss: -0.4908]
|
| 451 |
94%|โโโโโโโโโโ| 94/100 [57:26<02:44, 27.48s/trial, best loss: -0.4908]
|
| 452 |
95%|โโโโโโโโโโ| 95/100 [57:53<02:16, 27.34s/trial, best loss: -0.4908]
|
| 453 |
96%|โโโโโโโโโโ| 96/100 [58:28<01:58, 29.56s/trial, best loss: -0.4908]
|
| 454 |
97%|โโโโโโโโโโ| 97/100 [58:53<01:24, 28.32s/trial, best loss: -0.4908]
|
| 455 |
98%|โโโโโโโโโโ| 98/100 [59:16<00:53, 26.57s/trial, best loss: -0.4908]
|
| 456 |
99%|โโโโโโโโโโ| 99/100 [59:58<00:31, 31.41s/trial, best loss: -0.4908]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 458 |
1%| | 1/100 [01:02<1:42:38, 62.20s/trial, best loss: -0.4807]
|
| 459 |
2%|โ | 2/100 [01:49<1:27:01, 53.28s/trial, best loss: -0.4841]
|
| 460 |
3%|โ | 3/100 [02:42<1:25:52, 53.12s/trial, best loss: -0.4848]
|
| 461 |
4%|โ | 4/100 [03:15<1:12:13, 45.14s/trial, best loss: -0.4916]
|
| 462 |
5%|โ | 5/100 [04:13<1:19:05, 49.96s/trial, best loss: -0.4916]
|
| 463 |
6%|โ | 6/100 [05:10<1:22:01, 52.35s/trial, best loss: -0.4916]
|
| 464 |
7%|โ | 7/100 [05:34<1:06:33, 42.94s/trial, best loss: -0.4916]
|
| 465 |
8%|โ | 8/100 [06:55<1:24:29, 55.10s/trial, best loss: -0.4916]
|
| 466 |
9%|โ | 9/100 [07:43<1:20:06, 52.82s/trial, best loss: -0.4916]
|
| 467 |
10%|โ | 10/100 [08:33<1:18:03, 52.04s/trial, best loss: -0.4916]
|
| 468 |
11%|โ | 11/100 [08:58<1:04:48, 43.69s/trial, best loss: -0.4916]
|
| 469 |
12%|โโ | 12/100 [09:36<1:01:44, 42.09s/trial, best loss: -0.4916]
|
| 470 |
13%|โโ | 13/100 [11:00<1:19:31, 54.85s/trial, best loss: -0.4916]
|
| 471 |
14%|โโ | 14/100 [12:01<1:21:08, 56.61s/trial, best loss: -0.4916]
|
| 472 |
15%|โโ | 15/100 [12:29<1:08:01, 48.02s/trial, best loss: -0.4916]
|
| 473 |
16%|โโ | 16/100 [13:15<1:06:13, 47.30s/trial, best loss: -0.4916]
|
| 474 |
17%|โโ | 17/100 [13:36<54:35, 39.46s/trial, best loss: -0.4916]
|
| 475 |
18%|โโ | 18/100 [14:34<1:01:25, 44.94s/trial, best loss: -0.4916]
|
| 476 |
19%|โโ | 19/100 [15:04<54:45, 40.56s/trial, best loss: -0.4916]
|
| 477 |
20%|โโ | 20/100 [16:14<1:05:52, 49.40s/trial, best loss: -0.4916]
|
| 478 |
21%|โโ | 21/100 [16:54<1:01:24, 46.64s/trial, best loss: -0.4971]
|
| 479 |
22%|โโโ | 22/100 [17:30<56:16, 43.29s/trial, best loss: -0.4971]
|
| 480 |
23%|โโโ | 23/100 [18:01<51:01, 39.77s/trial, best loss: -0.4971]
|
| 481 |
24%|โโโ | 24/100 [18:33<47:11, 37.25s/trial, best loss: -0.4971]
|
| 482 |
25%|โโโ | 25/100 [19:12<47:11, 37.75s/trial, best loss: -0.4971]
|
| 483 |
26%|โโโ | 26/100 [19:48<45:54, 37.22s/trial, best loss: -0.4971]
|
| 484 |
27%|โโโ | 27/100 [20:30<47:14, 38.83s/trial, best loss: -0.4971]
|
| 485 |
28%|โโโ | 28/100 [21:01<43:51, 36.55s/trial, best loss: -0.4971]
|
| 486 |
29%|โโโ | 29/100 [21:48<47:00, 39.73s/trial, best loss: -0.4971]
|
| 487 |
30%|โโโ | 30/100 [22:23<44:41, 38.30s/trial, best loss: -0.4971]
|
| 488 |
31%|โโโ | 31/100 [22:49<39:43, 34.54s/trial, best loss: -0.4971]
|
| 489 |
32%|โโโโ | 32/100 [23:13<35:34, 31.39s/trial, best loss: -0.4971]
|
| 490 |
33%|โโโโ | 33/100 [23:34<31:37, 28.32s/trial, best loss: -0.4971]
|
| 491 |
34%|โโโโ | 34/100 [24:14<35:00, 31.82s/trial, best loss: -0.4971]
|
| 492 |
35%|โโโโ | 35/100 [24:59<38:36, 35.64s/trial, best loss: -0.4971]
|
| 493 |
36%|โโโโ | 36/100 [25:35<38:10, 35.80s/trial, best loss: -0.4971]
|
| 494 |
37%|โโโโ | 37/100 [26:39<46:25, 44.22s/trial, best loss: -0.4971]
|
| 495 |
38%|โโโโ | 38/100 [27:04<39:35, 38.31s/trial, best loss: -0.4971]
|
| 496 |
39%|โโโโ | 39/100 [27:38<37:49, 37.20s/trial, best loss: -0.4971]
|
| 497 |
40%|โโโโ | 40/100 [28:10<35:45, 35.75s/trial, best loss: -0.4971]
|
| 498 |
41%|โโโโ | 41/100 [28:34<31:29, 32.03s/trial, best loss: -0.4971]
|
| 499 |
42%|โโโโโ | 42/100 [29:01<29:39, 30.67s/trial, best loss: -0.4971]
|
| 500 |
43%|โโโโโ | 43/100 [29:33<29:29, 31.05s/trial, best loss: -0.4971]
|
| 501 |
44%|โโโโโ | 44/100 [30:15<32:02, 34.33s/trial, best loss: -0.4971]
|
| 502 |
45%|โโโโโ | 45/100 [30:46<30:33, 33.34s/trial, best loss: -0.4971]
|
| 503 |
46%|โโโโโ | 46/100 [31:18<29:33, 32.84s/trial, best loss: -0.4971]
|
| 504 |
47%|โโโโโ | 47/100 [31:55<30:00, 33.97s/trial, best loss: -0.4971]
|
| 505 |
48%|โโโโโ | 48/100 [32:40<32:31, 37.52s/trial, best loss: -0.4971]
|
| 506 |
49%|โโโโโ | 49/100 [33:06<28:58, 34.08s/trial, best loss: -0.4971]
|
| 507 |
50%|โโโโโ | 50/100 [33:29<25:34, 30.69s/trial, best loss: -0.4971]
|
| 508 |
51%|โโโโโ | 51/100 [33:54<23:39, 28.96s/trial, best loss: -0.4971]
|
| 509 |
52%|โโโโโโ | 52/100 [34:21<22:42, 28.39s/trial, best loss: -0.4971]
|
| 510 |
53%|โโโโโโ | 53/100 [34:57<23:53, 30.51s/trial, best loss: -0.4971]
|
| 511 |
54%|โโโโโโ | 54/100 [35:35<25:16, 32.96s/trial, best loss: -0.4971]
|
| 512 |
55%|โโโโโโ | 55/100 [36:07<24:24, 32.54s/trial, best loss: -0.4971]
|
| 513 |
56%|โโโโโโ | 56/100 [37:12<31:05, 42.40s/trial, best loss: -0.4971]
|
| 514 |
57%|โโโโโโ | 57/100 [37:49<29:04, 40.57s/trial, best loss: -0.4971]
|
| 515 |
58%|โโโโโโ | 58/100 [38:23<27:06, 38.72s/trial, best loss: -0.4971]
|
| 516 |
59%|โโโโโโ | 59/100 [38:56<25:20, 37.08s/trial, best loss: -0.4971]
|
| 517 |
60%|โโโโโโ | 60/100 [39:30<24:08, 36.22s/trial, best loss: -0.4971]
|
| 518 |
61%|โโโโโโ | 61/100 [40:38<29:41, 45.69s/trial, best loss: -0.4971]
|
| 519 |
62%|โโโโโโโ | 62/100 [41:09<26:05, 41.21s/trial, best loss: -0.4971]
|
| 520 |
63%|โโโโโโโ | 63/100 [41:45<24:28, 39.69s/trial, best loss: -0.4971]
|
| 521 |
64%|โโโโโโโ | 64/100 [42:17<22:26, 37.40s/trial, best loss: -0.4971]
|
| 522 |
65%|โโโโโโโ | 65/100 [42:46<20:20, 34.88s/trial, best loss: -0.4971]
|
| 523 |
66%|โโโโโโโ | 66/100 [43:19<19:23, 34.21s/trial, best loss: -0.4994]
|
| 524 |
67%|โโโโโโโ | 67/100 [43:52<18:36, 33.85s/trial, best loss: -0.4994]
|
| 525 |
68%|โโโโโโโ | 68/100 [44:26<18:10, 34.08s/trial, best loss: -0.4994]
|
| 526 |
69%|โโโโโโโ | 69/100 [45:15<19:46, 38.27s/trial, best loss: -0.4994]
|
| 527 |
70%|โโโโโโโ | 70/100 [45:56<19:36, 39.23s/trial, best loss: -0.4994]
|
| 528 |
71%|โโโโโโโ | 71/100 [46:41<19:51, 41.09s/trial, best loss: -0.4994]
|
| 529 |
72%|โโโโโโโโ | 72/100 [47:26<19:44, 42.29s/trial, best loss: -0.4994]
|
| 530 |
73%|โโโโโโโโ | 73/100 [48:36<22:40, 50.38s/trial, best loss: -0.4994]
|
| 531 |
74%|โโโโโโโโ | 74/100 [49:12<20:01, 46.21s/trial, best loss: -0.4994]
|
| 532 |
75%|โโโโโโโโ | 75/100 [49:58<19:11, 46.04s/trial, best loss: -0.4994]
|
| 533 |
76%|โโโโโโโโ | 76/100 [50:36<17:24, 43.52s/trial, best loss: -0.4994]
|
| 534 |
77%|โโโโโโโโ | 77/100 [51:07<15:19, 39.98s/trial, best loss: -0.4994]
|
| 535 |
78%|โโโโโโโโ | 78/100 [52:08<16:54, 46.11s/trial, best loss: -0.4994]
|
| 536 |
79%|โโโโโโโโ | 79/100 [52:46<15:22, 43.92s/trial, best loss: -0.4994]
|
| 537 |
80%|โโโโโโโโ | 80/100 [53:27<14:18, 42.91s/trial, best loss: -0.4994]
|
| 538 |
81%|โโโโโโโโ | 81/100 [53:59<12:33, 39.67s/trial, best loss: -0.4994]
|
| 539 |
82%|โโโโโโโโโ | 82/100 [54:47<12:39, 42.19s/trial, best loss: -0.4994]
|
| 540 |
83%|โโโโโโโโโ | 83/100 [55:36<12:30, 44.15s/trial, best loss: -0.4994]
|
| 541 |
84%|โโโโโโโโโ | 84/100 [56:13<11:10, 41.89s/trial, best loss: -0.4994]
|
| 542 |
85%|โโโโโโโโโ | 85/100 [56:50<10:09, 40.66s/trial, best loss: -0.4994]
|
| 543 |
86%|โโโโโโโโโ | 86/100 [57:41<10:11, 43.69s/trial, best loss: -0.4994]
|
| 544 |
87%|โโโโโโโโโ | 87/100 [58:47<10:54, 50.36s/trial, best loss: -0.4994]
|
| 545 |
88%|โโโโโโโโโ | 88/100 [59:26<09:22, 46.84s/trial, best loss: -0.4994]
|
| 546 |
89%|โโโโโโโโโ | 89/100 [1:00:02<08:02, 43.84s/trial, best loss: -0.4994]
|
| 547 |
90%|โโโโโโโโโ | 90/100 [1:00:31<06:33, 39.38s/trial, best loss: -0.4994]
|
| 548 |
91%|โโโโโโโโโ | 91/100 [1:01:09<05:48, 38.76s/trial, best loss: -0.4994]
|
| 549 |
92%|โโโโโโโโโโ| 92/100 [1:01:45<05:04, 38.04s/trial, best loss: -0.4994]
|
| 550 |
93%|โโโโโโโโโโ| 93/100 [1:02:39<04:59, 42.76s/trial, best loss: -0.4994]
|
| 551 |
94%|โโโโโโโโโโ| 94/100 [1:03:06<03:48, 38.12s/trial, best loss: -0.4994]
|
| 552 |
95%|โโโโโโโโโโ| 95/100 [1:03:39<03:02, 36.58s/trial, best loss: -0.4994]
|
| 553 |
96%|โโโโโโโโโโ| 96/100 [1:04:16<02:26, 36.56s/trial, best loss: -0.4994]
|
| 554 |
97%|โโโโโโโโโโ| 97/100 [1:04:51<01:48, 36.21s/trial, best loss: -0.4994]
|
| 555 |
98%|โโโโโโโโโโ| 98/100 [1:05:15<01:05, 32.67s/trial, best loss: -0.4994]
|
| 556 |
99%|โโโโโโโโโโ| 99/100 [1:05:43<00:31, 31.21s/trial, best loss: -0.4994]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 558 |
1%| | 1/100 [00:54<1:30:09, 54.64s/trial, best loss: -0.5469]
|
| 559 |
2%|โ | 2/100 [01:19<1:00:47, 37.22s/trial, best loss: -0.5519]
|
| 560 |
3%|โ | 3/100 [01:50<55:12, 34.15s/trial, best loss: -0.5519]
|
| 561 |
4%|โ | 4/100 [02:25<55:19, 34.57s/trial, best loss: -0.5519]
|
| 562 |
5%|โ | 5/100 [03:31<1:12:51, 46.01s/trial, best loss: -0.5557]
|
| 563 |
6%|โ | 6/100 [04:02<1:03:56, 40.81s/trial, best loss: -0.5557]
|
| 564 |
7%|โ | 7/100 [04:30<56:42, 36.58s/trial, best loss: -0.5557]
|
| 565 |
8%|โ | 8/100 [05:14<59:48, 39.00s/trial, best loss: -0.5557]
|
| 566 |
9%|โ | 9/100 [05:44<54:59, 36.26s/trial, best loss: -0.5557]
|
| 567 |
10%|โ | 10/100 [06:26<56:54, 37.94s/trial, best loss: -0.5557]
|
| 568 |
11%|โ | 11/100 [06:56<52:53, 35.66s/trial, best loss: -0.5557]
|
| 569 |
12%|โโ | 12/100 [08:02<1:05:32, 44.69s/trial, best loss: -0.5557]
|
| 570 |
13%|โโ | 13/100 [08:46<1:04:34, 44.53s/trial, best loss: -0.5557]
|
| 571 |
14%|โโ | 14/100 [09:35<1:05:36, 45.77s/trial, best loss: -0.5557]
|
| 572 |
15%|โโ | 15/100 [10:59<1:21:31, 57.55s/trial, best loss: -0.5557]
|
| 573 |
16%|โโ | 16/100 [11:22<1:05:53, 47.07s/trial, best loss: -0.5557]
|
| 574 |
17%|โโ | 17/100 [12:15<1:07:27, 48.77s/trial, best loss: -0.5557]
|
| 575 |
18%|โโ | 18/100 [12:46<59:16, 43.37s/trial, best loss: -0.5557]
|
| 576 |
19%|โโ | 19/100 [13:18<54:13, 40.17s/trial, best loss: -0.5557]
|
| 577 |
20%|โโ | 20/100 [13:43<47:31, 35.64s/trial, best loss: -0.5557]
|
| 578 |
21%|โโ | 21/100 [14:13<44:40, 33.93s/trial, best loss: -0.5557]
|
| 579 |
22%|โโโ | 22/100 [15:23<58:03, 44.67s/trial, best loss: -0.5557]
|
| 580 |
23%|โโโ | 23/100 [15:46<49:03, 38.23s/trial, best loss: -0.5557]
|
| 581 |
24%|โโโ | 24/100 [16:16<45:01, 35.55s/trial, best loss: -0.5557]
|
| 582 |
25%|โโโ | 25/100 [16:48<43:17, 34.64s/trial, best loss: -0.5557]
|
| 583 |
26%|โโโ | 26/100 [17:28<44:29, 36.07s/trial, best loss: -0.5557]
|
| 584 |
27%|โโโ | 27/100 [17:55<40:51, 33.59s/trial, best loss: -0.5557]
|
| 585 |
28%|โโโ | 28/100 [18:25<39:01, 32.52s/trial, best loss: -0.556]
|
| 586 |
29%|โโโ | 29/100 [19:42<54:10, 45.78s/trial, best loss: -0.556]
|
| 587 |
30%|โโโ | 30/100 [20:16<49:15, 42.23s/trial, best loss: -0.556]
|
| 588 |
31%|โโโ | 31/100 [20:49<45:25, 39.50s/trial, best loss: -0.556]
|
| 589 |
32%|โโโโ | 32/100 [21:32<45:48, 40.41s/trial, best loss: -0.556]
|
| 590 |
33%|โโโโ | 33/100 [22:16<46:24, 41.57s/trial, best loss: -0.5567]
|
| 591 |
34%|โโโโ | 34/100 [22:57<45:31, 41.39s/trial, best loss: -0.5567]
|
| 592 |
35%|โโโโ | 35/100 [23:40<45:17, 41.81s/trial, best loss: -0.5567]
|
| 593 |
36%|โโโโ | 36/100 [24:46<52:33, 49.28s/trial, best loss: -0.5567]
|
| 594 |
37%|โโโโ | 37/100 [25:24<48:09, 45.86s/trial, best loss: -0.558]
|
| 595 |
38%|โโโโ | 38/100 [26:06<46:08, 44.65s/trial, best loss: -0.558]
|
| 596 |
39%|โโโโ | 39/100 [26:54<46:31, 45.76s/trial, best loss: -0.558]
|
| 597 |
40%|โโโโ | 40/100 [27:40<45:35, 45.60s/trial, best loss: -0.558]
|
| 598 |
41%|โโโโ | 41/100 [28:19<42:58, 43.71s/trial, best loss: -0.558]
|
| 599 |
42%|โโโโโ | 42/100 [29:14<45:34, 47.14s/trial, best loss: -0.558]
|
| 600 |
43%|โโโโโ | 43/100 [29:56<43:11, 45.47s/trial, best loss: -0.558]
|
| 601 |
44%|โโโโโ | 44/100 [30:58<47:01, 50.39s/trial, best loss: -0.558]
|
| 602 |
45%|โโโโโ | 45/100 [31:43<44:47, 48.86s/trial, best loss: -0.558]
|
| 603 |
46%|โโโโโ | 46/100 [32:39<46:01, 51.15s/trial, best loss: -0.558]
|
| 604 |
47%|โโโโโ | 47/100 [33:32<45:28, 51.48s/trial, best loss: -0.558]
|
| 605 |
48%|โโโโโ | 48/100 [34:10<41:20, 47.70s/trial, best loss: -0.558]
|
| 606 |
49%|โโโโโ | 49/100 [34:49<38:16, 45.04s/trial, best loss: -0.558]
|
| 607 |
50%|โโโโโ | 50/100 [35:28<35:54, 43.09s/trial, best loss: -0.558]
|
| 608 |
51%|โโโโโ | 51/100 [36:07<34:20, 42.06s/trial, best loss: -0.558]
|
| 609 |
52%|โโโโโโ | 52/100 [36:43<32:09, 40.19s/trial, best loss: -0.558]
|
| 610 |
53%|โโโโโโ | 53/100 [37:19<30:30, 38.94s/trial, best loss: -0.558]
|
| 611 |
54%|โโโโโโ | 54/100 [37:47<27:17, 35.59s/trial, best loss: -0.558]
|
| 612 |
55%|โโโโโโ | 55/100 [38:19<25:50, 34.45s/trial, best loss: -0.558]
|
| 613 |
56%|โโโโโโ | 56/100 [39:05<27:44, 37.83s/trial, best loss: -0.558]
|
| 614 |
57%|โโโโโโ | 57/100 [39:37<25:53, 36.12s/trial, best loss: -0.558]
|
| 615 |
58%|โโโโโโ | 58/100 [40:15<25:40, 36.67s/trial, best loss: -0.558]
|
| 616 |
59%|โโโโโโ | 59/100 [40:53<25:27, 37.25s/trial, best loss: -0.558]
|
| 617 |
60%|โโโโโโ | 60/100 [41:39<26:29, 39.73s/trial, best loss: -0.558]
|
| 618 |
61%|โโโโโโ | 61/100 [42:12<24:36, 37.85s/trial, best loss: -0.558]
|
| 619 |
62%|โโโโโโโ | 62/100 [42:45<22:55, 36.21s/trial, best loss: -0.558]
|
| 620 |
63%|โโโโโโโ | 63/100 [43:34<24:41, 40.05s/trial, best loss: -0.558]
|
| 621 |
64%|โโโโโโโ | 64/100 [43:56<20:46, 34.61s/trial, best loss: -0.558]
|
| 622 |
65%|โโโโโโโ | 65/100 [44:36<21:12, 36.36s/trial, best loss: -0.558]
|
| 623 |
66%|โโโโโโโ | 66/100 [45:08<19:49, 34.98s/trial, best loss: -0.558]
|
| 624 |
67%|โโโโโโโ | 67/100 [45:36<18:03, 32.83s/trial, best loss: -0.558]
|
| 625 |
68%|โโโโโโโ | 68/100 [46:02<16:32, 31.03s/trial, best loss: -0.558]
|
| 626 |
69%|โโโโโโโ | 69/100 [46:45<17:48, 34.45s/trial, best loss: -0.5588]
|
| 627 |
70%|โโโโโโโ | 70/100 [47:26<18:11, 36.38s/trial, best loss: -0.5588]
|
| 628 |
71%|โโโโโโโ | 71/100 [48:08<18:24, 38.10s/trial, best loss: -0.5588]
|
| 629 |
72%|โโโโโโโโ | 72/100 [48:40<16:57, 36.33s/trial, best loss: -0.5588]
|
| 630 |
73%|โโโโโโโโ | 73/100 [49:47<20:26, 45.41s/trial, best loss: -0.5588]
|
| 631 |
74%|โโโโโโโโ | 74/100 [50:25<18:42, 43.17s/trial, best loss: -0.5588]
|
| 632 |
75%|โโโโโโโโ | 75/100 [51:28<20:32, 49.28s/trial, best loss: -0.5588]
|
| 633 |
76%|โโโโโโโโ | 76/100 [52:21<20:06, 50.28s/trial, best loss: -0.5588]
|
| 634 |
77%|โโโโโโโโ | 77/100 [53:03<18:18, 47.74s/trial, best loss: -0.5588]
|
| 635 |
78%|โโโโโโโโ | 78/100 [53:47<17:11, 46.87s/trial, best loss: -0.5588]
|
| 636 |
79%|โโโโโโโโ | 79/100 [54:27<15:40, 44.78s/trial, best loss: -0.5588]
|
| 637 |
80%|โโโโโโโโ | 80/100 [55:22<15:58, 47.90s/trial, best loss: -0.5588]
|
| 638 |
81%|โโโโโโโโ | 81/100 [55:57<13:54, 43.91s/trial, best loss: -0.5588]
|
| 639 |
82%|โโโโโโโโโ | 82/100 [56:31<12:14, 40.78s/trial, best loss: -0.5588]
|
| 640 |
83%|โโโโโโโโโ | 83/100 [57:01<10:39, 37.63s/trial, best loss: -0.5588]
|
| 641 |
84%|โโโโโโโโโ | 84/100 [57:42<10:18, 38.68s/trial, best loss: -0.5588]
|
| 642 |
85%|โโโโโโโโโ | 85/100 [58:32<10:29, 41.95s/trial, best loss: -0.5588]
|
| 643 |
86%|โโโโโโโโโ | 86/100 [59:09<09:27, 40.52s/trial, best loss: -0.5588]
|
| 644 |
87%|โโโโโโโโโ | 87/100 [59:52<08:58, 41.40s/trial, best loss: -0.5588]
|
| 645 |
88%|โโโโโโโโโ | 88/100 [1:00:15<07:08, 35.74s/trial, best loss: -0.5588]
|
| 646 |
89%|โโโโโโโโโ | 89/100 [1:00:53<06:40, 36.37s/trial, best loss: -0.5588]
|
| 647 |
90%|โโโโโโโโโ | 90/100 [1:01:38<06:30, 39.04s/trial, best loss: -0.5588]
|
| 648 |
91%|โโโโโโโโโ | 91/100 [1:02:20<05:59, 39.93s/trial, best loss: -0.5588]
|
| 649 |
92%|โโโโโโโโโโ| 92/100 [1:03:11<05:45, 43.19s/trial, best loss: -0.5592]
|
| 650 |
93%|โโโโโโโโโโ| 93/100 [1:04:06<05:27, 46.72s/trial, best loss: -0.5592]
|
| 651 |
94%|โโโโโโโโโโ| 94/100 [1:05:23<05:34, 55.81s/trial, best loss: -0.5592]
|
| 652 |
95%|โโโโโโโโโโ| 95/100 [1:06:36<05:05, 61.13s/trial, best loss: -0.5592]
|
| 653 |
96%|โโโโโโโโโโ| 96/100 [1:07:16<03:39, 54.80s/trial, best loss: -0.5592]
|
| 654 |
97%|โโโโโโโโโโ| 97/100 [1:07:55<02:30, 50.12s/trial, best loss: -0.5592]
|
| 655 |
98%|โโโโโโโโโโ| 98/100 [1:08:36<01:34, 47.21s/trial, best loss: -0.5592]
|
| 656 |
99%|โโโโโโโโโโ| 99/100 [1:09:51<00:55, 55.54s/trial, best loss: -0.5592]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 657 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 658 |
1%| | 1/100 [01:13<2:01:00, 73.34s/trial, best loss: -0.5479]
|
| 659 |
2%|โ | 2/100 [01:43<1:18:00, 47.76s/trial, best loss: -0.5552]
|
| 660 |
3%|โ | 3/100 [02:04<57:22, 35.48s/trial, best loss: -0.558]
|
| 661 |
4%|โ | 4/100 [03:04<1:12:39, 45.41s/trial, best loss: -0.558]
|
| 662 |
5%|โ | 5/100 [03:45<1:09:30, 43.90s/trial, best loss: -0.558]
|
| 663 |
6%|โ | 6/100 [04:11<58:53, 37.59s/trial, best loss: -0.5639]
|
| 664 |
7%|โ | 7/100 [04:54<1:01:02, 39.38s/trial, best loss: -0.5639]
|
| 665 |
8%|โ | 8/100 [05:50<1:08:46, 44.86s/trial, best loss: -0.5639]
|
| 666 |
9%|โ | 9/100 [06:40<1:10:17, 46.34s/trial, best loss: -0.5639]
|
| 667 |
10%|โ | 10/100 [07:29<1:10:30, 47.01s/trial, best loss: -0.5639]
|
| 668 |
11%|โ | 11/100 [08:14<1:08:51, 46.42s/trial, best loss: -0.5639]
|
| 669 |
12%|โโ | 12/100 [08:33<56:03, 38.22s/trial, best loss: -0.5639]
|
| 670 |
13%|โโ | 13/100 [08:57<49:03, 33.84s/trial, best loss: -0.5639]
|
| 671 |
14%|โโ | 14/100 [09:20<43:45, 30.53s/trial, best loss: -0.5639]
|
| 672 |
15%|โโ | 15/100 [09:49<42:37, 30.09s/trial, best loss: -0.5639]
|
| 673 |
16%|โโ | 16/100 [11:05<1:01:44, 44.10s/trial, best loss: -0.5639]
|
| 674 |
17%|โโ | 17/100 [11:51<1:01:40, 44.58s/trial, best loss: -0.5639]
|
| 675 |
18%|โโ | 18/100 [12:21<55:03, 40.28s/trial, best loss: -0.5639]
|
| 676 |
19%|โโ | 19/100 [12:46<47:51, 35.45s/trial, best loss: -0.5639]
|
| 677 |
20%|โโ | 20/100 [13:30<50:43, 38.05s/trial, best loss: -0.5639]
|
| 678 |
21%|โโ | 21/100 [13:54<44:35, 33.86s/trial, best loss: -0.5639]
|
| 679 |
22%|โโโ | 22/100 [14:21<41:16, 31.75s/trial, best loss: -0.5639]
|
| 680 |
23%|โโโ | 23/100 [14:43<37:04, 28.89s/trial, best loss: -0.5639]
|
| 681 |
24%|โโโ | 24/100 [15:09<35:34, 28.08s/trial, best loss: -0.5639]
|
| 682 |
25%|โโโ | 25/100 [15:31<32:49, 26.26s/trial, best loss: -0.5639]
|
| 683 |
26%|โโโ | 26/100 [15:54<31:08, 25.25s/trial, best loss: -0.5639]
|
| 684 |
27%|โโโ | 27/100 [16:19<30:45, 25.28s/trial, best loss: -0.5639]
|
| 685 |
28%|โโโ | 28/100 [16:46<30:58, 25.81s/trial, best loss: -0.5639]
|
| 686 |
29%|โโโ | 29/100 [17:08<28:59, 24.51s/trial, best loss: -0.5639]
|
| 687 |
30%|โโโ | 30/100 [17:43<32:21, 27.74s/trial, best loss: -0.5639]
|
| 688 |
31%|โโโ | 31/100 [18:09<31:10, 27.11s/trial, best loss: -0.5639]
|
| 689 |
32%|โโโโ | 32/100 [18:37<31:01, 27.38s/trial, best loss: -0.5639]
|
| 690 |
33%|โโโโ | 33/100 [19:01<29:22, 26.31s/trial, best loss: -0.5639]
|
| 691 |
34%|โโโโ | 34/100 [19:30<30:00, 27.28s/trial, best loss: -0.5639]
|
| 692 |
35%|โโโโ | 35/100 [19:58<29:44, 27.46s/trial, best loss: -0.5639]
|
| 693 |
36%|โโโโ | 36/100 [20:22<28:19, 26.55s/trial, best loss: -0.5639]
|
| 694 |
37%|โโโโ | 37/100 [21:29<40:25, 38.50s/trial, best loss: -0.5639]
|
| 695 |
38%|โโโโ | 38/100 [21:51<34:50, 33.72s/trial, best loss: -0.5639]
|
| 696 |
39%|โโโโ | 39/100 [22:17<31:58, 31.44s/trial, best loss: -0.5639]
|
| 697 |
40%|โโโโ | 40/100 [22:41<28:57, 28.96s/trial, best loss: -0.5639]
|
| 698 |
41%|โโโโ | 41/100 [23:15<30:07, 30.63s/trial, best loss: -0.5639]
|
| 699 |
42%|โโโโโ | 42/100 [23:39<27:46, 28.74s/trial, best loss: -0.5639]
|
| 700 |
43%|โโโโโ | 43/100 [24:00<25:01, 26.34s/trial, best loss: -0.5639]
|
| 701 |
44%|โโโโโ | 44/100 [24:27<24:44, 26.51s/trial, best loss: -0.5639]
|
| 702 |
45%|โโโโโ | 45/100 [25:06<27:45, 30.28s/trial, best loss: -0.5639]
|
| 703 |
46%|โโโโโ | 46/100 [26:00<33:30, 37.23s/trial, best loss: -0.5639]
|
| 704 |
47%|โโโโโ | 47/100 [26:37<32:59, 37.35s/trial, best loss: -0.5639]
|
| 705 |
48%|โโโโโ | 48/100 [27:20<33:53, 39.11s/trial, best loss: -0.5639]
|
| 706 |
49%|โโโโโ | 49/100 [28:20<38:25, 45.22s/trial, best loss: -0.5639]
|
| 707 |
50%|โโโโโ | 50/100 [28:53<34:36, 41.53s/trial, best loss: -0.5639]
|
| 708 |
51%|โโโโโ | 51/100 [29:31<32:57, 40.36s/trial, best loss: -0.5639]
|
| 709 |
52%|โโโโโโ | 52/100 [30:14<32:59, 41.23s/trial, best loss: -0.5639]
|
| 710 |
53%|โโโโโโ | 53/100 [30:47<30:18, 38.70s/trial, best loss: -0.5639]
|
| 711 |
54%|โโโโโโ | 54/100 [31:18<28:03, 36.61s/trial, best loss: -0.5639]
|
| 712 |
55%|โโโโโโ | 55/100 [31:49<26:11, 34.93s/trial, best loss: -0.5639]
|
| 713 |
56%|โโโโโโ | 56/100 [32:46<30:26, 41.51s/trial, best loss: -0.5639]
|
| 714 |
57%|โโโโโโ | 57/100 [33:33<30:59, 43.25s/trial, best loss: -0.5639]
|
| 715 |
58%|โโโโโโ | 58/100 [34:05<27:50, 39.78s/trial, best loss: -0.5639]
|
| 716 |
59%|โโโโโโ | 59/100 [34:53<28:45, 42.09s/trial, best loss: -0.5639]
|
| 717 |
60%|โโโโโโ | 60/100 [35:17<24:35, 36.90s/trial, best loss: -0.5639]
|
| 718 |
61%|โโโโโโ | 61/100 [35:44<22:03, 33.93s/trial, best loss: -0.5639]
|
| 719 |
62%|โโโโโโโ | 62/100 [36:08<19:31, 30.83s/trial, best loss: -0.5639]
|
| 720 |
63%|โโโโโโโ | 63/100 [36:36<18:26, 29.91s/trial, best loss: -0.5639]
|
| 721 |
64%|โโโโโโโ | 64/100 [36:56<16:16, 27.13s/trial, best loss: -0.5639]
|
| 722 |
65%|โโโโโโโ | 65/100 [37:22<15:30, 26.57s/trial, best loss: -0.5639]
|
| 723 |
66%|โโโโโโโ | 66/100 [37:54<16:05, 28.41s/trial, best loss: -0.5655]
|
| 724 |
67%|โโโโโโโ | 67/100 [38:28<16:32, 30.06s/trial, best loss: -0.5655]
|
| 725 |
68%|โโโโโโโ | 68/100 [39:05<17:07, 32.12s/trial, best loss: -0.5655]
|
| 726 |
69%|โโโโโโโ | 69/100 [39:35<16:15, 31.48s/trial, best loss: -0.5655]
|
| 727 |
70%|โโโโโโโ | 70/100 [40:17<17:17, 34.58s/trial, best loss: -0.5655]
|
| 728 |
71%|โโโโโโโ | 71/100 [40:41<15:13, 31.49s/trial, best loss: -0.5655]
|
| 729 |
72%|โโโโโโโโ | 72/100 [41:26<16:34, 35.53s/trial, best loss: -0.5655]
|
| 730 |
73%|โโโโโโโโ | 73/100 [41:53<14:51, 33.02s/trial, best loss: -0.5655]
|
| 731 |
74%|โโโโโโโโ | 74/100 [42:31<14:57, 34.53s/trial, best loss: -0.5655]
|
| 732 |
75%|โโโโโโโโ | 75/100 [43:02<13:50, 33.22s/trial, best loss: -0.5655]
|
| 733 |
76%|โโโโโโโโ | 76/100 [43:46<14:37, 36.58s/trial, best loss: -0.5655]
|
| 734 |
77%|โโโโโโโโ | 77/100 [44:15<13:06, 34.20s/trial, best loss: -0.5655]
|
| 735 |
78%|โโโโโโโโ | 78/100 [44:47<12:22, 33.75s/trial, best loss: -0.5655]
|
| 736 |
79%|โโโโโโโโ | 79/100 [45:17<11:20, 32.40s/trial, best loss: -0.5655]
|
| 737 |
80%|โโโโโโโโ | 80/100 [45:48<10:41, 32.08s/trial, best loss: -0.5655]
|
| 738 |
81%|โโโโโโโโ | 81/100 [46:27<10:47, 34.07s/trial, best loss: -0.5655]
|
| 739 |
82%|โโโโโโโโโ | 82/100 [47:05<10:36, 35.34s/trial, best loss: -0.5655]
|
| 740 |
83%|โโโโโโโโโ | 83/100 [47:37<09:44, 34.37s/trial, best loss: -0.5655]
|
| 741 |
84%|โโโโโโโโโ | 84/100 [48:20<09:50, 36.90s/trial, best loss: -0.5655]
|
| 742 |
85%|โโโโโโโโโ | 85/100 [48:51<08:46, 35.11s/trial, best loss: -0.5655]
|
| 743 |
86%|โโโโโโโโโ | 86/100 [49:25<08:06, 34.73s/trial, best loss: -0.5655]
|
| 744 |
87%|โโโโโโโโโ | 87/100 [49:56<07:16, 33.56s/trial, best loss: -0.5655]
|
| 745 |
88%|โโโโโโโโโ | 88/100 [50:33<06:56, 34.70s/trial, best loss: -0.566]
|
| 746 |
89%|โโโโโโโโโ | 89/100 [51:19<06:57, 37.99s/trial, best loss: -0.566]
|
| 747 |
90%|โโโโโโโโโ | 90/100 [51:54<06:10, 37.08s/trial, best loss: -0.566]
|
| 748 |
91%|โโโโโโโโโ | 91/100 [52:47<06:18, 42.10s/trial, best loss: -0.566]
|
| 749 |
92%|โโโโโโโโโโ| 92/100 [53:24<05:23, 40.43s/trial, best loss: -0.5671]
|
| 750 |
93%|โโโโโโโโโโ| 93/100 [54:01<04:36, 39.53s/trial, best loss: -0.5671]
|
| 751 |
94%|โโโโโโโโโโ| 94/100 [54:56<04:24, 44.12s/trial, best loss: -0.5671]
|
| 752 |
95%|โโโโโโโโโโ| 95/100 [55:34<03:31, 42.24s/trial, best loss: -0.5671]
|
| 753 |
96%|โโโโโโโโโโ| 96/100 [56:12<02:43, 40.95s/trial, best loss: -0.5671]
|
| 754 |
97%|โโโโโโโโโโ| 97/100 [56:56<02:05, 41.79s/trial, best loss: -0.5671]
|
| 755 |
98%|โโโโโโโโโโ| 98/100 [57:43<01:26, 43.42s/trial, best loss: -0.5671]
|
| 756 |
99%|โโโโโโโโโโ| 99/100 [58:35<00:45, 45.96s/trial, best loss: -0.5671]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
nohup: ignoring input
|
| 2 |
+
/bin/bash: /opt/conda/lib/libtinfo.so.6: no version information available (required by /bin/bash)
|
| 3 |
+
==========================================
|
| 4 |
+
LGB CTGAN10000 ํ์ผ ์คํ ์์
|
| 5 |
+
์์ ์๊ฐ: 2025-12-28 04:29:39
|
| 6 |
+
GPU: 1๋ฒ (CUDA_VISIBLE_DEVICES=1)
|
| 7 |
+
==========================================
|
| 8 |
+
|
| 9 |
+
----------------------------------------
|
| 10 |
+
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_busan.py
|
| 11 |
+
์์ ์๊ฐ: 2025-12-28 04:29:39
|
| 12 |
+
----------------------------------------
|
| 13 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 14 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 15 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 16 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 18 |
1%| | 1/100 [01:04<1:47:14, 65.00s/trial, best loss: -0.4238]
|
| 19 |
2%|โ | 2/100 [01:54<1:31:25, 55.98s/trial, best loss: -0.4576]
|
| 20 |
3%|โ | 3/100 [02:31<1:16:36, 47.39s/trial, best loss: -0.4733]
|
| 21 |
4%|โ | 4/100 [03:21<1:17:24, 48.38s/trial, best loss: -0.4758]
|
| 22 |
5%|โ | 5/100 [04:00<1:10:52, 44.77s/trial, best loss: -0.4758]
|
| 23 |
6%|โ | 6/100 [04:24<59:01, 37.68s/trial, best loss: -0.4758]
|
| 24 |
7%|โ | 7/100 [04:54<54:54, 35.42s/trial, best loss: -0.4758]
|
| 25 |
8%|โ | 8/100 [05:41<59:49, 39.02s/trial, best loss: -0.4758]
|
| 26 |
9%|โ | 9/100 [06:04<51:22, 33.87s/trial, best loss: -0.4758]
|
| 27 |
10%|โ | 10/100 [06:52<57:39, 38.44s/trial, best loss: -0.4758]
|
| 28 |
11%|โ | 11/100 [07:30<56:39, 38.20s/trial, best loss: -0.4835]
|
| 29 |
12%|โโ | 12/100 [08:01<52:39, 35.90s/trial, best loss: -0.4835]
|
| 30 |
13%|โโ | 13/100 [08:23<46:16, 31.91s/trial, best loss: -0.4835]
|
| 31 |
14%|โโ | 14/100 [08:46<41:36, 29.03s/trial, best loss: -0.4835]
|
| 32 |
15%|โโ | 15/100 [09:24<44:58, 31.74s/trial, best loss: -0.4835]
|
| 33 |
16%|โโ | 16/100 [10:12<51:30, 36.80s/trial, best loss: -0.4835]
|
| 34 |
17%|โโ | 17/100 [10:47<50:13, 36.30s/trial, best loss: -0.4835]
|
| 35 |
18%|โโ | 18/100 [11:15<46:03, 33.70s/trial, best loss: -0.4835]
|
| 36 |
19%|โโ | 19/100 [11:52<46:41, 34.58s/trial, best loss: -0.4835]
|
| 37 |
20%|โโ | 20/100 [12:13<40:56, 30.71s/trial, best loss: -0.4835]
|
| 38 |
21%|โโ | 21/100 [12:44<40:26, 30.71s/trial, best loss: -0.4835]
|
| 39 |
22%|โโโ | 22/100 [13:14<39:43, 30.56s/trial, best loss: -0.4836]
|
| 40 |
23%|โโโ | 23/100 [13:40<37:14, 29.02s/trial, best loss: -0.4836]
|
| 41 |
24%|โโโ | 24/100 [14:23<42:05, 33.24s/trial, best loss: -0.4836]
|
| 42 |
25%|โโโ | 25/100 [14:53<40:20, 32.27s/trial, best loss: -0.4836]
|
| 43 |
26%|โโโ | 26/100 [15:18<37:18, 30.25s/trial, best loss: -0.4836]
|
| 44 |
27%|โโโ | 27/100 [15:47<36:22, 29.90s/trial, best loss: -0.4836]
|
| 45 |
28%|โโโ | 28/100 [16:40<44:02, 36.70s/trial, best loss: -0.4836]
|
| 46 |
29%|โโโ | 29/100 [17:20<44:27, 37.57s/trial, best loss: -0.4836]
|
| 47 |
30%|โโโ | 30/100 [18:02<45:34, 39.06s/trial, best loss: -0.4836]
|
| 48 |
31%|โโโ | 31/100 [18:26<39:34, 34.42s/trial, best loss: -0.4836]
|
| 49 |
32%|โโโโ | 32/100 [19:00<39:06, 34.51s/trial, best loss: -0.4836]
|
| 50 |
33%|โโโโ | 33/100 [19:37<39:24, 35.29s/trial, best loss: -0.4836]
|
| 51 |
34%|โโโโ | 34/100 [20:20<41:17, 37.54s/trial, best loss: -0.4836]
|
| 52 |
35%|โโโโ | 35/100 [20:46<36:49, 33.99s/trial, best loss: -0.4836]
|
| 53 |
36%|โโโโ | 36/100 [21:42<43:21, 40.65s/trial, best loss: -0.4836]
|
| 54 |
37%|โโโโ | 37/100 [22:19<41:21, 39.38s/trial, best loss: -0.4836]
|
| 55 |
38%|โโโโ | 38/100 [23:07<43:38, 42.23s/trial, best loss: -0.4836]
|
| 56 |
39%|โโโโ | 39/100 [23:30<36:47, 36.19s/trial, best loss: -0.4836]
|
| 57 |
40%|โโโโ | 40/100 [24:00<34:29, 34.49s/trial, best loss: -0.4836]
|
| 58 |
41%|โโโโ | 41/100 [24:30<32:32, 33.10s/trial, best loss: -0.4836]
|
| 59 |
42%|โโโโโ | 42/100 [24:56<29:53, 30.93s/trial, best loss: -0.4836]
|
| 60 |
43%|โโโโโ | 43/100 [25:27<29:21, 30.90s/trial, best loss: -0.4836]
|
| 61 |
44%|โโโโโ | 44/100 [25:50<26:44, 28.65s/trial, best loss: -0.4836]
|
| 62 |
45%|โโโโโ | 45/100 [26:40<32:11, 35.13s/trial, best loss: -0.4836]
|
| 63 |
46%|โโโโโ | 46/100 [27:16<31:53, 35.43s/trial, best loss: -0.4836]
|
| 64 |
47%|โโโโโ | 47/100 [27:57<32:41, 37.01s/trial, best loss: -0.4836]
|
| 65 |
48%|โโโโโ | 48/100 [28:48<35:47, 41.30s/trial, best loss: -0.4836]
|
| 66 |
49%|โโโโโ | 49/100 [29:27<34:26, 40.53s/trial, best loss: -0.4836]
|
| 67 |
50%|โโโโโ | 50/100 [29:54<30:25, 36.51s/trial, best loss: -0.4836]
|
| 68 |
51%|โโโโโ | 51/100 [30:53<35:10, 43.06s/trial, best loss: -0.4836]
|
| 69 |
52%|โโโโโโ | 52/100 [31:20<30:35, 38.24s/trial, best loss: -0.4836]
|
| 70 |
53%|โโโโโโ | 53/100 [31:53<28:54, 36.90s/trial, best loss: -0.4836]
|
| 71 |
54%|โโโโโโ | 54/100 [33:09<37:07, 48.43s/trial, best loss: -0.4836]
|
| 72 |
55%|โโโโโโ | 55/100 [33:34<31:10, 41.56s/trial, best loss: -0.4836]
|
| 73 |
56%|โโโโโโ | 56/100 [33:56<26:01, 35.48s/trial, best loss: -0.4836]
|
| 74 |
57%|โโโโโโ | 57/100 [34:25<24:02, 33.54s/trial, best loss: -0.4836]
|
| 75 |
58%|โโโโโโ | 58/100 [35:00<23:51, 34.09s/trial, best loss: -0.4836]
|
| 76 |
59%|โโโโโโ | 59/100 [35:53<27:15, 39.88s/trial, best loss: -0.4836]
|
| 77 |
60%|โโโโโโ | 60/100 [36:31<26:10, 39.26s/trial, best loss: -0.4836]
|
| 78 |
61%|โโโโโโ | 61/100 [36:57<22:56, 35.30s/trial, best loss: -0.4836]
|
| 79 |
62%|โโโโโโโ | 62/100 [37:32<22:11, 35.04s/trial, best loss: -0.4836]
|
| 80 |
63%|โโโโโโโ | 63/100 [37:57<19:47, 32.11s/trial, best loss: -0.4836]
|
| 81 |
64%|โโโโโโโ | 64/100 [38:23<18:11, 30.33s/trial, best loss: -0.4836]
|
| 82 |
65%|โโโโโโโ | 65/100 [39:08<20:11, 34.62s/trial, best loss: -0.4836]
|
| 83 |
66%|โโโโโโโ | 66/100 [39:40<19:14, 33.96s/trial, best loss: -0.4836]
|
| 84 |
67%|โโโโโโโ | 67/100 [40:11<18:06, 32.93s/trial, best loss: -0.4836]
|
| 85 |
68%|โโโโโโโ | 68/100 [40:36<16:23, 30.74s/trial, best loss: -0.4836]
|
| 86 |
69%|โโโโโโโ | 69/100 [41:04<15:20, 29.70s/trial, best loss: -0.4836]
|
| 87 |
70%|โโโโโโโ | 70/100 [41:31<14:34, 29.15s/trial, best loss: -0.4836]
|
| 88 |
71%|โโโโโโโ | 71/100 [41:55<13:17, 27.51s/trial, best loss: -0.4836]
|
| 89 |
72%|โโโโโโโโ | 72/100 [42:36<14:45, 31.64s/trial, best loss: -0.4836]
|
| 90 |
73%|โโโโโโโโ | 73/100 [43:06<13:58, 31.06s/trial, best loss: -0.4836]
|
| 91 |
74%|โโโโโโโโ | 74/100 [43:34<12:59, 29.97s/trial, best loss: -0.4836]
|
| 92 |
75%|โโโโโโโโ | 75/100 [44:05<12:43, 30.53s/trial, best loss: -0.4836]
|
| 93 |
76%|โโโโโโโโ | 76/100 [44:46<13:24, 33.52s/trial, best loss: -0.4836]
|
| 94 |
77%|โโโโโโโโ | 77/100 [45:22<13:09, 34.35s/trial, best loss: -0.4836]
|
| 95 |
78%|โโโโโโโโ | 78/100 [45:53<12:11, 33.24s/trial, best loss: -0.4836]
|
| 96 |
79%|โโโโโโโโ | 79/100 [46:20<10:58, 31.38s/trial, best loss: -0.4836]
|
| 97 |
80%|โโโโโโโโ | 80/100 [46:45<09:51, 29.59s/trial, best loss: -0.4836]
|
| 98 |
81%|โโโโโโโโ | 81/100 [47:20<09:53, 31.23s/trial, best loss: -0.4836]
|
| 99 |
82%|โโโโโโโโโ | 82/100 [47:51<09:19, 31.11s/trial, best loss: -0.4836]
|
| 100 |
83%|โโโโโโโโโ | 83/100 [48:23<08:55, 31.49s/trial, best loss: -0.4836]
|
| 101 |
84%|โโโโโโโโโ | 84/100 [49:06<09:14, 34.66s/trial, best loss: -0.4836]
|
| 102 |
85%|โโโโโโโโโ | 85/100 [49:31<07:59, 31.94s/trial, best loss: -0.4836]
|
| 103 |
86%|โโโโโโโโโ | 86/100 [50:18<08:28, 36.32s/trial, best loss: -0.4836]
|
| 104 |
87%|โโโโโโโโโ | 87/100 [51:01<08:20, 38.50s/trial, best loss: -0.4836]
|
| 105 |
88%|โโโโโโโโโ | 88/100 [52:08<09:24, 47.02s/trial, best loss: -0.4836]
|
| 106 |
89%|โโโโโโโโโ | 89/100 [52:57<08:43, 47.60s/trial, best loss: -0.4836]
|
| 107 |
90%|โโโโโโโโโ | 90/100 [53:37<07:31, 45.17s/trial, best loss: -0.4836]
|
| 108 |
91%|โโโโโโโโโ | 91/100 [54:28<07:04, 47.18s/trial, best loss: -0.4836]
|
| 109 |
92%|โโโโโโโโโโ| 92/100 [55:14<06:13, 46.70s/trial, best loss: -0.4836]
|
| 110 |
93%|โโโโโโโโโโ| 93/100 [56:21<06:08, 52.71s/trial, best loss: -0.4836]
|
| 111 |
94%|โโโโโโโโโโ| 94/100 [57:02<04:55, 49.27s/trial, best loss: -0.4836]
|
| 112 |
95%|โโโโโโโโโโ| 95/100 [57:39<03:48, 45.62s/trial, best loss: -0.4836]
|
| 113 |
96%|โโโโโโโโโโ| 96/100 [58:33<03:12, 48.15s/trial, best loss: -0.4836]
|
| 114 |
97%|โโโโโโโโโโ| 97/100 [59:14<02:17, 45.95s/trial, best loss: -0.4836]
|
| 115 |
98%|โโโโโโโโโโ| 98/100 [59:54<01:28, 44.22s/trial, best loss: -0.4836]
|
| 116 |
99%|โโโโโโโโโโ| 99/100 [1:00:48<00:47, 47.12s/trial, best loss: -0.4836]
|
| 117 |
+
|
| 118 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.7243835590014314, 'learning_rate': 0.052472053724070156, 'max_depth': 15.0, 'min_child_weight': 9.0, 'num_leaves': 120.0, 'reg_alpha': 0.566895668532905, 'reg_lambda': 0.9659771198744264, 'subsample': 0.8425484904296862}
|
| 119 |
+
์ต์ CSI ์ ์: 0.4836 (loss: -0.4836)
|
| 120 |
+
|
| 121 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 122 |
+
- ์ด ์๋ ํ์: 100
|
| 123 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 124 |
+
- ์ต์ด CSI: 0.4238
|
| 125 |
+
- ์ต์ข
CSI: 0.4676
|
| 126 |
+
- ์ต๊ณ CSI: 0.4836
|
| 127 |
+
- ์ต์ CSI: 0.4200
|
| 128 |
+
- ํ๊ท CSI: 0.4700
|
| 129 |
+
|
| 130 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_busan_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 131 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 132 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 133 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.3905
|
| 134 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 135 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.5044
|
| 136 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 137 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.4985
|
| 138 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 139 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_busan.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 140 |
+
|
| 141 |
+
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_busan.py (์์ ์๊ฐ: 3720์ด)
|
| 142 |
+
|
| 143 |
+
----------------------------------------
|
| 144 |
+
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_daegu.py
|
| 145 |
+
์์ ์๊ฐ: 2025-12-28 05:31:39
|
| 146 |
+
----------------------------------------
|
| 147 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 148 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 149 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 150 |
+
|
| 151 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 152 |
1%| | 1/100 [00:18<31:06, 18.85s/trial, best loss: -0.3977]
|
| 153 |
2%|โ | 2/100 [00:59<52:04, 31.88s/trial, best loss: -0.4107]
|
| 154 |
3%|โ | 3/100 [01:25<46:42, 28.89s/trial, best loss: -0.4107]
|
| 155 |
4%|โ | 4/100 [02:15<59:36, 37.25s/trial, best loss: -0.4107]
|
| 156 |
5%|โ | 5/100 [02:48<56:54, 35.94s/trial, best loss: -0.4107]
|
| 157 |
6%|โ | 6/100 [03:16<52:00, 33.20s/trial, best loss: -0.4107]
|
| 158 |
7%|โ | 7/100 [04:01<57:30, 37.10s/trial, best loss: -0.4107]
|
| 159 |
8%|โ | 8/100 [04:43<58:56, 38.44s/trial, best loss: -0.4107]
|
| 160 |
9%|โ | 9/100 [05:10<52:53, 34.88s/trial, best loss: -0.4107]
|
| 161 |
10%|โ | 10/100 [05:34<47:28, 31.65s/trial, best loss: -0.4107]
|
| 162 |
11%|โ | 11/100 [06:25<55:28, 37.39s/trial, best loss: -0.4107]
|
| 163 |
12%|โโ | 12/100 [06:52<50:33, 34.47s/trial, best loss: -0.4107]
|
| 164 |
13%|โโ | 13/100 [07:15<44:44, 30.85s/trial, best loss: -0.4155]
|
| 165 |
14%|โโ | 14/100 [07:47<44:52, 31.31s/trial, best loss: -0.4155]
|
| 166 |
15%|โโ | 15/100 [08:10<40:45, 28.77s/trial, best loss: -0.4161]
|
| 167 |
16%|โโ | 16/100 [08:33<37:35, 26.85s/trial, best loss: -0.4161]
|
| 168 |
17%|โโ | 17/100 [09:15<43:36, 31.53s/trial, best loss: -0.4161]
|
| 169 |
18%|โโ | 18/100 [09:51<45:05, 32.99s/trial, best loss: -0.4161]
|
| 170 |
19%|โโ | 19/100 [10:14<40:11, 29.77s/trial, best loss: -0.4161]
|
| 171 |
20%|โโ | 20/100 [11:04<48:02, 36.03s/trial, best loss: -0.4161]
|
| 172 |
21%|โโ | 21/100 [11:25<41:14, 31.32s/trial, best loss: -0.4203]
|
| 173 |
22%|โโโ | 22/100 [11:51<38:51, 29.89s/trial, best loss: -0.4203]
|
| 174 |
23%|โโโ | 23/100 [12:16<36:18, 28.29s/trial, best loss: -0.4203]
|
| 175 |
24%|โโโ | 24/100 [12:42<35:07, 27.72s/trial, best loss: -0.4203]
|
| 176 |
25%|โโโ | 25/100 [13:04<32:21, 25.88s/trial, best loss: -0.4203]
|
| 177 |
26%|โโโ | 26/100 [13:25<30:16, 24.54s/trial, best loss: -0.4203]
|
| 178 |
27%|โโโ | 27/100 [13:46<28:42, 23.60s/trial, best loss: -0.4203]
|
| 179 |
28%|โโโ | 28/100 [14:08<27:40, 23.06s/trial, best loss: -0.4203]
|
| 180 |
29%|โโโ | 29/100 [14:33<27:46, 23.47s/trial, best loss: -0.4203]
|
| 181 |
30%|โโโ | 30/100 [14:53<26:12, 22.46s/trial, best loss: -0.4207]
|
| 182 |
31%|โโโ | 31/100 [15:14<25:33, 22.22s/trial, best loss: -0.4254]
|
| 183 |
32%|โโโโ | 32/100 [15:36<24:48, 21.90s/trial, best loss: -0.4254]
|
| 184 |
33%|โโโโ | 33/100 [15:57<24:20, 21.80s/trial, best loss: -0.4254]
|
| 185 |
34%|โโโโ | 34/100 [16:19<23:58, 21.79s/trial, best loss: -0.4254]
|
| 186 |
35%|โโโโ | 35/100 [16:47<25:30, 23.55s/trial, best loss: -0.4254]
|
| 187 |
36%|โโโโ | 36/100 [17:12<25:35, 24.00s/trial, best loss: -0.4254]
|
| 188 |
37%|โโโโ | 37/100 [17:34<24:35, 23.42s/trial, best loss: -0.4254]
|
| 189 |
38%|โโโโ | 38/100 [18:02<25:41, 24.86s/trial, best loss: -0.4254]
|
| 190 |
39%|โโโโ | 39/100 [18:24<24:19, 23.93s/trial, best loss: -0.4254]
|
| 191 |
40%|โโโโ | 40/100 [18:50<24:31, 24.52s/trial, best loss: -0.4254]
|
| 192 |
41%|โโโโ | 41/100 [19:17<25:04, 25.51s/trial, best loss: -0.4254]
|
| 193 |
42%|โโโโโ | 42/100 [19:50<26:51, 27.78s/trial, best loss: -0.4254]
|
| 194 |
43%|โโโโโ | 43/100 [20:16<25:36, 26.96s/trial, best loss: -0.4254]
|
| 195 |
44%|โโโโโ | 44/100 [20:49<27:04, 29.00s/trial, best loss: -0.4254]
|
| 196 |
45%|โโโโโ | 45/100 [21:07<23:36, 25.75s/trial, best loss: -0.4254]
|
| 197 |
46%|โโโโโ | 46/100 [21:26<21:14, 23.60s/trial, best loss: -0.4254]
|
| 198 |
47%|โโโโโ | 47/100 [21:49<20:41, 23.42s/trial, best loss: -0.4254]
|
| 199 |
48%|โโโโโ | 48/100 [22:09<19:27, 22.45s/trial, best loss: -0.4254]
|
| 200 |
49%|โโโโโ | 49/100 [23:08<28:18, 33.30s/trial, best loss: -0.4254]
|
| 201 |
50%|โโโโโ | 50/100 [23:33<25:45, 30.90s/trial, best loss: -0.4254]
|
| 202 |
51%|โโโโโ | 51/100 [23:54<22:51, 27.99s/trial, best loss: -0.4254]
|
| 203 |
52%|โโโโโโ | 52/100 [24:46<28:08, 35.17s/trial, best loss: -0.4255]
|
| 204 |
53%|โโโโโโ | 53/100 [25:19<26:54, 34.35s/trial, best loss: -0.4255]
|
| 205 |
54%|โโโโโโ | 54/100 [26:00<27:54, 36.41s/trial, best loss: -0.4255]
|
| 206 |
55%|โโโโโโ | 55/100 [26:52<30:51, 41.14s/trial, best loss: -0.4255]
|
| 207 |
56%|โโโโโโ | 56/100 [27:21<27:32, 37.55s/trial, best loss: -0.4255]
|
| 208 |
57%|โโโโโโ | 57/100 [27:54<25:48, 36.01s/trial, best loss: -0.4255]
|
| 209 |
58%|โโโโโโ | 58/100 [28:38<27:00, 38.59s/trial, best loss: -0.4308]
|
| 210 |
59%|โโโโโโ | 59/100 [29:22<27:21, 40.03s/trial, best loss: -0.4308]
|
| 211 |
60%|โโโโโโ | 60/100 [29:55<25:16, 37.92s/trial, best loss: -0.4308]
|
| 212 |
61%|โโโโโโ | 61/100 [30:42<26:27, 40.70s/trial, best loss: -0.4308]
|
| 213 |
62%|โโโโโโโ | 62/100 [31:22<25:35, 40.40s/trial, best loss: -0.4308]
|
| 214 |
63%|โโโโโโโ | 63/100 [32:08<26:04, 42.29s/trial, best loss: -0.4308]
|
| 215 |
64%|โโโโโโโ | 64/100 [32:58<26:41, 44.49s/trial, best loss: -0.4308]
|
| 216 |
65%|โโโโโโโ | 65/100 [33:35<24:39, 42.28s/trial, best loss: -0.4308]
|
| 217 |
66%|โโโโโโโ | 66/100 [34:26<25:30, 45.01s/trial, best loss: -0.4308]
|
| 218 |
67%|โโโโโโโ | 67/100 [35:12<24:52, 45.21s/trial, best loss: -0.4308]
|
| 219 |
68%|โโโโโโโ | 68/100 [36:03<25:03, 47.00s/trial, best loss: -0.4308]
|
| 220 |
69%|โโโโโโโ | 69/100 [36:49<24:05, 46.63s/trial, best loss: -0.4308]
|
| 221 |
70%|โโโโโโโ | 70/100 [37:31<22:40, 45.35s/trial, best loss: -0.4308]
|
| 222 |
71%|โโโโโโโ | 71/100 [38:07<20:28, 42.35s/trial, best loss: -0.4308]
|
| 223 |
72%|โโโโโโโโ | 72/100 [38:45<19:12, 41.15s/trial, best loss: -0.4308]
|
| 224 |
73%|โโโโโโโโ | 73/100 [39:21<17:45, 39.48s/trial, best loss: -0.4308]
|
| 225 |
74%|โโโโโโโโ | 74/100 [39:55<16:22, 37.80s/trial, best loss: -0.4308]
|
| 226 |
75%|โโโโโโโโ | 75/100 [40:30<15:26, 37.07s/trial, best loss: -0.4308]
|
| 227 |
76%|โโโโโโโโ | 76/100 [41:12<15:22, 38.43s/trial, best loss: -0.4308]
|
| 228 |
77%|โโโโโโโโ | 77/100 [41:43<13:55, 36.31s/trial, best loss: -0.4308]
|
| 229 |
78%|โโโโโโโโ | 78/100 [42:09<12:10, 33.21s/trial, best loss: -0.4308]
|
| 230 |
79%|โโโโโโโโ | 79/100 [42:37<11:02, 31.57s/trial, best loss: -0.4308]
|
| 231 |
80%|โโโโโโโโ | 80/100 [43:10<10:44, 32.23s/trial, best loss: -0.4308]
|
| 232 |
81%|โโโโโโโโ | 81/100 [43:46<10:28, 33.10s/trial, best loss: -0.4308]
|
| 233 |
82%|โโโโโโโโโ | 82/100 [44:40<11:49, 39.44s/trial, best loss: -0.4317]
|
| 234 |
83%|โโโโโโโโโ | 83/100 [45:16<10:55, 38.57s/trial, best loss: -0.4317]
|
| 235 |
84%|โโโโโโโโโ | 84/100 [46:07<11:13, 42.10s/trial, best loss: -0.4317]
|
| 236 |
85%|โโโโโโโโโ | 85/100 [47:05<11:43, 46.91s/trial, best loss: -0.4317]
|
| 237 |
86%|โโโโโโโโโ | 86/100 [47:54<11:05, 47.51s/trial, best loss: -0.4317]
|
| 238 |
87%|โโโโโโโโโ | 87/100 [48:33<09:44, 44.98s/trial, best loss: -0.4317]
|
| 239 |
88%|โโโโโโโโโ | 88/100 [48:57<07:46, 38.87s/trial, best loss: -0.4317]
|
| 240 |
89%|โโโโโโโโโ | 89/100 [49:25<06:31, 35.56s/trial, best loss: -0.4317]
|
| 241 |
90%|โโโโโโโโโ | 90/100 [50:23<07:01, 42.18s/trial, best loss: -0.4339]
|
| 242 |
91%|โโโโโโโโโ | 91/100 [51:11<06:35, 43.97s/trial, best loss: -0.4339]
|
| 243 |
92%|โโโโโโโโโโ| 92/100 [52:08<06:21, 47.75s/trial, best loss: -0.4339]
|
| 244 |
93%|โโโโโโโโโโ| 93/100 [52:49<05:21, 45.99s/trial, best loss: -0.4339]
|
| 245 |
94%|โโโโโโโโโโ| 94/100 [53:41<04:45, 47.66s/trial, best loss: -0.4339]
|
| 246 |
95%|โโโโโโโโโโ| 95/100 [54:27<03:56, 47.24s/trial, best loss: -0.4339]
|
| 247 |
96%|โโโโโโโโโโ| 96/100 [55:20<03:14, 48.75s/trial, best loss: -0.4339]
|
| 248 |
97%|โโโโโโโโโโ| 97/100 [55:47<02:06, 42.27s/trial, best loss: -0.4339]
|
| 249 |
98%|โโโโโโโโโโ| 98/100 [56:52<01:38, 49.05s/trial, best loss: -0.4339]
|
| 250 |
99%|โโโโโโโโโโ| 99/100 [57:25<00:44, 44.40s/trial, best loss: -0.4339]
|
| 251 |
+
|
| 252 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.885595994008888, 'learning_rate': 0.010106842270671093, 'max_depth': 14.0, 'min_child_weight': 1.0, 'num_leaves': 122.0, 'reg_alpha': 0.12648188723964116, 'reg_lambda': 0.873682924904797, 'subsample': 0.7806598236159817}
|
| 253 |
+
์ต์ CSI ์ ์: 0.4339 (loss: -0.4339)
|
| 254 |
+
|
| 255 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 256 |
+
- ์ด ์๋ ํ์: 100
|
| 257 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 258 |
+
- ์ต์ด CSI: 0.3977
|
| 259 |
+
- ์ต์ข
CSI: 0.3974
|
| 260 |
+
- ์ต๊ณ CSI: 0.4339
|
| 261 |
+
- ์ต์ CSI: 0.3802
|
| 262 |
+
- ํ๊ท CSI: 0.4106
|
| 263 |
+
|
| 264 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_daegu_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 265 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 266 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 267 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4293
|
| 268 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 269 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.4656
|
| 270 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 271 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.3270
|
| 272 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 273 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_daegu.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 274 |
+
|
| 275 |
+
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_daegu.py (์์ ์๊ฐ: 3538์ด)
|
| 276 |
+
|
| 277 |
+
----------------------------------------
|
| 278 |
+
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_daejeon.py
|
| 279 |
+
์์ ์๊ฐ: 2025-12-28 06:30:37
|
| 280 |
+
----------------------------------------
|
| 281 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 282 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 283 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 284 |
+
|
| 285 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 286 |
1%| | 1/100 [00:28<47:17, 28.66s/trial, best loss: -0.4792]
|
| 287 |
2%|โ | 2/100 [01:38<1:25:59, 52.65s/trial, best loss: -0.4833]
|
| 288 |
3%|โ | 3/100 [02:12<1:11:30, 44.23s/trial, best loss: -0.4833]
|
| 289 |
4%|โ | 4/100 [02:44<1:02:52, 39.29s/trial, best loss: -0.4833]
|
| 290 |
5%|โ | 5/100 [03:08<53:32, 33.81s/trial, best loss: -0.4833]
|
| 291 |
6%|โ | 6/100 [03:41<52:46, 33.68s/trial, best loss: -0.4833]
|
| 292 |
7%|โ | 7/100 [04:23<56:25, 36.40s/trial, best loss: -0.4833]
|
| 293 |
8%|โ | 8/100 [05:32<1:11:34, 46.68s/trial, best loss: -0.4833]
|
| 294 |
9%|โ | 9/100 [06:02<1:02:47, 41.41s/trial, best loss: -0.4864]
|
| 295 |
10%|โ | 10/100 [07:04<1:12:04, 48.05s/trial, best loss: -0.4864]
|
| 296 |
11%|โ | 11/100 [07:31<1:01:24, 41.40s/trial, best loss: -0.4864]
|
| 297 |
12%|โโ | 12/100 [07:54<52:32, 35.82s/trial, best loss: -0.4864]
|
| 298 |
13%|โโ | 13/100 [09:06<1:07:45, 46.72s/trial, best loss: -0.4878]
|
| 299 |
14%|โโ | 14/100 [09:35<59:23, 41.44s/trial, best loss: -0.4878]
|
| 300 |
15%|โโ | 15/100 [10:15<58:02, 40.98s/trial, best loss: -0.4878]
|
| 301 |
16%|โโ | 16/100 [10:42<51:40, 36.91s/trial, best loss: -0.4878]
|
| 302 |
17%|โโ | 17/100 [11:16<49:36, 35.86s/trial, best loss: -0.4878]
|
| 303 |
18%|โโ | 18/100 [11:59<52:13, 38.21s/trial, best loss: -0.4878]
|
| 304 |
19%|โโ | 19/100 [12:54<58:10, 43.09s/trial, best loss: -0.4878]
|
| 305 |
20%|โโ | 20/100 [13:18<50:04, 37.56s/trial, best loss: -0.4878]
|
| 306 |
21%|โโ | 21/100 [14:05<53:03, 40.30s/trial, best loss: -0.4878]
|
| 307 |
22%|โโโ | 22/100 [14:40<50:06, 38.54s/trial, best loss: -0.4878]
|
| 308 |
23%|โโโ | 23/100 [15:37<56:52, 44.32s/trial, best loss: -0.4878]
|
| 309 |
24%|โโโ | 24/100 [16:00<47:53, 37.81s/trial, best loss: -0.4878]
|
| 310 |
25%|โโโ | 25/100 [17:12<1:00:06, 48.08s/trial, best loss: -0.4878]
|
| 311 |
26%|โโโ | 26/100 [17:39<51:24, 41.69s/trial, best loss: -0.4878]
|
| 312 |
27%|โโโ | 27/100 [18:33<55:09, 45.34s/trial, best loss: -0.4878]
|
| 313 |
28%|โโโ | 28/100 [19:15<53:28, 44.56s/trial, best loss: -0.4878]
|
| 314 |
29%|โโโ | 29/100 [19:59<52:25, 44.30s/trial, best loss: -0.4878]
|
| 315 |
30%|โโโ | 30/100 [20:24<44:59, 38.56s/trial, best loss: -0.4878]
|
| 316 |
31%|โโโ | 31/100 [21:21<50:25, 43.84s/trial, best loss: -0.4878]
|
| 317 |
32%|โโโโ | 32/100 [22:25<56:51, 50.17s/trial, best loss: -0.4878]
|
| 318 |
33%|โโโโ | 33/100 [22:54<48:42, 43.62s/trial, best loss: -0.4878]
|
| 319 |
34%|โโโโ | 34/100 [23:21<42:43, 38.84s/trial, best loss: -0.4894]
|
| 320 |
35%|โโโโ | 35/100 [23:52<39:29, 36.46s/trial, best loss: -0.4894]
|
| 321 |
36%|โโโโ | 36/100 [24:14<34:09, 32.02s/trial, best loss: -0.4894]
|
| 322 |
37%|โโโโ | 37/100 [25:02<38:37, 36.79s/trial, best loss: -0.4894]
|
| 323 |
38%|โโโโ | 38/100 [25:30<35:24, 34.27s/trial, best loss: -0.4894]
|
| 324 |
39%|โโโโ | 39/100 [26:02<34:10, 33.62s/trial, best loss: -0.4894]
|
| 325 |
40%|โโโโ | 40/100 [26:31<31:57, 31.97s/trial, best loss: -0.4894]
|
| 326 |
41%|โโโโ | 41/100 [27:05<32:16, 32.82s/trial, best loss: -0.4894]
|
| 327 |
42%|โโโโโ | 42/100 [27:45<33:44, 34.91s/trial, best loss: -0.4894]
|
| 328 |
43%|โโโโโ | 43/100 [28:17<32:15, 33.95s/trial, best loss: -0.4894]
|
| 329 |
44%|โโโโโ | 44/100 [28:50<31:28, 33.72s/trial, best loss: -0.4894]
|
| 330 |
45%|โโโโโ | 45/100 [29:24<30:56, 33.75s/trial, best loss: -0.4894]
|
| 331 |
46%|โโโโโ | 46/100 [30:01<31:23, 34.88s/trial, best loss: -0.4894]
|
| 332 |
47%|โโโโโ | 47/100 [30:38<31:23, 35.54s/trial, best loss: -0.4894]
|
| 333 |
48%|โโโโโ | 48/100 [31:05<28:20, 32.71s/trial, best loss: -0.4894]
|
| 334 |
49%|โโโโโ | 49/100 [31:46<30:03, 35.36s/trial, best loss: -0.4894]
|
| 335 |
50%|โโโโโ | 50/100 [32:24<30:08, 36.17s/trial, best loss: -0.4894]
|
| 336 |
51%|โโโโโ | 51/100 [33:17<33:40, 41.24s/trial, best loss: -0.4894]
|
| 337 |
52%|โโโโโโ | 52/100 [33:40<28:34, 35.72s/trial, best loss: -0.4894]
|
| 338 |
53%|โโโโโโ | 53/100 [34:57<37:33, 47.95s/trial, best loss: -0.4894]
|
| 339 |
54%|โโโโโโ | 54/100 [35:22<31:33, 41.17s/trial, best loss: -0.4894]
|
| 340 |
55%|โโโโโโ | 55/100 [36:12<32:59, 43.98s/trial, best loss: -0.4894]
|
| 341 |
56%|โโโโโโ | 56/100 [36:39<28:21, 38.67s/trial, best loss: -0.4894]
|
| 342 |
57%|โโโโโโ | 57/100 [37:38<32:05, 44.79s/trial, best loss: -0.4894]
|
| 343 |
58%|โโโโโโ | 58/100 [38:18<30:26, 43.49s/trial, best loss: -0.4894]
|
| 344 |
59%|โโโโโโ | 59/100 [38:46<26:35, 38.90s/trial, best loss: -0.4894]
|
| 345 |
60%|โโโโโโ | 60/100 [39:14<23:41, 35.55s/trial, best loss: -0.4894]
|
| 346 |
61%|โโโโโโ | 61/100 [40:09<26:51, 41.32s/trial, best loss: -0.4894]
|
| 347 |
62%|โโโโโโโ | 62/100 [40:48<25:48, 40.76s/trial, best loss: -0.4894]
|
| 348 |
63%|โโโโโโโ | 63/100 [41:20<23:25, 37.97s/trial, best loss: -0.4894]
|
| 349 |
64%|โโโโโโโ | 64/100 [41:54<22:03, 36.77s/trial, best loss: -0.4894]
|
| 350 |
65%|โโโโโโโ | 65/100 [42:27<20:53, 35.82s/trial, best loss: -0.4894]
|
| 351 |
66%|โโโโโโโ | 66/100 [43:12<21:46, 38.42s/trial, best loss: -0.4894]
|
| 352 |
67%|โโโโโโโ | 67/100 [43:46<20:25, 37.13s/trial, best loss: -0.4894]
|
| 353 |
68%|โโโโโโโ | 68/100 [44:18<19:00, 35.65s/trial, best loss: -0.4894]
|
| 354 |
69%|โโโโโโโ | 69/100 [44:52<18:09, 35.16s/trial, best loss: -0.4894]
|
| 355 |
70%|โโโโโโโ | 70/100 [45:42<19:50, 39.67s/trial, best loss: -0.4894]
|
| 356 |
71%|โโโโโโโ | 71/100 [46:24<19:24, 40.15s/trial, best loss: -0.4894]
|
| 357 |
72%|โโโโโโโโ | 72/100 [46:52<17:05, 36.63s/trial, best loss: -0.4901]
|
| 358 |
73%|โโโโโโโโ | 73/100 [47:36<17:26, 38.74s/trial, best loss: -0.4901]
|
| 359 |
74%|โโโโโโโโ | 74/100 [48:08<15:56, 36.80s/trial, best loss: -0.4901]
|
| 360 |
75%|โโโโโโโโ | 75/100 [48:34<14:00, 33.61s/trial, best loss: -0.4908]
|
| 361 |
76%|โโโโโโโโ | 76/100 [49:02<12:44, 31.84s/trial, best loss: -0.4908]
|
| 362 |
77%|โโโโโโโโ | 77/100 [49:28<11:29, 29.97s/trial, best loss: -0.4908]
|
| 363 |
78%|โโโโโโโโ | 78/100 [49:52<10:22, 28.28s/trial, best loss: -0.4908]
|
| 364 |
79%|โโโโโโโโ | 79/100 [50:21<10:01, 28.64s/trial, best loss: -0.4908]
|
| 365 |
80%|โโโโโโโโ | 80/100 [50:46<09:11, 27.56s/trial, best loss: -0.4908]
|
| 366 |
81%|โโโโโโโโ | 81/100 [51:16<08:53, 28.06s/trial, best loss: -0.4908]
|
| 367 |
82%|โโโโโโโโโ | 82/100 [51:46<08:36, 28.69s/trial, best loss: -0.4908]
|
| 368 |
83%|โโโโโโโโโ | 83/100 [52:15<08:10, 28.85s/trial, best loss: -0.4908]
|
| 369 |
84%|โโโโโโโโโ | 84/100 [52:46<07:51, 29.44s/trial, best loss: -0.4908]
|
| 370 |
85%|โโโโโโโโโ | 85/100 [53:12<07:08, 28.55s/trial, best loss: -0.4908]
|
| 371 |
86%|โโโโโโโโโ | 86/100 [53:43<06:48, 29.21s/trial, best loss: -0.4908]
|
| 372 |
87%|โโโโโโโโโ | 87/100 [54:08<06:03, 27.99s/trial, best loss: -0.4908]
|
| 373 |
88%|โโโโโโโโโ | 88/100 [54:32<05:20, 26.69s/trial, best loss: -0.4908]
|
| 374 |
89%|โโโโโโโโโ | 89/100 [54:56<04:45, 26.00s/trial, best loss: -0.4908]
|
| 375 |
90%|โโโโโโโโโ | 90/100 [55:31<04:45, 28.51s/trial, best loss: -0.4908]
|
| 376 |
91%|โโโโโโโโโ | 91/100 [56:00<04:20, 28.91s/trial, best loss: -0.4908]
|
| 377 |
92%|โโโโโโโโโโ| 92/100 [56:37<04:09, 31.18s/trial, best loss: -0.4908]
|
| 378 |
93%|โโโโโโโโโโ| 93/100 [57:05<03:31, 30.15s/trial, best loss: -0.4908]
|
| 379 |
94%|โโโโโโโโโโ| 94/100 [57:26<02:44, 27.48s/trial, best loss: -0.4908]
|
| 380 |
95%|โโโโโโโโโโ| 95/100 [57:53<02:16, 27.34s/trial, best loss: -0.4908]
|
| 381 |
96%|โโโโโโโโโโ| 96/100 [58:28<01:58, 29.56s/trial, best loss: -0.4908]
|
| 382 |
97%|โโโโโโโโโโ| 97/100 [58:53<01:24, 28.32s/trial, best loss: -0.4908]
|
| 383 |
98%|โโโโโโโโโโ| 98/100 [59:16<00:53, 26.57s/trial, best loss: -0.4908]
|
| 384 |
99%|โโโโโโโโโโ| 99/100 [59:58<00:31, 31.41s/trial, best loss: -0.4908]
|
| 385 |
+
|
| 386 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.7077604272501928, 'learning_rate': 0.10351387699107398, 'max_depth': 6.0, 'min_child_weight': 4.0, 'num_leaves': 51.0, 'reg_alpha': 0.06973941883143871, 'reg_lambda': 0.8477821589656351, 'subsample': 0.8664583588640111}
|
| 387 |
+
์ต์ CSI ์ ์: 0.4908 (loss: -0.4908)
|
| 388 |
+
|
| 389 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 390 |
+
- ์ด ์๋ ํ์: 100
|
| 391 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 392 |
+
- ์ต์ด CSI: 0.4792
|
| 393 |
+
- ์ต์ข
CSI: 0.4809
|
| 394 |
+
- ์ต๊ณ CSI: 0.4908
|
| 395 |
+
- ์ต์ CSI: 0.4682
|
| 396 |
+
- ํ๊ท CSI: 0.4815
|
| 397 |
+
|
| 398 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_daejeon_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 399 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 400 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 401 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4324
|
| 402 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 403 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.4714
|
| 404 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 405 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5557
|
| 406 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 407 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_daejeon.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 408 |
+
|
| 409 |
+
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_daejeon.py (์์ ์๊ฐ: 3642์ด)
|
| 410 |
+
|
| 411 |
+
----------------------------------------
|
| 412 |
+
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_gwangju.py
|
| 413 |
+
์์ ์๊ฐ: 2025-12-28 07:31:19
|
| 414 |
+
----------------------------------------
|
| 415 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 416 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 417 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 418 |
+
|
| 419 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 420 |
1%| | 1/100 [01:02<1:42:38, 62.20s/trial, best loss: -0.4807]
|
| 421 |
2%|โ | 2/100 [01:49<1:27:01, 53.28s/trial, best loss: -0.4841]
|
| 422 |
3%|โ | 3/100 [02:42<1:25:52, 53.12s/trial, best loss: -0.4848]
|
| 423 |
4%|โ | 4/100 [03:15<1:12:13, 45.14s/trial, best loss: -0.4916]
|
| 424 |
5%|โ | 5/100 [04:13<1:19:05, 49.96s/trial, best loss: -0.4916]
|
| 425 |
6%|โ | 6/100 [05:10<1:22:01, 52.35s/trial, best loss: -0.4916]
|
| 426 |
7%|โ | 7/100 [05:34<1:06:33, 42.94s/trial, best loss: -0.4916]
|
| 427 |
8%|โ | 8/100 [06:55<1:24:29, 55.10s/trial, best loss: -0.4916]
|
| 428 |
9%|โ | 9/100 [07:43<1:20:06, 52.82s/trial, best loss: -0.4916]
|
| 429 |
10%|โ | 10/100 [08:33<1:18:03, 52.04s/trial, best loss: -0.4916]
|
| 430 |
11%|โ | 11/100 [08:58<1:04:48, 43.69s/trial, best loss: -0.4916]
|
| 431 |
12%|โโ | 12/100 [09:36<1:01:44, 42.09s/trial, best loss: -0.4916]
|
| 432 |
13%|โโ | 13/100 [11:00<1:19:31, 54.85s/trial, best loss: -0.4916]
|
| 433 |
14%|โโ | 14/100 [12:01<1:21:08, 56.61s/trial, best loss: -0.4916]
|
| 434 |
15%|โโ | 15/100 [12:29<1:08:01, 48.02s/trial, best loss: -0.4916]
|
| 435 |
16%|โโ | 16/100 [13:15<1:06:13, 47.30s/trial, best loss: -0.4916]
|
| 436 |
17%|โโ | 17/100 [13:36<54:35, 39.46s/trial, best loss: -0.4916]
|
| 437 |
18%|โโ | 18/100 [14:34<1:01:25, 44.94s/trial, best loss: -0.4916]
|
| 438 |
19%|โโ | 19/100 [15:04<54:45, 40.56s/trial, best loss: -0.4916]
|
| 439 |
20%|โโ | 20/100 [16:14<1:05:52, 49.40s/trial, best loss: -0.4916]
|
| 440 |
21%|โโ | 21/100 [16:54<1:01:24, 46.64s/trial, best loss: -0.4971]
|
| 441 |
22%|โโโ | 22/100 [17:30<56:16, 43.29s/trial, best loss: -0.4971]
|
| 442 |
23%|โโโ | 23/100 [18:01<51:01, 39.77s/trial, best loss: -0.4971]
|
| 443 |
24%|โโโ | 24/100 [18:33<47:11, 37.25s/trial, best loss: -0.4971]
|
| 444 |
25%|โโโ | 25/100 [19:12<47:11, 37.75s/trial, best loss: -0.4971]
|
| 445 |
26%|โโโ | 26/100 [19:48<45:54, 37.22s/trial, best loss: -0.4971]
|
| 446 |
27%|โโโ | 27/100 [20:30<47:14, 38.83s/trial, best loss: -0.4971]
|
| 447 |
28%|โโโ | 28/100 [21:01<43:51, 36.55s/trial, best loss: -0.4971]
|
| 448 |
29%|โโโ | 29/100 [21:48<47:00, 39.73s/trial, best loss: -0.4971]
|
| 449 |
30%|โโโ | 30/100 [22:23<44:41, 38.30s/trial, best loss: -0.4971]
|
| 450 |
31%|โโโ | 31/100 [22:49<39:43, 34.54s/trial, best loss: -0.4971]
|
| 451 |
32%|โโโโ | 32/100 [23:13<35:34, 31.39s/trial, best loss: -0.4971]
|
| 452 |
33%|โโโโ | 33/100 [23:34<31:37, 28.32s/trial, best loss: -0.4971]
|
| 453 |
34%|โโโโ | 34/100 [24:14<35:00, 31.82s/trial, best loss: -0.4971]
|
| 454 |
35%|โโโโ | 35/100 [24:59<38:36, 35.64s/trial, best loss: -0.4971]
|
| 455 |
36%|โโโโ | 36/100 [25:35<38:10, 35.80s/trial, best loss: -0.4971]
|
| 456 |
37%|โโโโ | 37/100 [26:39<46:25, 44.22s/trial, best loss: -0.4971]
|
| 457 |
38%|โโโโ | 38/100 [27:04<39:35, 38.31s/trial, best loss: -0.4971]
|
| 458 |
39%|โโโโ | 39/100 [27:38<37:49, 37.20s/trial, best loss: -0.4971]
|
| 459 |
40%|โโโโ | 40/100 [28:10<35:45, 35.75s/trial, best loss: -0.4971]
|
| 460 |
41%|โโโโ | 41/100 [28:34<31:29, 32.03s/trial, best loss: -0.4971]
|
| 461 |
42%|โโโโโ | 42/100 [29:01<29:39, 30.67s/trial, best loss: -0.4971]
|
| 462 |
43%|โโโโโ | 43/100 [29:33<29:29, 31.05s/trial, best loss: -0.4971]
|
| 463 |
44%|โโโโโ | 44/100 [30:15<32:02, 34.33s/trial, best loss: -0.4971]
|
| 464 |
45%|โโโโโ | 45/100 [30:46<30:33, 33.34s/trial, best loss: -0.4971]
|
| 465 |
46%|โโโโโ | 46/100 [31:18<29:33, 32.84s/trial, best loss: -0.4971]
|
| 466 |
47%|โโโโโ | 47/100 [31:55<30:00, 33.97s/trial, best loss: -0.4971]
|
| 467 |
48%|โโโโโ | 48/100 [32:40<32:31, 37.52s/trial, best loss: -0.4971]
|
| 468 |
49%|โโโโโ | 49/100 [33:06<28:58, 34.08s/trial, best loss: -0.4971]
|
| 469 |
50%|โโโโโ | 50/100 [33:29<25:34, 30.69s/trial, best loss: -0.4971]
|
| 470 |
51%|โโโโโ | 51/100 [33:54<23:39, 28.96s/trial, best loss: -0.4971]
|
| 471 |
52%|โโโโโโ | 52/100 [34:21<22:42, 28.39s/trial, best loss: -0.4971]
|
| 472 |
53%|โโโโโโ | 53/100 [34:57<23:53, 30.51s/trial, best loss: -0.4971]
|
| 473 |
54%|โโโโโโ | 54/100 [35:35<25:16, 32.96s/trial, best loss: -0.4971]
|
| 474 |
55%|โโโโโโ | 55/100 [36:07<24:24, 32.54s/trial, best loss: -0.4971]
|
| 475 |
56%|โโโโโโ | 56/100 [37:12<31:05, 42.40s/trial, best loss: -0.4971]
|
| 476 |
57%|โโโโโโ | 57/100 [37:49<29:04, 40.57s/trial, best loss: -0.4971]
|
| 477 |
58%|โโโโโโ | 58/100 [38:23<27:06, 38.72s/trial, best loss: -0.4971]
|
| 478 |
59%|โโโโโโ | 59/100 [38:56<25:20, 37.08s/trial, best loss: -0.4971]
|
| 479 |
60%|โโโโโโ | 60/100 [39:30<24:08, 36.22s/trial, best loss: -0.4971]
|
| 480 |
61%|โโโโโโ | 61/100 [40:38<29:41, 45.69s/trial, best loss: -0.4971]
|
| 481 |
62%|โโโโโโโ | 62/100 [41:09<26:05, 41.21s/trial, best loss: -0.4971]
|
| 482 |
63%|โโโโโโโ | 63/100 [41:45<24:28, 39.69s/trial, best loss: -0.4971]
|
| 483 |
64%|โโโโโโโ | 64/100 [42:17<22:26, 37.40s/trial, best loss: -0.4971]
|
| 484 |
65%|โโโโโโโ | 65/100 [42:46<20:20, 34.88s/trial, best loss: -0.4971]
|
| 485 |
66%|โโโโโโโ | 66/100 [43:19<19:23, 34.21s/trial, best loss: -0.4994]
|
| 486 |
67%|โโโโโโโ | 67/100 [43:52<18:36, 33.85s/trial, best loss: -0.4994]
|
| 487 |
68%|โโโโโโโ | 68/100 [44:26<18:10, 34.08s/trial, best loss: -0.4994]
|
| 488 |
69%|โโโโโโโ | 69/100 [45:15<19:46, 38.27s/trial, best loss: -0.4994]
|
| 489 |
70%|โโโโโโโ | 70/100 [45:56<19:36, 39.23s/trial, best loss: -0.4994]
|
| 490 |
71%|โโโโโโโ | 71/100 [46:41<19:51, 41.09s/trial, best loss: -0.4994]
|
| 491 |
72%|โโโโโโโโ | 72/100 [47:26<19:44, 42.29s/trial, best loss: -0.4994]
|
| 492 |
73%|โโโโโโโโ | 73/100 [48:36<22:40, 50.38s/trial, best loss: -0.4994]
|
| 493 |
74%|โโโโโโโโ | 74/100 [49:12<20:01, 46.21s/trial, best loss: -0.4994]
|
| 494 |
75%|โโโโโโโโ | 75/100 [49:58<19:11, 46.04s/trial, best loss: -0.4994]
|
| 495 |
76%|โโโโโโโโ | 76/100 [50:36<17:24, 43.52s/trial, best loss: -0.4994]
|
| 496 |
77%|โโโโโโโโ | 77/100 [51:07<15:19, 39.98s/trial, best loss: -0.4994]
|
| 497 |
78%|โโโโโโโโ | 78/100 [52:08<16:54, 46.11s/trial, best loss: -0.4994]
|
| 498 |
79%|โโโโโโโโ | 79/100 [52:46<15:22, 43.92s/trial, best loss: -0.4994]
|
| 499 |
80%|โโโโโโโโ | 80/100 [53:27<14:18, 42.91s/trial, best loss: -0.4994]
|
| 500 |
81%|โโโโโโโโ | 81/100 [53:59<12:33, 39.67s/trial, best loss: -0.4994]
|
| 501 |
82%|โโโโโโโโโ | 82/100 [54:47<12:39, 42.19s/trial, best loss: -0.4994]
|
| 502 |
83%|โโโโโโโโโ | 83/100 [55:36<12:30, 44.15s/trial, best loss: -0.4994]
|
| 503 |
84%|โโโโโโโโโ | 84/100 [56:13<11:10, 41.89s/trial, best loss: -0.4994]
|
| 504 |
85%|โโโโโโโโโ | 85/100 [56:50<10:09, 40.66s/trial, best loss: -0.4994]
|
| 505 |
86%|โโโโโโโโโ | 86/100 [57:41<10:11, 43.69s/trial, best loss: -0.4994]
|
| 506 |
87%|โโโโโโโโโ | 87/100 [58:47<10:54, 50.36s/trial, best loss: -0.4994]
|
| 507 |
88%|โโโโโโโโโ | 88/100 [59:26<09:22, 46.84s/trial, best loss: -0.4994]
|
| 508 |
89%|โโโโโโโโโ | 89/100 [1:00:02<08:02, 43.84s/trial, best loss: -0.4994]
|
| 509 |
90%|โโโโโโโโโ | 90/100 [1:00:31<06:33, 39.38s/trial, best loss: -0.4994]
|
| 510 |
91%|โโโโโโโโโ | 91/100 [1:01:09<05:48, 38.76s/trial, best loss: -0.4994]
|
| 511 |
92%|โโโโโโโโโโ| 92/100 [1:01:45<05:04, 38.04s/trial, best loss: -0.4994]
|
| 512 |
93%|โโโโโโโโโโ| 93/100 [1:02:39<04:59, 42.76s/trial, best loss: -0.4994]
|
| 513 |
94%|โโโโโโโโโโ| 94/100 [1:03:06<03:48, 38.12s/trial, best loss: -0.4994]
|
| 514 |
95%|โโโโโโโโโโ| 95/100 [1:03:39<03:02, 36.58s/trial, best loss: -0.4994]
|
| 515 |
96%|โโโโโโโโโโ| 96/100 [1:04:16<02:26, 36.56s/trial, best loss: -0.4994]
|
| 516 |
97%|โโโโโโโโโโ| 97/100 [1:04:51<01:48, 36.21s/trial, best loss: -0.4994]
|
| 517 |
98%|โโโโโโโโโโ| 98/100 [1:05:15<01:05, 32.67s/trial, best loss: -0.4994]
|
| 518 |
99%|โโโโโโโโโโ| 99/100 [1:05:43<00:31, 31.21s/trial, best loss: -0.4994]
|
| 519 |
+
|
| 520 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.9974290644555891, 'learning_rate': 0.03488079849604818, 'max_depth': 15.0, 'min_child_weight': 13.0, 'num_leaves': 47.0, 'reg_alpha': 0.22968749134640387, 'reg_lambda': 0.42745540115072206, 'subsample': 0.9875948361694687}
|
| 521 |
+
์ต์ CSI ์ ์: 0.4994 (loss: -0.4994)
|
| 522 |
+
|
| 523 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 524 |
+
- ์ด ์๋ ํ์: 100
|
| 525 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 526 |
+
- ์ต์ด CSI: 0.4807
|
| 527 |
+
- ์ต์ข
CSI: 0.4865
|
| 528 |
+
- ์ต๊ณ CSI: 0.4994
|
| 529 |
+
- ์ต์ CSI: 0.4678
|
| 530 |
+
- ํ๊ท CSI: 0.4866
|
| 531 |
+
|
| 532 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_gwangju_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 533 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 534 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 535 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4045
|
| 536 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 537 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.5536
|
| 538 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๏ฟฝ๏ฟฝ๏ฟฝ์ฆ ์ฐ๋: 2018)
|
| 539 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5277
|
| 540 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 541 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_gwangju.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 542 |
+
|
| 543 |
+
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_gwangju.py (์์ ์๊ฐ: 4001์ด)
|
| 544 |
+
|
| 545 |
+
----------------------------------------
|
| 546 |
+
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_incheon.py
|
| 547 |
+
์์ ์๊ฐ: 2025-12-28 08:38:00
|
| 548 |
+
----------------------------------------
|
| 549 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 550 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 551 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 552 |
+
|
| 553 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 554 |
1%| | 1/100 [00:54<1:30:09, 54.64s/trial, best loss: -0.5469]
|
| 555 |
2%|โ | 2/100 [01:19<1:00:47, 37.22s/trial, best loss: -0.5519]
|
| 556 |
3%|โ | 3/100 [01:50<55:12, 34.15s/trial, best loss: -0.5519]
|
| 557 |
4%|โ | 4/100 [02:25<55:19, 34.57s/trial, best loss: -0.5519]
|
| 558 |
5%|โ | 5/100 [03:31<1:12:51, 46.01s/trial, best loss: -0.5557]
|
| 559 |
6%|โ | 6/100 [04:02<1:03:56, 40.81s/trial, best loss: -0.5557]
|
| 560 |
7%|โ | 7/100 [04:30<56:42, 36.58s/trial, best loss: -0.5557]
|
| 561 |
8%|โ | 8/100 [05:14<59:48, 39.00s/trial, best loss: -0.5557]
|
| 562 |
9%|โ | 9/100 [05:44<54:59, 36.26s/trial, best loss: -0.5557]
|
| 563 |
10%|โ | 10/100 [06:26<56:54, 37.94s/trial, best loss: -0.5557]
|
| 564 |
11%|โ | 11/100 [06:56<52:53, 35.66s/trial, best loss: -0.5557]
|
| 565 |
12%|โโ | 12/100 [08:02<1:05:32, 44.69s/trial, best loss: -0.5557]
|
| 566 |
13%|โโ | 13/100 [08:46<1:04:34, 44.53s/trial, best loss: -0.5557]
|
| 567 |
14%|โโ | 14/100 [09:35<1:05:36, 45.77s/trial, best loss: -0.5557]
|
| 568 |
15%|โโ | 15/100 [10:59<1:21:31, 57.55s/trial, best loss: -0.5557]
|
| 569 |
16%|โโ | 16/100 [11:22<1:05:53, 47.07s/trial, best loss: -0.5557]
|
| 570 |
17%|โโ | 17/100 [12:15<1:07:27, 48.77s/trial, best loss: -0.5557]
|
| 571 |
18%|โโ | 18/100 [12:46<59:16, 43.37s/trial, best loss: -0.5557]
|
| 572 |
19%|โโ | 19/100 [13:18<54:13, 40.17s/trial, best loss: -0.5557]
|
| 573 |
20%|โโ | 20/100 [13:43<47:31, 35.64s/trial, best loss: -0.5557]
|
| 574 |
21%|โโ | 21/100 [14:13<44:40, 33.93s/trial, best loss: -0.5557]
|
| 575 |
22%|โโโ | 22/100 [15:23<58:03, 44.67s/trial, best loss: -0.5557]
|
| 576 |
23%|โโโ | 23/100 [15:46<49:03, 38.23s/trial, best loss: -0.5557]
|
| 577 |
24%|โโโ | 24/100 [16:16<45:01, 35.55s/trial, best loss: -0.5557]
|
| 578 |
25%|โโโ | 25/100 [16:48<43:17, 34.64s/trial, best loss: -0.5557]
|
| 579 |
26%|โโโ | 26/100 [17:28<44:29, 36.07s/trial, best loss: -0.5557]
|
| 580 |
27%|โโโ | 27/100 [17:55<40:51, 33.59s/trial, best loss: -0.5557]
|
| 581 |
28%|โโโ | 28/100 [18:25<39:01, 32.52s/trial, best loss: -0.556]
|
| 582 |
29%|โโโ | 29/100 [19:42<54:10, 45.78s/trial, best loss: -0.556]
|
| 583 |
30%|โโโ | 30/100 [20:16<49:15, 42.23s/trial, best loss: -0.556]
|
| 584 |
31%|โโโ | 31/100 [20:49<45:25, 39.50s/trial, best loss: -0.556]
|
| 585 |
32%|โโโโ | 32/100 [21:32<45:48, 40.41s/trial, best loss: -0.556]
|
| 586 |
33%|โโโโ | 33/100 [22:16<46:24, 41.57s/trial, best loss: -0.5567]
|
| 587 |
34%|โโโโ | 34/100 [22:57<45:31, 41.39s/trial, best loss: -0.5567]
|
| 588 |
35%|โโโโ | 35/100 [23:40<45:17, 41.81s/trial, best loss: -0.5567]
|
| 589 |
36%|โโโโ | 36/100 [24:46<52:33, 49.28s/trial, best loss: -0.5567]
|
| 590 |
37%|โโโโ | 37/100 [25:24<48:09, 45.86s/trial, best loss: -0.558]
|
| 591 |
38%|โโโโ | 38/100 [26:06<46:08, 44.65s/trial, best loss: -0.558]
|
| 592 |
39%|โโโโ | 39/100 [26:54<46:31, 45.76s/trial, best loss: -0.558]
|
| 593 |
40%|โโโโ | 40/100 [27:40<45:35, 45.60s/trial, best loss: -0.558]
|
| 594 |
41%|โโโโ | 41/100 [28:19<42:58, 43.71s/trial, best loss: -0.558]
|
| 595 |
42%|โโโโโ | 42/100 [29:14<45:34, 47.14s/trial, best loss: -0.558]
|
| 596 |
43%|โโโโโ | 43/100 [29:56<43:11, 45.47s/trial, best loss: -0.558]
|
| 597 |
44%|โโโโโ | 44/100 [30:58<47:01, 50.39s/trial, best loss: -0.558]
|
| 598 |
45%|โโโโโ | 45/100 [31:43<44:47, 48.86s/trial, best loss: -0.558]
|
| 599 |
46%|โโโโโ | 46/100 [32:39<46:01, 51.15s/trial, best loss: -0.558]
|
| 600 |
47%|โโโโโ | 47/100 [33:32<45:28, 51.48s/trial, best loss: -0.558]
|
| 601 |
48%|โโโโโ | 48/100 [34:10<41:20, 47.70s/trial, best loss: -0.558]
|
| 602 |
49%|โโโโโ | 49/100 [34:49<38:16, 45.04s/trial, best loss: -0.558]
|
| 603 |
50%|โโโโโ | 50/100 [35:28<35:54, 43.09s/trial, best loss: -0.558]
|
| 604 |
51%|โโโโโ | 51/100 [36:07<34:20, 42.06s/trial, best loss: -0.558]
|
| 605 |
52%|โโโโโโ | 52/100 [36:43<32:09, 40.19s/trial, best loss: -0.558]
|
| 606 |
53%|โโโโโโ | 53/100 [37:19<30:30, 38.94s/trial, best loss: -0.558]
|
| 607 |
54%|โโโโโโ | 54/100 [37:47<27:17, 35.59s/trial, best loss: -0.558]
|
| 608 |
55%|โโโโโโ | 55/100 [38:19<25:50, 34.45s/trial, best loss: -0.558]
|
| 609 |
56%|โโโโโโ | 56/100 [39:05<27:44, 37.83s/trial, best loss: -0.558]
|
| 610 |
57%|โโโโโโ | 57/100 [39:37<25:53, 36.12s/trial, best loss: -0.558]
|
| 611 |
58%|โโโโโโ | 58/100 [40:15<25:40, 36.67s/trial, best loss: -0.558]
|
| 612 |
59%|โโโโโโ | 59/100 [40:53<25:27, 37.25s/trial, best loss: -0.558]
|
| 613 |
60%|โโโโโโ | 60/100 [41:39<26:29, 39.73s/trial, best loss: -0.558]
|
| 614 |
61%|โโโโโโ | 61/100 [42:12<24:36, 37.85s/trial, best loss: -0.558]
|
| 615 |
62%|โโโโโโโ | 62/100 [42:45<22:55, 36.21s/trial, best loss: -0.558]
|
| 616 |
63%|โโโโโโโ | 63/100 [43:34<24:41, 40.05s/trial, best loss: -0.558]
|
| 617 |
64%|โโโโโโโ | 64/100 [43:56<20:46, 34.61s/trial, best loss: -0.558]
|
| 618 |
65%|โโโโโโโ | 65/100 [44:36<21:12, 36.36s/trial, best loss: -0.558]
|
| 619 |
66%|โโโโโโโ | 66/100 [45:08<19:49, 34.98s/trial, best loss: -0.558]
|
| 620 |
67%|โโโโโโโ | 67/100 [45:36<18:03, 32.83s/trial, best loss: -0.558]
|
| 621 |
68%|โโโโโโโ | 68/100 [46:02<16:32, 31.03s/trial, best loss: -0.558]
|
| 622 |
69%|โโโโโโโ | 69/100 [46:45<17:48, 34.45s/trial, best loss: -0.5588]
|
| 623 |
70%|โโโโโโโ | 70/100 [47:26<18:11, 36.38s/trial, best loss: -0.5588]
|
| 624 |
71%|โโโโโโโ | 71/100 [48:08<18:24, 38.10s/trial, best loss: -0.5588]
|
| 625 |
72%|โโโโโโโโ | 72/100 [48:40<16:57, 36.33s/trial, best loss: -0.5588]
|
| 626 |
73%|โโโโโโโโ | 73/100 [49:47<20:26, 45.41s/trial, best loss: -0.5588]
|
| 627 |
74%|โโโโโโโโ | 74/100 [50:25<18:42, 43.17s/trial, best loss: -0.5588]
|
| 628 |
75%|โโโโโโโโ | 75/100 [51:28<20:32, 49.28s/trial, best loss: -0.5588]
|
| 629 |
76%|โโโโโโโโ | 76/100 [52:21<20:06, 50.28s/trial, best loss: -0.5588]
|
| 630 |
77%|โโโโโโโโ | 77/100 [53:03<18:18, 47.74s/trial, best loss: -0.5588]
|
| 631 |
78%|โโโโโโโโ | 78/100 [53:47<17:11, 46.87s/trial, best loss: -0.5588]
|
| 632 |
79%|โโโโโโโโ | 79/100 [54:27<15:40, 44.78s/trial, best loss: -0.5588]
|
| 633 |
80%|โโโโโโโโ | 80/100 [55:22<15:58, 47.90s/trial, best loss: -0.5588]
|
| 634 |
81%|โโโโโโโโ | 81/100 [55:57<13:54, 43.91s/trial, best loss: -0.5588]
|
| 635 |
82%|โโโโโโโโโ | 82/100 [56:31<12:14, 40.78s/trial, best loss: -0.5588]
|
| 636 |
83%|โโโโโโโโโ | 83/100 [57:01<10:39, 37.63s/trial, best loss: -0.5588]
|
| 637 |
84%|โโโโโโโโโ | 84/100 [57:42<10:18, 38.68s/trial, best loss: -0.5588]
|
| 638 |
85%|โโโโโโโโโ | 85/100 [58:32<10:29, 41.95s/trial, best loss: -0.5588]
|
| 639 |
86%|โโโโโโโโโ | 86/100 [59:09<09:27, 40.52s/trial, best loss: -0.5588]
|
| 640 |
87%|โโโโโโโโโ | 87/100 [59:52<08:58, 41.40s/trial, best loss: -0.5588]
|
| 641 |
88%|โโโโโโโโโ | 88/100 [1:00:15<07:08, 35.74s/trial, best loss: -0.5588]
|
| 642 |
89%|โโโโโโโโโ | 89/100 [1:00:53<06:40, 36.37s/trial, best loss: -0.5588]
|
| 643 |
90%|โโโโโโโโโ | 90/100 [1:01:38<06:30, 39.04s/trial, best loss: -0.5588]
|
| 644 |
91%|โโโโโโโโโ | 91/100 [1:02:20<05:59, 39.93s/trial, best loss: -0.5588]
|
| 645 |
92%|โโโโโโโโโโ| 92/100 [1:03:11<05:45, 43.19s/trial, best loss: -0.5592]
|
| 646 |
93%|โโโโโโโโโโ| 93/100 [1:04:06<05:27, 46.72s/trial, best loss: -0.5592]
|
| 647 |
94%|โโโโโโโโโโ| 94/100 [1:05:23<05:34, 55.81s/trial, best loss: -0.5592]
|
| 648 |
95%|โโโโโโโโโโ| 95/100 [1:06:36<05:05, 61.13s/trial, best loss: -0.5592]
|
| 649 |
96%|โโโโโโโโโโ| 96/100 [1:07:16<03:39, 54.80s/trial, best loss: -0.5592]
|
| 650 |
97%|โโโโโโโโโโ| 97/100 [1:07:55<02:30, 50.12s/trial, best loss: -0.5592]
|
| 651 |
98%|โโโโโโโโโโ| 98/100 [1:08:36<01:34, 47.21s/trial, best loss: -0.5592]
|
| 652 |
99%|โโโโโโโโโโ| 99/100 [1:09:51<00:55, 55.54s/trial, best loss: -0.5592]
|
| 653 |
+
|
| 654 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.7615743363801121, 'learning_rate': 0.032013705340192794, 'max_depth': 12.0, 'min_child_weight': 4.0, 'num_leaves': 135.0, 'reg_alpha': 0.07355917150019742, 'reg_lambda': 0.7693270890686972, 'subsample': 0.8491133431153928}
|
| 655 |
+
์ต์ CSI ์ ์: 0.5592 (loss: -0.5592)
|
| 656 |
+
|
| 657 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 658 |
+
- ์ด ์๋ ํ์: 100
|
| 659 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 660 |
+
- ์ต์ด CSI: 0.5469
|
| 661 |
+
- ์ต์ข
CSI: 0.5567
|
| 662 |
+
- ์ต๊ณ CSI: 0.5592
|
| 663 |
+
- ์ต์ CSI: 0.5428
|
| 664 |
+
- ํ๊ท CSI: 0.5520
|
| 665 |
+
|
| 666 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_incheon_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 667 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 668 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 669 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4967
|
| 670 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 671 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.6068
|
| 672 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 673 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5748
|
| 674 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 675 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_incheon.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 676 |
+
|
| 677 |
+
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_incheon.py (์์ ์๊ฐ: 4299์ด)
|
| 678 |
+
|
| 679 |
+
----------------------------------------
|
| 680 |
+
์คํ ์ค: lgb_ctgan10000/LGB_ctgan10000_seoul.py
|
| 681 |
+
์์ ์๊ฐ: 2025-12-28 09:49:39
|
| 682 |
+
----------------------------------------
|
| 683 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 684 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 685 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 686 |
+
|
| 687 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 688 |
1%| | 1/100 [01:13<2:01:00, 73.34s/trial, best loss: -0.5479]
|
| 689 |
2%|โ | 2/100 [01:43<1:18:00, 47.76s/trial, best loss: -0.5552]
|
| 690 |
3%|โ | 3/100 [02:04<57:22, 35.48s/trial, best loss: -0.558]
|
| 691 |
4%|โ | 4/100 [03:04<1:12:39, 45.41s/trial, best loss: -0.558]
|
| 692 |
5%|โ | 5/100 [03:45<1:09:30, 43.90s/trial, best loss: -0.558]
|
| 693 |
6%|โ | 6/100 [04:11<58:53, 37.59s/trial, best loss: -0.5639]
|
| 694 |
7%|โ | 7/100 [04:54<1:01:02, 39.38s/trial, best loss: -0.5639]
|
| 695 |
8%|โ | 8/100 [05:50<1:08:46, 44.86s/trial, best loss: -0.5639]
|
| 696 |
9%|โ | 9/100 [06:40<1:10:17, 46.34s/trial, best loss: -0.5639]
|
| 697 |
10%|โ | 10/100 [07:29<1:10:30, 47.01s/trial, best loss: -0.5639]
|
| 698 |
11%|โ | 11/100 [08:14<1:08:51, 46.42s/trial, best loss: -0.5639]
|
| 699 |
12%|โโ | 12/100 [08:33<56:03, 38.22s/trial, best loss: -0.5639]
|
| 700 |
13%|โโ | 13/100 [08:57<49:03, 33.84s/trial, best loss: -0.5639]
|
| 701 |
14%|โโ | 14/100 [09:20<43:45, 30.53s/trial, best loss: -0.5639]
|
| 702 |
15%|โโ | 15/100 [09:49<42:37, 30.09s/trial, best loss: -0.5639]
|
| 703 |
16%|โโ | 16/100 [11:05<1:01:44, 44.10s/trial, best loss: -0.5639]
|
| 704 |
17%|โโ | 17/100 [11:51<1:01:40, 44.58s/trial, best loss: -0.5639]
|
| 705 |
18%|โโ | 18/100 [12:21<55:03, 40.28s/trial, best loss: -0.5639]
|
| 706 |
19%|โโ | 19/100 [12:46<47:51, 35.45s/trial, best loss: -0.5639]
|
| 707 |
20%|โโ | 20/100 [13:30<50:43, 38.05s/trial, best loss: -0.5639]
|
| 708 |
21%|โโ | 21/100 [13:54<44:35, 33.86s/trial, best loss: -0.5639]
|
| 709 |
22%|โโโ | 22/100 [14:21<41:16, 31.75s/trial, best loss: -0.5639]
|
| 710 |
23%|โโโ | 23/100 [14:43<37:04, 28.89s/trial, best loss: -0.5639]
|
| 711 |
24%|โโโ | 24/100 [15:09<35:34, 28.08s/trial, best loss: -0.5639]
|
| 712 |
25%|โโโ | 25/100 [15:31<32:49, 26.26s/trial, best loss: -0.5639]
|
| 713 |
26%|โโโ | 26/100 [15:54<31:08, 25.25s/trial, best loss: -0.5639]
|
| 714 |
27%|โโโ | 27/100 [16:19<30:45, 25.28s/trial, best loss: -0.5639]
|
| 715 |
28%|โโโ | 28/100 [16:46<30:58, 25.81s/trial, best loss: -0.5639]
|
| 716 |
29%|โโโ | 29/100 [17:08<28:59, 24.51s/trial, best loss: -0.5639]
|
| 717 |
30%|โโโ | 30/100 [17:43<32:21, 27.74s/trial, best loss: -0.5639]
|
| 718 |
31%|โโโ | 31/100 [18:09<31:10, 27.11s/trial, best loss: -0.5639]
|
| 719 |
32%|โโโโ | 32/100 [18:37<31:01, 27.38s/trial, best loss: -0.5639]
|
| 720 |
33%|โโโโ | 33/100 [19:01<29:22, 26.31s/trial, best loss: -0.5639]
|
| 721 |
34%|โโโโ | 34/100 [19:30<30:00, 27.28s/trial, best loss: -0.5639]
|
| 722 |
35%|โโโโ | 35/100 [19:58<29:44, 27.46s/trial, best loss: -0.5639]
|
| 723 |
36%|โโโโ | 36/100 [20:22<28:19, 26.55s/trial, best loss: -0.5639]
|
| 724 |
37%|โโโโ | 37/100 [21:29<40:25, 38.50s/trial, best loss: -0.5639]
|
| 725 |
38%|โโโโ | 38/100 [21:51<34:50, 33.72s/trial, best loss: -0.5639]
|
| 726 |
39%|โโโโ | 39/100 [22:17<31:58, 31.44s/trial, best loss: -0.5639]
|
| 727 |
40%|โโโโ | 40/100 [22:41<28:57, 28.96s/trial, best loss: -0.5639]
|
| 728 |
41%|โโโโ | 41/100 [23:15<30:07, 30.63s/trial, best loss: -0.5639]
|
| 729 |
42%|โโโโโ | 42/100 [23:39<27:46, 28.74s/trial, best loss: -0.5639]
|
| 730 |
43%|โโโโโ | 43/100 [24:00<25:01, 26.34s/trial, best loss: -0.5639]
|
| 731 |
44%|โโโโโ | 44/100 [24:27<24:44, 26.51s/trial, best loss: -0.5639]
|
| 732 |
45%|โโโโโ | 45/100 [25:06<27:45, 30.28s/trial, best loss: -0.5639]
|
| 733 |
46%|โโโโโ | 46/100 [26:00<33:30, 37.23s/trial, best loss: -0.5639]
|
| 734 |
47%|โโโโโ | 47/100 [26:37<32:59, 37.35s/trial, best loss: -0.5639]
|
| 735 |
48%|โโโโโ | 48/100 [27:20<33:53, 39.11s/trial, best loss: -0.5639]
|
| 736 |
49%|โโโโโ | 49/100 [28:20<38:25, 45.22s/trial, best loss: -0.5639]
|
| 737 |
50%|โโโโโ | 50/100 [28:53<34:36, 41.53s/trial, best loss: -0.5639]
|
| 738 |
51%|โโโโโ | 51/100 [29:31<32:57, 40.36s/trial, best loss: -0.5639]
|
| 739 |
52%|โโโโโโ | 52/100 [30:14<32:59, 41.23s/trial, best loss: -0.5639]
|
| 740 |
53%|โโโโโโ | 53/100 [30:47<30:18, 38.70s/trial, best loss: -0.5639]
|
| 741 |
54%|โโโโโโ | 54/100 [31:18<28:03, 36.61s/trial, best loss: -0.5639]
|
| 742 |
55%|โโโโโโ | 55/100 [31:49<26:11, 34.93s/trial, best loss: -0.5639]
|
| 743 |
56%|โโโโโโ | 56/100 [32:46<30:26, 41.51s/trial, best loss: -0.5639]
|
| 744 |
57%|โโโโโโ | 57/100 [33:33<30:59, 43.25s/trial, best loss: -0.5639]
|
| 745 |
58%|โโโโโโ | 58/100 [34:05<27:50, 39.78s/trial, best loss: -0.5639]
|
| 746 |
59%|โโโโโโ | 59/100 [34:53<28:45, 42.09s/trial, best loss: -0.5639]
|
| 747 |
60%|โโโโโโ | 60/100 [35:17<24:35, 36.90s/trial, best loss: -0.5639]
|
| 748 |
61%|โโโโโโ | 61/100 [35:44<22:03, 33.93s/trial, best loss: -0.5639]
|
| 749 |
62%|โโโโโโโ | 62/100 [36:08<19:31, 30.83s/trial, best loss: -0.5639]
|
| 750 |
63%|โโโโโโโ | 63/100 [36:36<18:26, 29.91s/trial, best loss: -0.5639]
|
| 751 |
64%|โโโโโโโ | 64/100 [36:56<16:16, 27.13s/trial, best loss: -0.5639]
|
| 752 |
65%|โโโโโโโ | 65/100 [37:22<15:30, 26.57s/trial, best loss: -0.5639]
|
| 753 |
66%|โโโโโโโ | 66/100 [37:54<16:05, 28.41s/trial, best loss: -0.5655]
|
| 754 |
67%|โโโโโโโ | 67/100 [38:28<16:32, 30.06s/trial, best loss: -0.5655]
|
| 755 |
68%|โโโโโโโ | 68/100 [39:05<17:07, 32.12s/trial, best loss: -0.5655]
|
| 756 |
69%|โโโโโโโ | 69/100 [39:35<16:15, 31.48s/trial, best loss: -0.5655]
|
| 757 |
70%|โโโโโโโ | 70/100 [40:17<17:17, 34.58s/trial, best loss: -0.5655]
|
| 758 |
71%|โโโโโโโ | 71/100 [40:41<15:13, 31.49s/trial, best loss: -0.5655]
|
| 759 |
72%|โโโโโโโโ | 72/100 [41:26<16:34, 35.53s/trial, best loss: -0.5655]
|
| 760 |
73%|โโโโโโโโ | 73/100 [41:53<14:51, 33.02s/trial, best loss: -0.5655]
|
| 761 |
74%|โโโโโโโโ | 74/100 [42:31<14:57, 34.53s/trial, best loss: -0.5655]
|
| 762 |
75%|โโโโโโโโ | 75/100 [43:02<13:50, 33.22s/trial, best loss: -0.5655]
|
| 763 |
76%|โโโโโโโโ | 76/100 [43:46<14:37, 36.58s/trial, best loss: -0.5655]
|
| 764 |
77%|โโโโโโโโ | 77/100 [44:15<13:06, 34.20s/trial, best loss: -0.5655]
|
| 765 |
78%|โโโโโโโโ | 78/100 [44:47<12:22, 33.75s/trial, best loss: -0.5655]
|
| 766 |
79%|โโโโโโโโ | 79/100 [45:17<11:20, 32.40s/trial, best loss: -0.5655]
|
| 767 |
80%|โโโโโโโโ | 80/100 [45:48<10:41, 32.08s/trial, best loss: -0.5655]
|
| 768 |
81%|โโโโโโโโ | 81/100 [46:27<10:47, 34.07s/trial, best loss: -0.5655]
|
| 769 |
82%|โโโโโโโโโ | 82/100 [47:05<10:36, 35.34s/trial, best loss: -0.5655]
|
| 770 |
83%|โโโโโโโโโ | 83/100 [47:37<09:44, 34.37s/trial, best loss: -0.5655]
|
| 771 |
84%|โโโโโโโโโ | 84/100 [48:20<09:50, 36.90s/trial, best loss: -0.5655]
|
| 772 |
85%|โโโโโโโโโ | 85/100 [48:51<08:46, 35.11s/trial, best loss: -0.5655]
|
| 773 |
86%|โโโโโโโโโ | 86/100 [49:25<08:06, 34.73s/trial, best loss: -0.5655]
|
| 774 |
87%|โโโโโโโโโ | 87/100 [49:56<07:16, 33.56s/trial, best loss: -0.5655]
|
| 775 |
88%|โโโโโโโโโ | 88/100 [50:33<06:56, 34.70s/trial, best loss: -0.566]
|
| 776 |
89%|โโโโโโโโโ | 89/100 [51:19<06:57, 37.99s/trial, best loss: -0.566]
|
| 777 |
90%|โโโโโโโโโ | 90/100 [51:54<06:10, 37.08s/trial, best loss: -0.566]
|
| 778 |
91%|โโโโโโโโโ | 91/100 [52:47<06:18, 42.10s/trial, best loss: -0.566]
|
| 779 |
92%|โโโโโโโโโโ| 92/100 [53:24<05:23, 40.43s/trial, best loss: -0.5671]
|
| 780 |
93%|โโโโโโโโโโ| 93/100 [54:01<04:36, 39.53s/trial, best loss: -0.5671]
|
| 781 |
94%|โโโโโโโโโโ| 94/100 [54:56<04:24, 44.12s/trial, best loss: -0.5671]
|
| 782 |
95%|โโโโโโโโโโ| 95/100 [55:34<03:31, 42.24s/trial, best loss: -0.5671]
|
| 783 |
96%|โโโโโโโโโโ| 96/100 [56:12<02:43, 40.95s/trial, best loss: -0.5671]
|
| 784 |
97%|โโโโโโโโโโ| 97/100 [56:56<02:05, 41.79s/trial, best loss: -0.5671]
|
| 785 |
98%|โโโโโโโโโโ| 98/100 [57:43<01:26, 43.42s/trial, best loss: -0.5671]
|
| 786 |
99%|โโโโโโโโโโ| 99/100 [58:35<00:45, 45.96s/trial, best loss: -0.5671]
|
| 787 |
+
|
| 788 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.661683034534645, 'learning_rate': 0.02117850018558707, 'max_depth': 15.0, 'min_child_weight': 16.0, 'num_leaves': 83.0, 'reg_alpha': 0.6438462886327296, 'reg_lambda': 0.8929153518940249, 'subsample': 0.9547922722157274}
|
| 789 |
+
์ต์ CSI ์ ์: 0.5671 (loss: -0.5671)
|
| 790 |
+
|
| 791 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 792 |
+
- ์ด ์๋ ํ์: 100
|
| 793 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 794 |
+
- ์ต์ด CSI: 0.5479
|
| 795 |
+
- ์ต์ข
CSI: 0.5505
|
| 796 |
+
- ์ต๊ณ CSI: 0.5671
|
| 797 |
+
- ์ต์ CSI: 0.5432
|
| 798 |
+
- ํ๊ท CSI: 0.5579
|
| 799 |
+
|
| 800 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/lgb_ctgan10000_seoul_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 801 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 802 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 803 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4967
|
| 804 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 805 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.5994
|
| 806 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 807 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5777
|
| 808 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 809 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/lgb_optima/lgb_ctgan10000_seoul.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 810 |
+
|
| 811 |
+
โ ์๋ฃ: lgb_ctgan10000/LGB_ctgan10000_seoul.py (์์ ์๊ฐ: 3571์ด)
|
| 812 |
+
|
| 813 |
+
==========================================
|
| 814 |
+
LGB CTGAN10000 ํ์ผ ์คํ ์๋ฃ
|
| 815 |
+
์ข
๋ฃ ์๊ฐ: 2025-12-28 10:49:10
|
| 816 |
+
์ด ์์ ์๊ฐ: 6์๊ฐ 19๋ถ 31์ด
|
| 817 |
+
์ฑ๊ณต: 6๊ฐ
|
| 818 |
+
์คํจ: 0๊ฐ
|
| 819 |
+
==========================================
|
Analysis_code/5.optima/run_bash/lgb/run_lgb_ctgan10000.sh
CHANGED
|
@@ -45,7 +45,7 @@ for file in "${FILES[@]}"; do
|
|
| 45 |
FILE_START=$(date +%s)
|
| 46 |
|
| 47 |
# Python ์คํฌ๋ฆฝํธ ์คํ (GPU 1๋ฒ ์ค์ )
|
| 48 |
-
if CUDA_VISIBLE_DEVICES=
|
| 49 |
FILE_END=$(date +%s)
|
| 50 |
FILE_DURATION=$((FILE_END - FILE_START))
|
| 51 |
echo ""
|
|
|
|
| 45 |
FILE_START=$(date +%s)
|
| 46 |
|
| 47 |
# Python ์คํฌ๋ฆฝํธ ์คํ (GPU 1๋ฒ ์ค์ )
|
| 48 |
+
if CUDA_VISIBLE_DEVICES=1 python3 -u "$filepath"; then
|
| 49 |
FILE_END=$(date +%s)
|
| 50 |
FILE_DURATION=$((FILE_END - FILE_START))
|
| 51 |
echo ""
|
Analysis_code/5.optima/run_bash/resnet_like/resnet_like_ctgan10000
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/5.optima/run_bash/resnet_like/resnet_like_ctgan10000.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/5.optima/run_bash/resnet_like/run_resnet_like_ctgan10000.sh
CHANGED
|
@@ -15,6 +15,11 @@ echo ""
|
|
| 15 |
# ์คํํ ํ์ผ ๋ชฉ๋ก
|
| 16 |
FILES=(
|
| 17 |
"resnet_like_ctgan10000_busan.py"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
# ์๋ฌ ๋ฐ์ ์ ์ค๋จ ์ฌ๋ถ (set -e๋ฅผ ์ฌ์ฉํ๋ฉด ์๋ฌ ๋ฐ์ ์ ์ฆ์ ์ค๋จ)
|
|
|
|
| 15 |
# ์คํํ ํ์ผ ๋ชฉ๋ก
|
| 16 |
FILES=(
|
| 17 |
"resnet_like_ctgan10000_busan.py"
|
| 18 |
+
"resnet_like_ctgan10000_daegu.py"
|
| 19 |
+
"resnet_like_ctgan10000_daejeon.py"
|
| 20 |
+
"resnet_like_ctgan10000_gwangju.py"
|
| 21 |
+
"resnet_like_ctgan10000_incheon.py"
|
| 22 |
+
"resnet_like_ctgan10000_seoul.py"
|
| 23 |
)
|
| 24 |
|
| 25 |
# ์๋ฌ ๋ฐ์ ์ ์ค๋จ ์ฌ๋ถ (set -e๋ฅผ ์ฌ์ฉํ๋ฉด ์๋ฌ ๋ฐ์ ์ ์ฆ์ ์ค๋จ)
|
Analysis_code/5.optima/run_bash/xgb/xgb_ctgan10000.log
CHANGED
|
@@ -1,156 +1,219 @@
|
|
| 1 |
-
nohup: ignoring input
|
| 2 |
-
/bin/bash: /opt/conda/lib/libtinfo.so.6: no version information available (required by /bin/bash)
|
| 3 |
-
==========================================
|
| 4 |
-
XGB CTGAN10000 ํ์ผ ์คํ ์์
|
| 5 |
-
์์ ์๊ฐ: 2025-12-
|
| 6 |
-
GPU: 0๋ฒ (CUDA_VISIBLE_DEVICES=0)
|
| 7 |
-
==========================================
|
| 8 |
-
|
| 9 |
-
----------------------------------------
|
| 10 |
-
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_busan.py
|
| 11 |
-
์์ ์๊ฐ: 2025-12-
|
| 12 |
-
----------------------------------------
|
| 13 |
-
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 14 |
-
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 15 |
-
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 16 |
-
|
| 17 |
-
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 18 |
-
1%| | 1/100 [00:45<1:15:32, 45.78s/trial, best loss: -0.4742]
|
| 19 |
-
2%|โ | 2/100 [01:39<1:22:40, 50.62s/trial, best loss: -0.4742]
|
| 20 |
-
3%|โ | 3/100 [02:20<1:14:17, 45.95s/trial, best loss: -0.4742]
|
| 21 |
-
4%|โ | 4/100 [02:41<57:43, 36.08s/trial, best loss: -0.4742]
|
| 22 |
-
5%|โ | 5/100 [03:30<1:04:58, 41.04s/trial, best loss: -0.4756]
|
| 23 |
-
6%|โ | 6/100 [04:28<1:13:19, 46.80s/trial, best loss: -0.4756]
|
| 24 |
-
7%|โ | 7/100 [05:49<1:29:34, 57.79s/trial, best loss: -0.4756]
|
| 25 |
-
8%|โ | 8/100 [07:20<1:45:00, 68.48s/trial, best loss: -0.4756]
|
| 26 |
-
9%|โ | 9/100 [08:20<1:39:34, 65.65s/trial, best loss: -0.4756]
|
| 27 |
-
10%|โ | 10/100 [08:48<1:21:19, 54.22s/trial, best loss: -0.4756]
|
| 28 |
-
11%|โ | 11/100 [09:59<1:27:52, 59.24s/trial, best loss: -0.4756]
|
| 29 |
-
12%|โโ | 12/100 [10:46<1:21:30, 55.58s/trial, best loss: -0.4756]
|
| 30 |
-
13%|โโ | 13/100 [11:56<1:26:59, 60.00s/trial, best loss: -0.4756]
|
| 31 |
-
14%|โโ | 14/100 [13:27<1:39:05, 69.14s/trial, best loss: -0.4756]
|
| 32 |
-
15%|โโ | 15/100 [13:55<1:20:42, 56.97s/trial, best loss: -0.4756]
|
| 33 |
-
16%|โโ | 16/100 [14:28<1:09:36, 49.72s/trial, best loss: -0.4756]
|
| 34 |
-
17%|โโ | 17/100 [15:44<1:19:28, 57.45s/trial, best loss: -0.4756]
|
| 35 |
-
18%|โโ | 18/100 [16:32<1:14:59, 54.87s/trial, best loss: -0.4756]
|
| 36 |
-
19%|โโ | 19/100 [18:02<1:28:10, 65.32s/trial, best loss: -0.4756]
|
| 37 |
-
20%|โโ | 20/100 [18:39<1:15:40, 56.75s/trial, best loss: -0.4756]
|
| 38 |
-
21%|โโ | 21/100 [19:43<1:17:41, 59.01s/trial, best loss: -0.4756]
|
| 39 |
-
22%|โโโ | 22/100 [20:26<1:10:23, 54.15s/trial, best loss: -0.4756]
|
| 40 |
-
23%|โโโ | 23/100 [21:19<1:09:13, 53.95s/trial, best loss: -0.4763]
|
| 41 |
-
24%|โโโ | 24/100 [21:59<1:02:44, 49.53s/trial, best loss: -0.4795]
|
| 42 |
-
25%|โโโ | 25/100 [22:30<55:02, 44.04s/trial, best loss: -0.4795]
|
| 43 |
-
26%|โโโ | 26/100 [23:16<55:08, 44.71s/trial, best loss: -0.4795]
|
| 44 |
-
27%|โโโ | 27/100 [24:03<55:13, 45.39s/trial, best loss: -0.481]
|
| 45 |
-
28%|โโโ | 28/100 [24:32<48:28, 40.39s/trial, best loss: -0.4816]
|
| 46 |
-
29%|โโโ | 29/100 [24:56<42:07, 35.60s/trial, best loss: -0.4816]
|
| 47 |
-
30%|โโโ | 30/100 [25:23<38:21, 32.88s/trial, best loss: -0.4816]
|
| 48 |
-
31%|โโโ | 31/100 [25:54<37:18, 32.45s/trial, best loss: -0.4838]
|
| 49 |
-
32%|โโโโ | 32/100 [26:22<35:07, 30.99s/trial, best loss: -0.4838]
|
| 50 |
-
33%|โโโโ | 33/100 [26:53<34:38, 31.03s/trial, best loss: -0.4838]
|
| 51 |
-
34%|โโโโ | 34/100 [27:39<38:58, 35.44s/trial, best loss: -0.4838]
|
| 52 |
-
35%|โโโโ | 35/100 [28:08<36:29, 33.69s/trial, best loss: -0.4838]
|
| 53 |
-
36%|โโโโ | 36/100 [28:40<35:19, 33.11s/trial, best loss: -0.4838]
|
| 54 |
-
37%|โโโโ | 37/100 [29:11<34:09, 32.54s/trial, best loss: -0.4838]
|
| 55 |
-
38%|โโโโ | 38/100 [29:49<35:16, 34.13s/trial, best loss: -0.4838]
|
| 56 |
-
39%|โโโโ | 39/100 [30:34<37:59, 37.37s/trial, best loss: -0.4838]
|
| 57 |
-
40%|โโโโ | 40/100 [31:40<46:04, 46.07s/trial, best loss: -0.4838]
|
| 58 |
-
41%|โโโโ | 41/100 [32:06<39:16, 39.94s/trial, best loss: -0.4838]
|
| 59 |
-
42%|โโโโโ | 42/100 [32:32<34:30, 35.71s/trial, best loss: -0.4838]
|
| 60 |
-
43%|โโโโโ | 43/100 [32:54<30:06, 31.69s/trial, best loss: -0.4838]
|
| 61 |
-
44%|โโโโโ | 44/100 [33:30<30:43, 32.92s/trial, best loss: -0.4838]
|
| 62 |
-
45%|โโโโโ | 45/100 [34:00<29:21, 32.02s/trial, best loss: -0.4838]
|
| 63 |
-
46%|โโโโโ | 46/100 [34:59<36:12, 40.24s/trial, best loss: -0.4838]
|
| 64 |
-
47%|โโโโโ | 47/100 [35:42<36:16, 41.07s/trial, best loss: -0.4838]
|
| 65 |
-
48%|โโโโโ | 48/100 [36:56<44:04, 50.86s/trial, best loss: -0.4838]
|
| 66 |
-
49%|โโโโโ | 49/100 [37:20<36:16, 42.67s/trial, best loss: -0.4838]
|
| 67 |
-
50%|โโโโโ | 50/100 [38:41<45:07, 54.15s/trial, best loss: -0.4838]
|
| 68 |
-
51%|โโโโโ | 51/100 [39:30<43:10, 52.86s/trial, best loss: -0.4838]
|
| 69 |
-
52%|โโโโโโ | 52/100 [40:23<42:13, 52.79s/trial, best loss: -0.4838]
|
| 70 |
-
53%|โโโโโโ | 53/100 [41:21<42:28, 54.23s/trial, best loss: -0.4838]
|
| 71 |
-
54%|โโโโโโ | 54/100 [41:56<37:14, 48.57s/trial, best loss: -0.4838]
|
| 72 |
-
55%|โโโโโโ | 55/100 [42:27<32:24, 43.21s/trial, best loss: -0.4838]
|
| 73 |
-
56%|โโโโโโ | 56/100 [43:06<30:53, 42.12s/trial, best loss: -0.4838]
|
| 74 |
-
57%|โโโโโโ | 57/100 [43:27<25:38, 35.79s/trial, best loss: -0.4838]
|
| 75 |
-
58%|โโโโโโ | 58/100 [44:15<27:28, 39.25s/trial, best loss: -0.4838]
|
| 76 |
-
59%|โโโโโโ | 59/100 [44:54<26:54, 39.38s/trial, best loss: -0.4838]
|
| 77 |
-
60%|โโโโโโ | 60/100 [45:39<27:23, 41.09s/trial, best loss: -0.4838]
|
| 78 |
-
61%|โโโโโโ | 61/100 [46:33<29:11, 44.90s/trial, best loss: -0.4838]
|
| 79 |
-
62%|โโโโโโโ | 62/100 [47:06<26:07, 41.26s/trial, best loss: -0.4838]
|
| 80 |
-
63%|โโโโโโโ | 63/100 [47:27<21:38, 35.09s/trial, best loss: -0.4838]
|
| 81 |
-
64%|โโโโโโโ | 64/100 [48:11<22:40, 37.78s/trial, best loss: -0.4838]
|
| 82 |
-
65%|โโโโโโโ | 65/100 [48:42<20:49, 35.71s/trial, best loss: -0.4838]
|
| 83 |
-
66%|โโโโโโโ | 66/100 [49:36<23:23, 41.27s/trial, best loss: -0.4838]
|
| 84 |
-
67%|โโโโโโโ | 67/100 [50:34<25:32, 46.43s/trial, best loss: -0.4838]
|
| 85 |
-
68%|โโโโโโโ | 68/100 [51:19<24:26, 45.84s/trial, best loss: -0.4838]
|
| 86 |
-
69%|โโโโโโโ | 69/100 [52:09<24:18, 47.04s/trial, best loss: -0.4838]
|
| 87 |
-
70%|โโโโโโโ | 70/100 [52:47<22:09, 44.33s/trial, best loss: -0.4838]
|
| 88 |
-
71%|โโโโโโโ | 71/100 [53:47<23:49, 49.28s/trial, best loss: -0.4861]
|
| 89 |
-
72%|โโโโโโโโ | 72/100 [54:34<22:35, 48.41s/trial, best loss: -0.4861]
|
| 90 |
-
73%|โโโโโโโโ | 73/100 [55:40<24:12, 53.81s/trial, best loss: -0.4861]
|
| 91 |
-
74%|โโโโโโโโ | 74/100 [56:24<22:02, 50.87s/trial, best loss: -0.4861]
|
| 92 |
-
75%|โโโโโโโโ | 75/100 [57:19<21:38, 51.93s/trial, best loss: -0.4861]
|
| 93 |
-
76%|โโโโโโโโ | 76/100 [58:34<23:31, 58.83s/trial, best loss: -0.4861]
|
| 94 |
-
77%|โโโโโโโโ | 77/100 [59:31<22:22, 58.39s/trial, best loss: -0.4861]
|
| 95 |
-
78%|โโโโโโโโ | 78/100 [1:00:32<21:41, 59.16s/trial, best loss: -0.4861]
|
| 96 |
-
79%|โโโโโโโโ | 79/100 [1:01:33<20:56, 59.84s/trial, best loss: -0.4861]
|
| 97 |
-
80%|โโโโโโโโ | 80/100 [1:02:32<19:49, 59.48s/trial, best loss: -0.4861]
|
| 98 |
-
81%|โโโโโโโโ | 81/100 [1:03:29<18:35, 58.69s/trial, best loss: -0.4861]
|
| 99 |
-
82%|โโโโโโโโโ | 82/100 [1:04:16<16:33, 55.21s/trial, best loss: -0.4861]
|
| 100 |
-
83%|โโโโโโโโโ | 83/100 [1:05:07<15:18, 54.04s/trial, best loss: -0.4861]
|
| 101 |
-
84%|โโโโโโโโโ | 84/100 [1:05:42<12:53, 48.33s/trial, best loss: -0.4861]
|
| 102 |
-
85%|โโโโโโโโโ | 85/100 [1:06:22<11:24, 45.63s/trial, best loss: -0.4861]
|
| 103 |
-
86%|โโโโโโโโโ | 86/100 [1:07:23<11:43, 50.26s/trial, best loss: -0.4861]
|
| 104 |
-
87%|โโโโโโโโโ | 87/100 [1:07:51<09:27, 43.68s/trial, best loss: -0.4861]
|
| 105 |
-
88%|โโโโโโโโโ | 88/100 [1:08:33<08:38, 43.22s/trial, best loss: -0.4861]
|
| 106 |
-
89%|โโโโโโโโโ | 89/100 [1:09:12<07:42, 42.07s/trial, best loss: -0.4861]
|
| 107 |
-
90%|โโโโโโโโโ | 90/100 [1:10:43<09:26, 56.65s/trial, best loss: -0.4861]
|
| 108 |
-
91%|โโโโโโโโโ | 91/100 [1:11:46<08:46, 58.50s/trial, best loss: -0.4861]
|
| 109 |
-
92%|โโโโโโโโโโ| 92/100 [1:12:41<07:39, 57.41s/trial, best loss: -0.4861]
|
| 110 |
-
93%|โโโโโโโโโโ| 93/100 [1:13:12<05:47, 49.68s/trial, best loss: -0.4861]
|
| 111 |
-
94%|โโโโโโโโโโ| 94/100 [1:14:05<05:03, 50.65s/trial, best loss: -0.4861]
|
| 112 |
-
95%|โโโโโโโโโโ| 95/100 [1:15:05<04:26, 53.38s/trial, best loss: -0.4861]
|
| 113 |
-
96%|โโโโโโโโโโ| 96/100 [1:15:37<03:07, 46.98s/trial, best loss: -0.4861]
|
| 114 |
-
97%|โโโโโโโโโโ| 97/100 [1:16:26<02:22, 47.59s/trial, best loss: -0.4861]
|
| 115 |
-
98%|โโโโโโโโโโ| 98/100 [1:17:10<01:32, 46.49s/trial, best loss: -0.4861]
|
| 116 |
-
99%|โโโโโโโโโโ| 99/100 [1:17:41<00:41, 41.78s/trial, best loss: -0.4861]
|
| 117 |
-
100%|โโโโโโโโโโ| 100/100 [1:18:46<00:00, 48.69s/trial, best loss: -0.4861]
|
| 118 |
-
100%|โโโโโโโโโโ| 100/100 [1:18:46<00:00, 47.26s/trial, best loss: -0.4861]
|
| 119 |
-
|
| 120 |
-
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.791441621112874, 'gamma': 0.42439975661558715, 'learning_rate': 0.011136150784699721, 'max_depth': 12.0, 'min_child_weight': 12.0, 'reg_alpha': 0.5297190743505086, 'reg_lambda': 0.8682538180888419, 'subsample': 0.736720141444502}
|
| 121 |
-
์ต์ CSI ์ ์: 0.4861 (loss: -0.4861)
|
| 122 |
-
|
| 123 |
-
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 124 |
-
- ์ด ์๋ ํ์: 100
|
| 125 |
-
- ์ฑ๊ณตํ ์๋: 100
|
| 126 |
-
- ์ต์ด CSI: 0.4742
|
| 127 |
-
- ์ต์ข
CSI: 0.4829
|
| 128 |
-
- ์ต๊ณ CSI: 0.4861
|
| 129 |
-
- ์ต์ CSI: 0.4146
|
| 130 |
-
- ํ๊ท CSI: 0.4732
|
| 131 |
-
|
| 132 |
-
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ ../optimization_history/xgb_ctgan10000_busan_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 133 |
-
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 134 |
-
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 135 |
-
Fold 1 ๊ฒ์ฆ CSI: 0.4306
|
| 136 |
-
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 137 |
-
Fold 2 ๊ฒ์ฆ CSI: 0.5131
|
| 138 |
-
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 139 |
-
Fold 3 ๊ฒ์ฆ CSI: 0.5145
|
| 140 |
-
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 141 |
-
๋ชจ๋ธ์ด ../save_model/xgb_optima/xgb_ctgan10000_busan.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 142 |
-
|
| 143 |
-
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_busan.py (์์ ์๊ฐ: 4785์ด)
|
| 144 |
-
|
| 145 |
-
โ ๏ธ ๊ฒฝ๊ณ : xgb_ctgan10000/XGB_ctgan10000_daegu.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 146 |
-
โ ๏ธ ๊ฒฝ๊ณ : xgb_ctgan10000/XGB_ctgan10000_daejeon.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 147 |
-
โ ๏ธ ๊ฒฝ๊ณ : xgb_ctgan10000/XGB_ctgan10000_gwangju.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 148 |
-
โ ๏ธ ๊ฒฝ๊ณ : xgb_ctgan10000/XGB_ctgan10000_incheon.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 149 |
-
โ ๏ธ ๊ฒฝ๊ณ : xgb_ctgan10000/XGB_ctgan10000_seoul.py ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฑด๋๋๋๋ค.
|
| 150 |
-
==========================================
|
| 151 |
-
XGB CTGAN10000 ํ์ผ ์คํ ์๋ฃ
|
| 152 |
-
์ข
๋ฃ ์๊ฐ: 2025-12-23 20:28:10
|
| 153 |
-
์ด ์์ ์๊ฐ: 1์๊ฐ 19๋ถ 45์ด
|
| 154 |
-
์ฑ๊ณต: 1๊ฐ
|
| 155 |
-
์คํจ: 5๊ฐ
|
| 156 |
-
==========================================
|
| 157 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 158 |
1%| | 1/100 [01:00<1:39:06, 60.06s/trial, best loss: -0.4522]
|
| 159 |
2%|โ | 2/100 [01:27<1:06:28, 40.70s/trial, best loss: -0.4709]
|
| 160 |
3%|โ | 3/100 [02:00<1:00:22, 37.35s/trial, best loss: -0.4806]
|
| 161 |
4%|โ | 4/100 [02:36<58:57, 36.85s/trial, best loss: -0.4806]
|
| 162 |
5%|โ | 5/100 [02:59<50:07, 31.66s/trial, best loss: -0.4822]
|
| 163 |
6%|โ | 6/100 [03:46<57:59, 37.02s/trial, best loss: -0.4822]
|
| 164 |
7%|โ | 7/100 [04:12<51:49, 33.43s/trial, best loss: -0.4822]
|
| 165 |
8%|โ | 8/100 [04:40<48:45, 31.80s/trial, best loss: -0.4822]
|
| 166 |
9%|โ | 9/100 [05:37<1:00:09, 39.66s/trial, best loss: -0.4822]
|
| 167 |
10%|โ | 10/100 [06:13<57:38, 38.43s/trial, best loss: -0.4822]
|
| 168 |
11%|โ | 11/100 [06:34<49:07, 33.12s/trial, best loss: -0.4822]
|
| 169 |
12%|โโ | 12/100 [07:20<54:22, 37.07s/trial, best loss: -0.4822]
|
| 170 |
13%|โโ | 13/100 [08:01<55:35, 38.34s/trial, best loss: -0.4822]
|
| 171 |
14%|โโ | 14/100 [08:34<52:25, 36.57s/trial, best loss: -0.4822]
|
| 172 |
15%|โโ | 15/100 [09:03<48:30, 34.24s/trial, best loss: -0.4822]
|
| 173 |
16%|โโ | 16/100 [09:29<44:45, 31.97s/trial, best loss: -0.4822]
|
| 174 |
17%|โโ | 17/100 [10:29<55:53, 40.40s/trial, best loss: -0.4822]
|
| 175 |
18%|โโ | 18/100 [10:46<45:13, 33.10s/trial, best loss: -0.4822]
|
| 176 |
19%|โโ | 19/100 [11:11<41:26, 30.70s/trial, best loss: -0.4822]
|
| 177 |
20%|โโ | 20/100 [11:37<39:10, 29.38s/trial, best loss: -0.4822]
|
| 178 |
21%|โโ | 21/100 [12:17<42:42, 32.43s/trial, best loss: -0.4822]
|
| 179 |
22%|โโโ | 22/100 [13:23<55:18, 42.55s/trial, best loss: -0.4822]
|
| 180 |
23%|โโโ | 23/100 [13:58<51:48, 40.37s/trial, best loss: -0.4822]
|
| 181 |
24%|โโโ | 24/100 [14:29<47:44, 37.69s/trial, best loss: -0.4822]
|
| 182 |
25%|โโโ | 25/100 [16:19<1:14:11, 59.35s/trial, best loss: -0.4822]
|
| 183 |
26%|โโโ | 26/100 [16:57<1:05:04, 52.76s/trial, best loss: -0.4822]
|
| 184 |
27%|โโโ | 27/100 [17:39<1:00:28, 49.70s/trial, best loss: -0.4822]
|
| 185 |
28%|โโโ | 28/100 [18:11<53:04, 44.23s/trial, best loss: -0.4822]
|
| 186 |
29%|โโโ | 29/100 [18:34<44:58, 38.01s/trial, best loss: -0.4822]
|
| 187 |
30%|โโโ | 30/100 [19:28<49:57, 42.82s/trial, best loss: -0.4822]
|
| 188 |
31%|โโโ | 31/100 [20:07<47:46, 41.54s/trial, best loss: -0.4822]
|
| 189 |
32%|โโโโ | 32/100 [20:43<45:24, 40.07s/trial, best loss: -0.4822]
|
| 190 |
33%|โโโโ | 33/100 [21:19<43:07, 38.62s/trial, best loss: -0.4822]
|
| 191 |
34%|โโโโ | 34/100 [21:48<39:24, 35.83s/trial, best loss: -0.4822]
|
| 192 |
35%|โโโโ | 35/100 [22:31<41:08, 37.98s/trial, best loss: -0.4822]
|
| 193 |
36%|โโโโ | 36/100 [23:04<39:03, 36.62s/trial, best loss: -0.4822]
|
| 194 |
37%|โโโโ | 37/100 [23:23<32:46, 31.22s/trial, best loss: -0.4822]
|
| 195 |
38%|โโโโ | 38/100 [24:18<39:43, 38.44s/trial, best loss: -0.4822]
|
| 196 |
39%|โโโโ | 39/100 [24:56<38:44, 38.10s/trial, best loss: -0.4822]
|
| 197 |
40%|โโโโ | 40/100 [25:22<34:34, 34.57s/trial, best loss: -0.4822]
|
| 198 |
41%|โโโโ | 41/100 [26:22<41:38, 42.35s/trial, best loss: -0.4822]
|
| 199 |
42%|โโโโโ | 42/100 [26:55<38:01, 39.34s/trial, best loss: -0.4822]
|
| 200 |
43%|โโโโโ | 43/100 [27:18<32:39, 34.38s/trial, best loss: -0.4822]
|
| 201 |
44%|โโโโโ | 44/100 [27:47<30:33, 32.74s/trial, best loss: -0.4822]
|
| 202 |
45%|โโโโโ | 45/100 [28:19<29:49, 32.54s/trial, best loss: -0.4822]
|
| 203 |
46%|โโโโโ | 46/100 [28:45<27:34, 30.64s/trial, best loss: -0.4822]
|
| 204 |
47%|โโโโโ | 47/100 [29:14<26:38, 30.15s/trial, best loss: -0.4822]
|
| 205 |
48%|โโโโโ | 48/100 [29:46<26:33, 30.65s/trial, best loss: -0.4822]
|
| 206 |
49%|โโโโโ | 49/100 [30:25<28:21, 33.36s/trial, best loss: -0.4822]
|
| 207 |
50%|โโโโโ | 50/100 [31:31<35:53, 43.06s/trial, best loss: -0.4822]
|
| 208 |
51%|โโโโโ | 51/100 [31:58<31:21, 38.40s/trial, best loss: -0.4822]
|
| 209 |
52%|โโโโโโ | 52/100 [32:28<28:27, 35.58s/trial, best loss: -0.4822]
|
| 210 |
53%|โโโโโโ | 53/100 [33:11<29:43, 37.96s/trial, best loss: -0.4822]
|
| 211 |
54%|โโโโโโ | 54/100 [33:55<30:23, 39.63s/trial, best loss: -0.4822]
|
| 212 |
55%|โโโโโโ | 55/100 [34:24<27:21, 36.48s/trial, best loss: -0.4822]
|
| 213 |
56%|โโโโโโ | 56/100 [34:51<24:49, 33.84s/trial, best loss: -0.4822]
|
| 214 |
57%|โโโโโโ | 57/100 [35:28<24:50, 34.66s/trial, best loss: -0.4822]
|
| 215 |
58%|โโโโโโ | 58/100 [36:06<25:02, 35.78s/trial, best loss: -0.4822]
|
| 216 |
59%|โโโโโโ | 59/100 [36:42<24:24, 35.72s/trial, best loss: -0.4822]
|
| 217 |
60%|โโโโโโ | 60/100 [37:06<21:31, 32.29s/trial, best loss: -0.4822]
|
| 218 |
61%|โโโโโโ | 61/100 [37:32<19:40, 30.28s/trial, best loss: -0.4822]
|
| 219 |
62%|โโโโโโโ | 62/100 [38:46<27:34, 43.54s/trial, best loss: -0.4822]
|
| 220 |
63%|โโโโโโโ | 63/100 [39:13<23:43, 38.47s/trial, best loss: -0.4822]
|
| 221 |
64%|โโโโโโโ | 64/100 [39:56<23:52, 39.79s/trial, best loss: -0.4822]
|
| 222 |
65%|โโโโโโโ | 65/100 [40:47<25:10, 43.16s/trial, best loss: -0.4822]
|
| 223 |
66%|โโโโโโโ | 66/100 [41:09<20:56, 36.97s/trial, best loss: -0.4822]
|
| 224 |
67%|โโโโโโโ | 67/100 [41:44<19:56, 36.27s/trial, best loss: -0.4822]
|
| 225 |
68%|โโโโโโโ | 68/100 [42:13<18:06, 33.96s/trial, best loss: -0.4822]
|
| 226 |
69%|โโโโโโโ | 69/100 [42:38<16:17, 31.53s/trial, best loss: -0.4822]
|
| 227 |
70%|โโโโโโโ | 70/100 [43:17<16:46, 33.55s/trial, best loss: -0.4822]
|
| 228 |
71%|โโโโโโโ | 71/100 [44:05<18:23, 38.06s/trial, best loss: -0.4822]
|
| 229 |
72%|โโโโโโโโ | 72/100 [44:36<16:42, 35.80s/trial, best loss: -0.4822]
|
| 230 |
73%|โโโโโโโโ | 73/100 [44:57<14:11, 31.55s/trial, best loss: -0.4822]
|
| 231 |
74%|โโโโโโโโ | 74/100 [45:29<13:43, 31.66s/trial, best loss: -0.4822]
|
| 232 |
75%|โโโโโโโโ | 75/100 [45:50<11:52, 28.50s/trial, best loss: -0.4822]
|
| 233 |
76%|โโโโโโโโ | 76/100 [46:19<11:22, 28.43s/trial, best loss: -0.4822]
|
| 234 |
77%|โโโโโโโโ | 77/100 [46:44<10:32, 27.51s/trial, best loss: -0.4822]
|
| 235 |
78%|โโโโโโโโ | 78/100 [47:10<09:56, 27.11s/trial, best loss: -0.4822]
|
| 236 |
79%|โโโโโโโโ | 79/100 [47:56<11:27, 32.75s/trial, best loss: -0.4822]
|
| 237 |
80%|โโโโโโโโ | 80/100 [48:24<10:24, 31.23s/trial, best loss: -0.4822]
|
| 238 |
81%|โโโโโโโโ | 81/100 [48:43<08:45, 27.68s/trial, best loss: -0.4822]
|
| 239 |
82%|โโโโโโโโโ | 82/100 [49:12<08:25, 28.09s/trial, best loss: -0.4822]
|
| 240 |
83%|โโโโโโโโโ | 83/100 [49:39<07:49, 27.62s/trial, best loss: -0.4822]
|
| 241 |
84%|โโโโโโโโโ | 84/100 [50:07<07:24, 27.78s/trial, best loss: -0.4822]
|
| 242 |
85%|โโโโโโโโโ | 85/100 [50:55<08:25, 33.72s/trial, best loss: -0.4822]
|
| 243 |
86%|โโโโโโโโโ | 86/100 [51:11<06:38, 28.47s/trial, best loss: -0.4845]
|
| 244 |
87%|โโโโโโโโโ | 87/100 [51:30<05:33, 25.68s/trial, best loss: -0.4845]
|
| 245 |
88%|โโโโโโโโโ | 88/100 [52:03<05:34, 27.85s/trial, best loss: -0.4845]
|
| 246 |
89%|โโโโโโโโโ | 89/100 [52:36<05:23, 29.37s/trial, best loss: -0.4845]
|
| 247 |
90%|โโโโโโโโโ | 90/100 [53:00<04:38, 27.88s/trial, best loss: -0.4845]
|
| 248 |
91%|โโโโโโโโโ | 91/100 [53:23<03:56, 26.31s/trial, best loss: -0.4845]
|
| 249 |
92%|โโโโโโโโโโ| 92/100 [54:16<04:34, 34.36s/trial, best loss: -0.4845]
|
| 250 |
93%|โโโโโโโโโโ| 93/100 [54:44<03:47, 32.57s/trial, best loss: -0.4845]
|
| 251 |
94%|โโโโโโโโโโ| 94/100 [55:04<02:52, 28.71s/trial, best loss: -0.4845]
|
| 252 |
95%|โโโโโโโโโโ| 95/100 [55:47<02:45, 33.04s/trial, best loss: -0.4845]
|
| 253 |
96%|โโโโโโโโโโ| 96/100 [56:11<02:01, 30.30s/trial, best loss: -0.4845]
|
| 254 |
97%|โโโโโโโโโโ| 97/100 [56:42<01:31, 30.51s/trial, best loss: -0.4845]
|
| 255 |
98%|โโโโโโโโโโ| 98/100 [57:01<00:53, 26.91s/trial, best loss: -0.4845]
|
| 256 |
99%|โโโโโโโโโโ| 99/100 [57:30<00:27, 27.60s/trial, best loss: -0.4881]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 258 |
1%| | 1/100 [00:44<1:13:09, 44.34s/trial, best loss: -0.4037]
|
| 259 |
2%|โ | 2/100 [01:13<58:05, 35.57s/trial, best loss: -0.4037]
|
| 260 |
3%|โ | 3/100 [01:31<44:34, 27.57s/trial, best loss: -0.4037]
|
| 261 |
4%|โ | 4/100 [02:03<46:37, 29.14s/trial, best loss: -0.427]
|
| 262 |
5%|โ | 5/100 [02:28<43:56, 27.75s/trial, best loss: -0.427]
|
| 263 |
6%|โ | 6/100 [03:09<50:15, 32.08s/trial, best loss: -0.427]
|
| 264 |
7%|โ | 7/100 [03:47<52:46, 34.05s/trial, best loss: -0.427]
|
| 265 |
8%|โ | 8/100 [04:35<59:09, 38.58s/trial, best loss: -0.427]
|
| 266 |
9%|โ | 9/100 [05:06<55:05, 36.32s/trial, best loss: -0.427]
|
| 267 |
10%|โ | 10/100 [05:26<46:43, 31.15s/trial, best loss: -0.427]
|
| 268 |
11%|โ | 11/100 [05:59<47:10, 31.80s/trial, best loss: -0.427]
|
| 269 |
12%|โโ | 12/100 [06:38<49:41, 33.88s/trial, best loss: -0.427]
|
| 270 |
13%|โโ | 13/100 [07:14<49:58, 34.47s/trial, best loss: -0.427]
|
| 271 |
14%|โโ | 14/100 [07:46<48:22, 33.75s/trial, best loss: -0.427]
|
| 272 |
15%|โโ | 15/100 [08:53<1:02:15, 43.95s/trial, best loss: -0.427]
|
| 273 |
16%|โโ | 16/100 [09:27<57:04, 40.77s/trial, best loss: -0.427]
|
| 274 |
17%|โโ | 17/100 [09:54<50:35, 36.57s/trial, best loss: -0.427]
|
| 275 |
18%|โโ | 18/100 [10:31<50:22, 36.86s/trial, best loss: -0.427]
|
| 276 |
19%|โโ | 19/100 [11:01<46:58, 34.80s/trial, best loss: -0.427]
|
| 277 |
20%|โโ | 20/100 [11:33<45:04, 33.81s/trial, best loss: -0.4356]
|
| 278 |
21%|โโ | 21/100 [11:58<41:05, 31.21s/trial, best loss: -0.4356]
|
| 279 |
22%|โโโ | 22/100 [12:28<40:14, 30.96s/trial, best loss: -0.4356]
|
| 280 |
23%|โโโ | 23/100 [12:59<39:36, 30.86s/trial, best loss: -0.4356]
|
| 281 |
24%|โโโ | 24/100 [13:22<36:20, 28.69s/trial, best loss: -0.4356]
|
| 282 |
25%|โโโ | 25/100 [13:43<32:45, 26.20s/trial, best loss: -0.4356]
|
| 283 |
26%|โโโ | 26/100 [14:31<40:32, 32.87s/trial, best loss: -0.4356]
|
| 284 |
27%|โโโ | 27/100 [15:03<39:37, 32.57s/trial, best loss: -0.4356]
|
| 285 |
28%|โโโ | 28/100 [15:44<42:03, 35.05s/trial, best loss: -0.4356]
|
| 286 |
29%|โโโ | 29/100 [16:06<36:44, 31.04s/trial, best loss: -0.4356]
|
| 287 |
30%|โโโ | 30/100 [16:31<34:04, 29.21s/trial, best loss: -0.4356]
|
| 288 |
31%|โโโ | 31/100 [17:21<40:48, 35.48s/trial, best loss: -0.4356]
|
| 289 |
32%|โโโโ | 32/100 [17:53<38:59, 34.40s/trial, best loss: -0.4356]
|
| 290 |
33%|โโโโ | 33/100 [18:25<37:36, 33.68s/trial, best loss: -0.4356]
|
| 291 |
34%|โโโโ | 34/100 [19:02<38:21, 34.87s/trial, best loss: -0.4356]
|
| 292 |
35%|โโโโ | 35/100 [19:46<40:41, 37.56s/trial, best loss: -0.4356]
|
| 293 |
36%|โโโโ | 36/100 [20:19<38:39, 36.24s/trial, best loss: -0.4356]
|
| 294 |
37%|โโโโ | 37/100 [20:58<38:45, 36.92s/trial, best loss: -0.4356]
|
| 295 |
38%|โโโโ | 38/100 [21:35<38:17, 37.06s/trial, best loss: -0.4356]
|
| 296 |
39%|โโโโ | 39/100 [22:13<37:55, 37.30s/trial, best loss: -0.4356]
|
| 297 |
40%|โโโโ | 40/100 [22:50<37:13, 37.22s/trial, best loss: -0.4356]
|
| 298 |
41%|โโโโ | 41/100 [23:24<35:32, 36.15s/trial, best loss: -0.4356]
|
| 299 |
42%|โโโโโ | 42/100 [24:04<36:02, 37.29s/trial, best loss: -0.4356]
|
| 300 |
43%|โโโโโ | 43/100 [24:49<37:45, 39.75s/trial, best loss: -0.4356]
|
| 301 |
44%|โโโโโ | 44/100 [25:16<33:24, 35.80s/trial, best loss: -0.4356]
|
| 302 |
45%|โโโโโ | 45/100 [26:10<37:56, 41.39s/trial, best loss: -0.4356]
|
| 303 |
46%|โโโโโ | 46/100 [26:50<36:48, 40.90s/trial, best loss: -0.4356]
|
| 304 |
47%|โโโโโ | 47/100 [27:14<31:46, 35.97s/trial, best loss: -0.4356]
|
| 305 |
48%|โโโ๏ฟฝ๏ฟฝ๏ฟฝโ | 48/100 [27:47<30:19, 35.00s/trial, best loss: -0.4356]
|
| 306 |
49%|โโโโโ | 49/100 [28:32<32:12, 37.89s/trial, best loss: -0.4356]
|
| 307 |
50%|โโโโโ | 50/100 [29:28<36:14, 43.50s/trial, best loss: -0.4356]
|
| 308 |
51%|โโโโโ | 51/100 [30:21<37:40, 46.14s/trial, best loss: -0.4356]
|
| 309 |
52%|โโโโโโ | 52/100 [31:09<37:22, 46.71s/trial, best loss: -0.4356]
|
| 310 |
53%|โโโโโโ | 53/100 [32:18<41:53, 53.48s/trial, best loss: -0.4356]
|
| 311 |
54%|โโโโโโ | 54/100 [32:59<38:09, 49.77s/trial, best loss: -0.4356]
|
| 312 |
55%|โโโโโโ | 55/100 [33:27<32:22, 43.16s/trial, best loss: -0.4356]
|
| 313 |
56%|โโโโโโ | 56/100 [33:57<28:47, 39.26s/trial, best loss: -0.4356]
|
| 314 |
57%|โโโโโโ | 57/100 [34:23<25:14, 35.22s/trial, best loss: -0.4356]
|
| 315 |
58%|โโโโโโ | 58/100 [34:48<22:39, 32.38s/trial, best loss: -0.4356]
|
| 316 |
59%|โโโโโโ | 59/100 [35:24<22:48, 33.38s/trial, best loss: -0.4356]
|
| 317 |
60%|โโโโโโ | 60/100 [36:06<23:54, 35.87s/trial, best loss: -0.4356]
|
| 318 |
61%|โโโโโโ | 61/100 [36:30<20:57, 32.23s/trial, best loss: -0.4356]
|
| 319 |
62%|โโโโโโโ | 62/100 [37:49<29:19, 46.31s/trial, best loss: -0.4356]
|
| 320 |
63%|โโโโโโโ | 63/100 [38:30<27:42, 44.93s/trial, best loss: -0.4356]
|
| 321 |
64%|โโโโโโโ | 64/100 [39:13<26:27, 44.09s/trial, best loss: -0.4356]
|
| 322 |
65%|โโโโโโโ | 65/100 [40:08<27:38, 47.39s/trial, best loss: -0.4356]
|
| 323 |
66%|โโโโโโโ | 66/100 [40:29<22:22, 39.48s/trial, best loss: -0.4356]
|
| 324 |
67%|โโโโโโโ | 67/100 [40:47<18:14, 33.17s/trial, best loss: -0.4356]
|
| 325 |
68%|โโโโโโโ | 68/100 [41:12<16:25, 30.80s/trial, best loss: -0.4356]
|
| 326 |
69%|โโโโโโโ | 69/100 [41:34<14:30, 28.09s/trial, best loss: -0.4356]
|
| 327 |
70%|โโโโโโโ | 70/100 [41:55<12:53, 25.80s/trial, best loss: -0.4356]
|
| 328 |
71%|โโโโโโโ | 71/100 [42:33<14:15, 29.51s/trial, best loss: -0.4356]
|
| 329 |
72%|โโโโโโโโ | 72/100 [43:08<14:35, 31.26s/trial, best loss: -0.4356]
|
| 330 |
73%|โโโโโโโโ | 73/100 [43:38<13:51, 30.79s/trial, best loss: -0.4356]
|
| 331 |
74%|โโโโโโโโ | 74/100 [44:06<12:57, 29.92s/trial, best loss: -0.4356]
|
| 332 |
75%|โโโโโโโโ | 75/100 [44:40<13:04, 31.37s/trial, best loss: -0.4356]
|
| 333 |
76%|โโโโโโโโ | 76/100 [45:08<12:05, 30.22s/trial, best loss: -0.4356]
|
| 334 |
77%|โโโโโโโโ | 77/100 [45:38<11:33, 30.17s/trial, best loss: -0.4392]
|
| 335 |
78%|โโโโโโโโ | 78/100 [46:12<11:27, 31.26s/trial, best loss: -0.4392]
|
| 336 |
79%|โโโโโโโโ | 79/100 [46:52<11:55, 34.05s/trial, best loss: -0.4392]
|
| 337 |
80%|โโโโโโโโ | 80/100 [47:46<13:18, 39.93s/trial, best loss: -0.4392]
|
| 338 |
81%|โโโโโโโโ | 81/100 [48:28<12:49, 40.49s/trial, best loss: -0.4392]
|
| 339 |
82%|โโโโโโโโโ | 82/100 [49:20<13:11, 43.98s/trial, best loss: -0.4392]
|
| 340 |
83%|โโโโโโโโโ | 83/100 [49:44<10:44, 37.90s/trial, best loss: -0.4392]
|
| 341 |
84%|โโโโโโโโโ | 84/100 [50:14<09:32, 35.78s/trial, best loss: -0.4392]
|
| 342 |
85%|โโโโโโโโโ | 85/100 [50:59<09:38, 38.55s/trial, best loss: -0.4392]
|
| 343 |
86%|โโโโโโโโโ | 86/100 [51:33<08:39, 37.09s/trial, best loss: -0.4392]
|
| 344 |
87%|โโโโโโโโโ | 87/100 [51:53<06:53, 31.80s/trial, best loss: -0.4392]
|
| 345 |
88%|โโโโโโโโโ | 88/100 [52:14<05:45, 28.78s/trial, best loss: -0.4392]
|
| 346 |
89%|โโโโโโโโโ | 89/100 [52:47<05:28, 29.87s/trial, best loss: -0.4392]
|
| 347 |
90%|โโโโโโโโโ | 90/100 [53:16<04:56, 29.61s/trial, best loss: -0.4392]
|
| 348 |
91%|โโโโโโโโโ | 91/100 [53:43<04:21, 29.03s/trial, best loss: -0.4392]
|
| 349 |
92%|โโโโโโโโโโ| 92/100 [54:14<03:54, 29.37s/trial, best loss: -0.4392]
|
| 350 |
93%|โโโโโโโโโโ| 93/100 [54:35<03:08, 26.99s/trial, best loss: -0.4392]
|
| 351 |
94%|โโโโโโโโโโ| 94/100 [54:59<02:36, 26.00s/trial, best loss: -0.4392]
|
| 352 |
95%|โโโโโโโโโโ| 95/100 [55:37<02:28, 29.75s/trial, best loss: -0.4392]
|
| 353 |
96%|โโโโโโโโโโ| 96/100 [55:55<01:45, 26.28s/trial, best loss: -0.4392]
|
| 354 |
97%|โโโโโโโโโโ| 97/100 [56:31<01:27, 29.00s/trial, best loss: -0.4392]
|
| 355 |
98%|โโโโโโโโโโ| 98/100 [56:54<00:54, 27.17s/trial, best loss: -0.4392]
|
| 356 |
99%|โโโโโโโโโโ| 99/100 [57:34<00:31, 31.01s/trial, best loss: -0.4392]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 358 |
1%| | 1/100 [00:37<1:02:28, 37.86s/trial, best loss: -0.4839]
|
| 359 |
2%|โ | 2/100 [01:13<59:40, 36.53s/trial, best loss: -0.4839]
|
| 360 |
3%|โ | 3/100 [01:51<1:00:22, 37.34s/trial, best loss: -0.4865]
|
| 361 |
4%|โ | 4/100 [02:59<1:19:11, 49.49s/trial, best loss: -0.4865]
|
| 362 |
5%|โ | 5/100 [04:05<1:27:35, 55.32s/trial, best loss: -0.4953]
|
| 363 |
6%|โ | 6/100 [04:39<1:15:30, 48.19s/trial, best loss: -0.4953]
|
| 364 |
7%|โ | 7/100 [05:08<1:04:51, 41.84s/trial, best loss: -0.4953]
|
| 365 |
8%|โ | 8/100 [05:51<1:04:45, 42.23s/trial, best loss: -0.4953]
|
| 366 |
9%|โ | 9/100 [06:43<1:08:41, 45.30s/trial, best loss: -0.4953]
|
| 367 |
10%|โ | 10/100 [07:11<1:00:00, 40.00s/trial, best loss: -0.4953]
|
| 368 |
11%|โ | 11/100 [07:50<58:33, 39.47s/trial, best loss: -0.4953]
|
| 369 |
12%|โโ | 12/100 [08:40<1:02:40, 42.74s/trial, best loss: -0.502]
|
| 370 |
13%|โโ | 13/100 [09:11<56:49, 39.19s/trial, best loss: -0.502]
|
| 371 |
14%|โโ | 14/100 [10:06<1:03:07, 44.04s/trial, best loss: -0.502]
|
| 372 |
15%|โโ | 15/100 [10:59<1:06:00, 46.60s/trial, best loss: -0.502]
|
| 373 |
16%|โโ | 16/100 [11:49<1:06:55, 47.80s/trial, best loss: -0.502]
|
| 374 |
17%|โโ | 17/100 [13:07<1:18:45, 56.93s/trial, best loss: -0.502]
|
| 375 |
18%|โโ | 18/100 [13:24<1:01:13, 44.79s/trial, best loss: -0.502]
|
| 376 |
19%|โโ | 19/100 [13:55<54:42, 40.53s/trial, best loss: -0.502]
|
| 377 |
20%|โโ | 20/100 [14:36<54:26, 40.83s/trial, best loss: -0.502]
|
| 378 |
21%|โโ | 21/100 [15:25<57:02, 43.32s/trial, best loss: -0.502]
|
| 379 |
22%|โโโ | 22/100 [15:51<49:20, 37.95s/trial, best loss: -0.502]
|
| 380 |
23%|โโโ | 23/100 [16:26<47:50, 37.28s/trial, best loss: -0.502]
|
| 381 |
24%|โโโ | 24/100 [16:53<43:12, 34.11s/trial, best loss: -0.502]
|
| 382 |
25%|โโโ | 25/100 [17:17<38:47, 31.04s/trial, best loss: -0.502]
|
| 383 |
26%|โโโ | 26/100 [17:53<39:57, 32.41s/trial, best loss: -0.502]
|
| 384 |
27%|โโโ | 27/100 [18:24<39:06, 32.14s/trial, best loss: -0.502]
|
| 385 |
28%|โโโ | 28/100 [19:03<40:56, 34.12s/trial, best loss: -0.502]
|
| 386 |
29%|โโโ | 29/100 [19:45<43:05, 36.42s/trial, best loss: -0.5029]
|
| 387 |
30%|โโโ | 30/100 [20:21<42:37, 36.54s/trial, best loss: -0.5029]
|
| 388 |
31%|โโโ | 31/100 [20:55<40:57, 35.62s/trial, best loss: -0.5029]
|
| 389 |
32%|โโโโ | 32/100 [21:32<40:42, 35.92s/trial, best loss: -0.5029]
|
| 390 |
33%|โโโโ | 33/100 [22:06<39:42, 35.55s/trial, best loss: -0.5029]
|
| 391 |
34%|โโโโ | 34/100 [22:48<41:01, 37.30s/trial, best loss: -0.5029]
|
| 392 |
35%|โโโโ | 35/100 [23:25<40:19, 37.23s/trial, best loss: -0.5029]
|
| 393 |
36%|โโโโ | 36/100 [24:00<38:58, 36.54s/trial, best loss: -0.5029]
|
| 394 |
37%|โโโโ | 37/100 [24:24<34:28, 32.83s/trial, best loss: -0.5029]
|
| 395 |
38%|โโโโ | 38/100 [24:57<34:06, 33.01s/trial, best loss: -0.5029]
|
| 396 |
39%|โโโโ | 39/100 [25:44<37:50, 37.22s/trial, best loss: -0.5029]
|
| 397 |
40%|โโโโ | 40/100 [26:30<39:40, 39.68s/trial, best loss: -0.5029]
|
| 398 |
41%|โโโโ | 41/100 [27:20<42:07, 42.84s/trial, best loss: -0.5029]
|
| 399 |
42%|โโโโโ | 42/100 [27:51<38:06, 39.41s/trial, best loss: -0.5029]
|
| 400 |
43%|โโโโโ | 43/100 [28:15<33:02, 34.79s/trial, best loss: -0.5029]
|
| 401 |
44%|โโโโโ | 44/100 [29:30<43:38, 46.75s/trial, best loss: -0.5029]
|
| 402 |
45%|โโโโโ | 45/100 [30:15<42:20, 46.19s/trial, best loss: -0.5029]
|
| 403 |
46%|โโโโโ | 46/100 [30:53<39:26, 43.82s/trial, best loss: -0.5029]
|
| 404 |
47%|โโโโโ | 47/100 [31:15<32:57, 37.32s/trial, best loss: -0.5029]
|
| 405 |
48%|โโโโโ | 48/100 [31:43<29:44, 34.32s/trial, best loss: -0.5029]
|
| 406 |
49%|โโโโโ | 49/100 [32:11<27:32, 32.40s/trial, best loss: -0.5029]
|
| 407 |
50%|โโโโโ | 50/100 [32:38<25:52, 31.05s/trial, best loss: -0.5029]
|
| 408 |
51%|โโโโโ | 51/100 [33:21<28:12, 34.55s/trial, best loss: -0.5029]
|
| 409 |
52%|โโโโโโ | 52/100 [33:56<27:48, 34.77s/trial, best loss: -0.5029]
|
| 410 |
53%|โโโโโโ | 53/100 [34:35<28:10, 35.98s/trial, best loss: -0.5029]
|
| 411 |
54%|โโโโโโ | 54/100 [35:06<26:20, 34.36s/trial, best loss: -0.5029]
|
| 412 |
55%|โโโโโโ | 55/100 [35:38<25:22, 33.84s/trial, best loss: -0.5029]
|
| 413 |
56%|โโโโโโ | 56/100 [36:30<28:49, 39.30s/trial, best loss: -0.5029]
|
| 414 |
57%|โโโโโโ | 57/100 [37:21<30:29, 42.55s/trial, best loss: -0.5029]
|
| 415 |
58%|โโโโโโ | 58/100 [38:01<29:24, 42.00s/trial, best loss: -0.5029]
|
| 416 |
59%|โโโโโโ | 59/100 [38:39<27:43, 40.57s/trial, best loss: -0.5029]
|
| 417 |
60%|โโโโโโ | 60/100 [39:17<26:36, 39.92s/trial, best loss: -0.5029]
|
| 418 |
61%|โโโโโโ | 61/100 [40:33<33:02, 50.83s/trial, best loss: -0.5029]
|
| 419 |
62%|โโโโโโโ | 62/100 [41:01<27:54, 44.05s/trial, best loss: -0.5029]
|
| 420 |
63%|โโโโโโโ | 63/100 [41:30<24:15, 39.33s/trial, best loss: -0.5029]
|
| 421 |
64%|โโโโโโโ | 64/100 [42:06<22:58, 38.29s/trial, best loss: -0.5029]
|
| 422 |
65%|โโโโโโโ | 65/100 [42:37<21:10, 36.30s/trial, best loss: -0.5029]
|
| 423 |
66%|โโโโโโโ | 66/100 [43:07<19:29, 34.39s/trial, best loss: -0.5029]
|
| 424 |
67%|โโโโโโโ | 67/100 [43:41<18:52, 34.31s/trial, best loss: -0.5029]
|
| 425 |
68%|โโโโโโโ | 68/100 [44:11<17:29, 32.80s/trial, best loss: -0.5029]
|
| 426 |
69%|โโโโโโโ | 69/100 [44:39<16:10, 31.32s/trial, best loss: -0.5029]
|
| 427 |
70%|โโโโโโโ | 70/100 [45:18<16:51, 33.72s/trial, best loss: -0.5029]
|
| 428 |
71%|โโโโโโโ | 71/100 [46:03<17:59, 37.22s/trial, best loss: -0.5029]
|
| 429 |
72%|โโโโโโโโ | 72/100 [46:37<16:54, 36.22s/trial, best loss: -0.5029]
|
| 430 |
73%|โโโโโโโโ | 73/100 [47:05<15:07, 33.61s/trial, best loss: -0.5029]
|
| 431 |
74%|โโโโโโโโ | 74/100 [47:28<13:13, 30.51s/trial, best loss: -0.5029]
|
| 432 |
75%|โโโโโโโโ | 75/100 [48:09<14:03, 33.75s/trial, best loss: -0.5029]
|
| 433 |
76%|โโโโโโโโ | 76/100 [48:34<12:28, 31.19s/trial, best loss: -0.5029]
|
| 434 |
77%|โโโโโโโโ | 77/100 [49:12<12:40, 33.05s/trial, best loss: -0.5029]
|
| 435 |
78%|โโโโโโโโ | 78/100 [49:46<12:17, 33.50s/trial, best loss: -0.5029]
|
| 436 |
79%|โโโโโโโโ | 79/100 [50:25<12:18, 35.15s/trial, best loss: -0.5029]
|
| 437 |
80%|โโโโโโโโ | 80/100 [51:02<11:49, 35.46s/trial, best loss: -0.5029]
|
| 438 |
81%|โโโโโโโโ | 81/100 [52:07<14:07, 44.61s/trial, best loss: -0.5029]
|
| 439 |
82%|โโโโโโโโโ | 82/100 [52:39<12:13, 40.76s/trial, best loss: -0.5029]
|
| 440 |
83%|โโโโโโโโโ | 83/100 [53:41<13:21, 47.14s/trial, best loss: -0.5029]
|
| 441 |
84%|โโโโโโโโโ | 84/100 [54:31<12:47, 47.94s/trial, best loss: -0.5029]
|
| 442 |
85%|โโโโโโโโโ | 85/100 [54:54<10:06, 40.42s/trial, best loss: -0.5029]
|
| 443 |
86%|โโโโโโโโโ | 86/100 [55:25<08:46, 37.60s/trial, best loss: -0.5029]
|
| 444 |
87%|โโโโโโโโโ | 87/100 [55:54<07:35, 35.01s/trial, best loss: -0.5029]
|
| 445 |
88%|โโโโโโโโโ | 88/100 [56:45<07:56, 39.74s/trial, best loss: -0.5029]
|
| 446 |
89%|โโโโโโโโโ | 89/100 [57:25<07:18, 39.87s/trial, best loss: -0.5029]
|
| 447 |
90%|โโโโโโโโโ | 90/100 [58:02<06:31, 39.12s/trial, best loss: -0.5029]
|
| 448 |
91%|โโโโโโโโโ | 91/100 [58:38<05:42, 38.08s/trial, best loss: -0.5029]
|
| 449 |
92%|โโโโโโโโโโ| 92/100 [59:05<04:39, 34.90s/trial, best loss: -0.5029]
|
| 450 |
93%|โโโโโโโโโโ| 93/100 [1:00:12<05:10, 44.39s/trial, best loss: -0.5029]
|
| 451 |
94%|โโโโโโโโโโ| 94/100 [1:00:53<04:19, 43.29s/trial, best loss: -0.5029]
|
| 452 |
95%|โโโโโโโโโโ| 95/100 [1:01:48<03:54, 46.95s/trial, best loss: -0.5029]
|
| 453 |
96%|โโโโโโโโโโ| 96/100 [1:02:42<03:16, 49.08s/trial, best loss: -0.5029]
|
| 454 |
97%|โโโโโโโโโโ| 97/100 [1:03:52<02:46, 55.36s/trial, best loss: -0.5029]
|
| 455 |
98%|โโโโโโโโโโ| 98/100 [1:04:30<01:39, 49.96s/trial, best loss: -0.5029]
|
| 456 |
99%|โโโโโโโโโโ| 99/100 [1:05:12<00:47, 47.59s/trial, best loss: -0.5029]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 458 |
1%| | 1/100 [00:25<41:41, 25.27s/trial, best loss: -0.4941]
|
| 459 |
2%|โ | 2/100 [01:28<1:17:46, 47.61s/trial, best loss: -0.4941]
|
| 460 |
3%|โ | 3/100 [02:09<1:11:52, 44.46s/trial, best loss: -0.4941]
|
| 461 |
4%|โ | 4/100 [03:21<1:28:25, 55.27s/trial, best loss: -0.4941]
|
| 462 |
5%|โ | 5/100 [04:15<1:26:54, 54.89s/trial, best loss: -0.4941]
|
| 463 |
6%|โ | 6/100 [04:47<1:14:05, 47.29s/trial, best loss: -0.4941]
|
| 464 |
7%|โ | 7/100 [05:30<1:11:03, 45.85s/trial, best loss: -0.4941]
|
| 465 |
8%|โ | 8/100 [06:17<1:10:33, 46.01s/trial, best loss: -0.4941]
|
| 466 |
9%|โ | 9/100 [06:38<58:16, 38.42s/trial, best loss: -0.4941]
|
| 467 |
10%|โ | 10/100 [07:21<59:33, 39.70s/trial, best loss: -0.4941]
|
| 468 |
11%|โ | 11/100 [08:11<1:03:31, 42.82s/trial, best loss: -0.4941]
|
| 469 |
12%|โโ | 12/100 [08:40<56:37, 38.61s/trial, best loss: -0.4941]
|
| 470 |
13%|โโ | 13/100 [09:29<1:00:31, 41.74s/trial, best loss: -0.4941]
|
| 471 |
14%|โโ | 14/100 [09:52<51:46, 36.12s/trial, best loss: -0.4941]
|
| 472 |
15%|โโ | 15/100 [10:31<52:22, 36.96s/trial, best loss: -0.4941]
|
| 473 |
16%|โโ | 16/100 [11:05<50:37, 36.16s/trial, best loss: -0.4941]
|
| 474 |
17%|โโ | 17/100 [12:46<1:16:56, 55.62s/trial, best loss: -0.4941]
|
| 475 |
18%|โโ | 18/100 [13:14<1:04:51, 47.46s/trial, best loss: -0.4941]
|
| 476 |
19%|โโ | 19/100 [13:50<59:23, 44.00s/trial, best loss: -0.4941]
|
| 477 |
20%|โโ | 20/100 [14:43<1:02:07, 46.59s/trial, best loss: -0.4941]
|
| 478 |
21%|โโ | 21/100 [15:08<52:40, 40.00s/trial, best loss: -0.4941]
|
| 479 |
22%|โโโ | 22/100 [15:46<51:25, 39.56s/trial, best loss: -0.4941]
|
| 480 |
23%|โโโ | 23/100 [16:16<47:05, 36.70s/trial, best loss: -0.4975]
|
| 481 |
24%|โโโ | 24/100 [16:56<47:48, 37.75s/trial, best loss: -0.4975]
|
| 482 |
25%|โโโ | 25/100 [17:26<44:15, 35.41s/trial, best loss: -0.4975]
|
| 483 |
26%|โโโ | 26/100 [17:53<40:27, 32.81s/trial, best loss: -0.4975]
|
| 484 |
27%|โโโ | 27/100 [18:16<36:21, 29.89s/trial, best loss: -0.4975]
|
| 485 |
28%|โโโ | 28/100 [18:58<40:12, 33.50s/trial, best loss: -0.4975]
|
| 486 |
29%|โโโ | 29/100 [19:58<48:53, 41.32s/trial, best loss: -0.4975]
|
| 487 |
30%|โโโ | 30/100 [20:29<44:54, 38.49s/trial, best loss: -0.4975]
|
| 488 |
31%|โโโ | 31/100 [21:09<44:27, 38.66s/trial, best loss: -0.4975]
|
| 489 |
32%|โโโโ | 32/100 [21:48<44:08, 38.94s/trial, best loss: -0.4991]
|
| 490 |
33%|โโโโ | 33/100 [22:18<40:26, 36.21s/trial, best loss: -0.4991]
|
| 491 |
34%|โโโโ | 34/100 [22:47<37:32, 34.13s/trial, best loss: -0.4991]
|
| 492 |
35%|โโโโ | 35/100 [23:14<34:32, 31.88s/trial, best loss: -0.4991]
|
| 493 |
36%|โโโโ | 36/100 [23:39<31:40, 29.70s/trial, best loss: -0.4991]
|
| 494 |
37%|โโโโ | 37/100 [24:20<34:47, 33.13s/trial, best loss: -0.4991]
|
| 495 |
38%|โโโโ | 38/100 [24:54<34:35, 33.47s/trial, best loss: -0.4991]
|
| 496 |
39%|โโโโ | 39/100 [25:26<33:35, 33.05s/trial, best loss: -0.4991]
|
| 497 |
40%|โโโโ | 40/100 [26:03<34:11, 34.19s/trial, best loss: -0.4991]
|
| 498 |
41%|โโโโ | 41/100 [26:45<35:55, 36.54s/trial, best loss: -0.4991]
|
| 499 |
42%|โโโโโ | 42/100 [27:12<32:38, 33.76s/trial, best loss: -0.4991]
|
| 500 |
43%|โโโโโ | 43/100 [28:18<41:16, 43.45s/trial, best loss: -0.4991]
|
| 501 |
44%|โโโโโ | 44/100 [28:46<36:11, 38.77s/trial, best loss: -0.4991]
|
| 502 |
45%|โโโโโ | 45/100 [29:38<39:08, 42.71s/trial, best loss: -0.4991]
|
| 503 |
46%|โโโโโ | 46/100 [30:24<39:16, 43.64s/trial, best loss: -0.4991]
|
| 504 |
47%|โโโโโ | 47/100 [30:48<33:24, 37.83s/trial, best loss: -0.4991]
|
| 505 |
48%|โโโโโ | 48/100 [31:18<30:43, 35.45s/trial, best loss: -0.4991]
|
| 506 |
49%|โโโโโ | 49/100 [32:28<38:51, 45.71s/trial, best loss: -0.4991]
|
| 507 |
50%|โโโโโ | 50/100 [32:56<33:50, 40.60s/trial, best loss: -0.4991]
|
| 508 |
51%|โโโโโ | 51/100 [33:45<35:11, 43.09s/trial, best loss: -0.4991]
|
| 509 |
52%|โโโโโโ | 52/100 [34:45<38:28, 48.10s/trial, best loss: -0.4991]
|
| 510 |
53%|โโโโโโ | 53/100 [35:06<31:25, 40.11s/trial, best loss: -0.4991]
|
| 511 |
54%|โ๏ฟฝ๏ฟฝ๏ฟฝโโโโ | 54/100 [35:50<31:31, 41.13s/trial, best loss: -0.4991]
|
| 512 |
55%|โโโโโโ | 55/100 [36:31<30:51, 41.15s/trial, best loss: -0.4991]
|
| 513 |
56%|โโโโโโ | 56/100 [36:51<25:32, 34.83s/trial, best loss: -0.4991]
|
| 514 |
57%|โโโโโโ | 57/100 [37:30<25:48, 36.00s/trial, best loss: -0.4991]
|
| 515 |
58%|โโโโโโ | 58/100 [38:18<27:43, 39.60s/trial, best loss: -0.4991]
|
| 516 |
59%|โโโโโโ | 59/100 [38:42<23:51, 34.91s/trial, best loss: -0.4991]
|
| 517 |
60%|โโโโโโ | 60/100 [39:10<21:51, 32.80s/trial, best loss: -0.4991]
|
| 518 |
61%|โโโโโโ | 61/100 [40:10<26:39, 41.02s/trial, best loss: -0.4991]
|
| 519 |
62%|โโโโโโโ | 62/100 [40:54<26:28, 41.80s/trial, best loss: -0.4991]
|
| 520 |
63%|โโโโโโโ | 63/100 [41:14<21:46, 35.32s/trial, best loss: -0.4991]
|
| 521 |
64%|โโโโโโโ | 64/100 [41:41<19:48, 33.02s/trial, best loss: -0.4991]
|
| 522 |
65%|โโโโโโโ | 65/100 [42:14<19:07, 32.80s/trial, best loss: -0.4991]
|
| 523 |
66%|โโโโโโโ | 66/100 [42:50<19:10, 33.83s/trial, best loss: -0.4991]
|
| 524 |
67%|โโโโโโโ | 67/100 [43:20<18:03, 32.84s/trial, best loss: -0.4991]
|
| 525 |
68%|โโโโโโโ | 68/100 [43:49<16:47, 31.49s/trial, best loss: -0.4991]
|
| 526 |
69%|โโโโโโโ | 69/100 [44:17<15:43, 30.42s/trial, best loss: -0.4991]
|
| 527 |
70%|โโโโโโโ | 70/100 [44:43<14:36, 29.21s/trial, best loss: -0.4991]
|
| 528 |
71%|โโโโโโโ | 71/100 [45:10<13:43, 28.40s/trial, best loss: -0.4991]
|
| 529 |
72%|โโโโโโโโ | 72/100 [45:32<12:25, 26.64s/trial, best loss: -0.4991]
|
| 530 |
73%|โโโโโโโโ | 73/100 [46:05<12:50, 28.55s/trial, best loss: -0.4991]
|
| 531 |
74%|โโโโโโโโ | 74/100 [46:38<12:53, 29.74s/trial, best loss: -0.4991]
|
| 532 |
75%|โโโโโโโโ | 75/100 [47:08<12:28, 29.93s/trial, best loss: -0.4991]
|
| 533 |
76%|โโโโโโโโ | 76/100 [47:36<11:40, 29.19s/trial, best loss: -0.4999]
|
| 534 |
77%|โโโโโโโโ | 77/100 [47:58<10:25, 27.18s/trial, best loss: -0.4999]
|
| 535 |
78%|โโโโโโโโ | 78/100 [48:32<10:40, 29.13s/trial, best loss: -0.4999]
|
| 536 |
79%|โโโโโโโโ | 79/100 [48:55<09:34, 27.34s/trial, best loss: -0.4999]
|
| 537 |
80%|โโโโโโโโ | 80/100 [49:24<09:18, 27.92s/trial, best loss: -0.4999]
|
| 538 |
81%|โโโโโโโโ | 81/100 [49:43<07:58, 25.18s/trial, best loss: -0.4999]
|
| 539 |
82%|โโโโโโโโโ | 82/100 [50:03<07:03, 23.55s/trial, best loss: -0.4999]
|
| 540 |
83%|โโโโโโโโโ | 83/100 [50:25<06:35, 23.24s/trial, best loss: -0.4999]
|
| 541 |
84%|โโโโโโโโโ | 84/100 [50:55<06:41, 25.11s/trial, best loss: -0.4999]
|
| 542 |
85%|โโโโโโโโโ | 85/100 [51:15<05:57, 23.82s/trial, best loss: -0.4999]
|
| 543 |
86%|โโโโโโโโโ | 86/100 [52:06<07:24, 31.75s/trial, best loss: -0.4999]
|
| 544 |
87%|โโโโโโโโโ | 87/100 [52:29<06:20, 29.29s/trial, best loss: -0.4999]
|
| 545 |
88%|โโโโโโโโโ | 88/100 [52:56<05:42, 28.56s/trial, best loss: -0.4999]
|
| 546 |
89%|โโโโโโโโโ | 89/100 [53:27<05:23, 29.39s/trial, best loss: -0.4999]
|
| 547 |
90%|โโโโโโโโโ | 90/100 [53:55<04:47, 28.75s/trial, best loss: -0.4999]
|
| 548 |
91%|โโโโโโโโโ | 91/100 [54:28<04:30, 30.04s/trial, best loss: -0.4999]
|
| 549 |
92%|โโโโโโโโโโ| 92/100 [55:22<04:58, 37.30s/trial, best loss: -0.4999]
|
| 550 |
93%|โโโโโโโโโโ| 93/100 [56:11<04:45, 40.74s/trial, best loss: -0.4999]
|
| 551 |
94%|โโโโโโโโโโ| 94/100 [56:39<03:41, 36.98s/trial, best loss: -0.4999]
|
| 552 |
95%|โโโโโโโโโโ| 95/100 [57:03<02:44, 32.98s/trial, best loss: -0.4999]
|
| 553 |
96%|โโโโโโโโโโ| 96/100 [57:33<02:08, 32.24s/trial, best loss: -0.4999]
|
| 554 |
97%|โโโโโโโโโโ| 97/100 [57:51<01:23, 27.84s/trial, best loss: -0.4999]
|
| 555 |
98%|โโโโโโโโโโ| 98/100 [58:14<00:52, 26.39s/trial, best loss: -0.4999]
|
| 556 |
99%|โโโโโโโโโโ| 99/100 [58:35<00:24, 24.80s/trial, best loss: -0.4999]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 558 |
1%| | 1/100 [00:20<34:14, 20.76s/trial, best loss: -0.5632]
|
| 559 |
2%|โ | 2/100 [00:37<30:03, 18.41s/trial, best loss: -0.5632]
|
| 560 |
3%|โ | 3/100 [01:03<35:30, 21.96s/trial, best loss: -0.5632]
|
| 561 |
4%|โ | 4/100 [01:29<37:51, 23.66s/trial, best loss: -0.5632]
|
| 562 |
5%|โ | 5/100 [01:52<36:56, 23.33s/trial, best loss: -0.5632]
|
| 563 |
6%|โ | 6/100 [02:47<53:33, 34.18s/trial, best loss: -0.5632]
|
| 564 |
7%|โ | 7/100 [03:23<53:40, 34.62s/trial, best loss: -0.5633]
|
| 565 |
8%|โ | 8/100 [04:16<1:01:57, 40.41s/trial, best loss: -0.5633]
|
| 566 |
9%|โ | 9/100 [04:34<50:47, 33.49s/trial, best loss: -0.5633]
|
| 567 |
10%|โ | 10/100 [05:16<54:10, 36.11s/trial, best loss: -0.5633]
|
| 568 |
11%|โ | 11/100 [05:43<49:17, 33.23s/trial, best loss: -0.5633]
|
| 569 |
12%|โโ | 12/100 [06:37<57:55, 39.49s/trial, best loss: -0.5633]
|
| 570 |
13%|โโ | 13/100 [07:17<57:38, 39.75s/trial, best loss: -0.5633]
|
| 571 |
14%|โโ | 14/100 [07:53<55:28, 38.71s/trial, best loss: -0.5633]
|
| 572 |
15%|โโ | 15/100 [08:29<53:39, 37.87s/trial, best loss: -0.5633]
|
| 573 |
16%|โโ | 16/100 [08:55<47:53, 34.21s/trial, best loss: -0.5633]
|
| 574 |
17%|โโ | 17/100 [09:19<42:58, 31.06s/trial, best loss: -0.5633]
|
| 575 |
18%|โโ | 18/100 [10:25<56:45, 41.54s/trial, best loss: -0.5633]
|
| 576 |
19%|โโ | 19/100 [10:47<48:32, 35.95s/trial, best loss: -0.5633]
|
| 577 |
20%|โโ | 20/100 [11:12<43:15, 32.45s/trial, best loss: -0.5633]
|
| 578 |
21%|โโ | 21/100 [11:35<39:02, 29.65s/trial, best loss: -0.5633]
|
| 579 |
22%|โโโ | 22/100 [11:55<34:38, 26.64s/trial, best loss: -0.5633]
|
| 580 |
23%|โโโ | 23/100 [12:16<32:13, 25.11s/trial, best loss: -0.5633]
|
| 581 |
24%|โโโ | 24/100 [12:47<33:55, 26.78s/trial, best loss: -0.5633]
|
| 582 |
25%|โโโ | 25/100 [13:49<46:58, 37.58s/trial, best loss: -0.5633]
|
| 583 |
26%|โโโ | 26/100 [14:16<42:20, 34.33s/trial, best loss: -0.5633]
|
| 584 |
27%|โโโ | 27/100 [14:45<39:33, 32.51s/trial, best loss: -0.5633]
|
| 585 |
28%|โโโ | 28/100 [15:10<36:39, 30.55s/trial, best loss: -0.5633]
|
| 586 |
29%|โโโ | 29/100 [15:42<36:29, 30.84s/trial, best loss: -0.5633]
|
| 587 |
30%|โโโ | 30/100 [16:04<32:59, 28.27s/trial, best loss: -0.5633]
|
| 588 |
31%|โโโ | 31/100 [16:38<34:23, 29.91s/trial, best loss: -0.5645]
|
| 589 |
32%|โโโโ | 32/100 [17:22<38:46, 34.21s/trial, best loss: -0.5706]
|
| 590 |
33%|โโโโ | 33/100 [18:15<44:24, 39.76s/trial, best loss: -0.5706]
|
| 591 |
34%|โโโโ | 34/100 [19:01<45:49, 41.65s/trial, best loss: -0.5706]
|
| 592 |
35%|โโโโ | 35/100 [19:35<42:44, 39.45s/trial, best loss: -0.5714]
|
| 593 |
36%|โโโโ | 36/100 [20:19<43:18, 40.60s/trial, best loss: -0.5714]
|
| 594 |
37%|โโโโ | 37/100 [20:54<40:58, 39.02s/trial, best loss: -0.5728]
|
| 595 |
38%|โโโโ | 38/100 [21:20<36:23, 35.21s/trial, best loss: -0.5728]
|
| 596 |
39%|โโโโ | 39/100 [22:31<46:32, 45.77s/trial, best loss: -0.5728]
|
| 597 |
40%|โโโโ | 40/100 [23:00<40:50, 40.84s/trial, best loss: -0.5728]
|
| 598 |
41%|โโโโ | 41/100 [23:50<42:55, 43.65s/trial, best loss: -0.5728]
|
| 599 |
42%|โโโโโ | 42/100 [24:25<39:33, 40.92s/trial, best loss: -0.5728]
|
| 600 |
43%|โโโโโ | 43/100 [25:12<40:33, 42.68s/trial, best loss: -0.5728]
|
| 601 |
44%|โโโโโ | 44/100 [25:44<36:53, 39.53s/trial, best loss: -0.5728]
|
| 602 |
45%|โโโโโ | 45/100 [26:27<37:07, 40.50s/trial, best loss: -0.5728]
|
| 603 |
46%|โโโโโ | 46/100 [26:55<33:11, 36.89s/trial, best loss: -0.5728]
|
| 604 |
47%|โโโโโ | 47/100 [27:29<31:48, 36.00s/trial, best loss: -0.5752]
|
| 605 |
48%|โโโโโ | 48/100 [28:12<32:56, 38.02s/trial, best loss: -0.5752]
|
| 606 |
49%|โโโโโ | 49/100 [29:03<35:42, 42.00s/trial, best loss: -0.5752]
|
| 607 |
50%|โโโโโ | 50/100 [29:44<34:41, 41.64s/trial, best loss: -0.5752]
|
| 608 |
51%|โโโโโ | 51/100 [30:31<35:24, 43.36s/trial, best loss: -0.5752]
|
| 609 |
52%|โโโโโโ | 52/100 [31:10<33:37, 42.03s/trial, best loss: -0.5752]
|
| 610 |
53%|โโโโโโ | 53/100 [32:15<38:25, 49.04s/trial, best loss: -0.5752]
|
| 611 |
54%|โโโโโโ | 54/100 [33:01<36:43, 47.91s/trial, best loss: -0.5752]
|
| 612 |
55%|โโโโโโ | 55/100 [33:49<36:06, 48.15s/trial, best loss: -0.5752]
|
| 613 |
56%|โโโโโโ | 56/100 [34:14<30:07, 41.07s/trial, best loss: -0.5752]
|
| 614 |
57%|โโโโโโ | 57/100 [35:00<30:34, 42.67s/trial, best loss: -0.5752]
|
| 615 |
58%|โโโโโโ | 58/100 [35:40<29:10, 41.68s/trial, best loss: -0.5752]
|
| 616 |
59%|โโโโโโ | 59/100 [36:03<24:48, 36.30s/trial, best loss: -0.5752]
|
| 617 |
60%|โโโโโโ | 60/100 [36:36<23:29, 35.23s/trial, best loss: -0.5752]
|
| 618 |
61%|โโโโโโ | 61/100 [37:05<21:41, 33.38s/trial, best loss: -0.5752]
|
| 619 |
62%|โโโโโโโ | 62/100 [37:54<24:06, 38.07s/trial, best loss: -0.5752]
|
| 620 |
63%|โโโโโโโ | 63/100 [38:44<25:39, 41.62s/trial, best loss: -0.5752]
|
| 621 |
64%|โโโโโโโ | 64/100 [39:31<25:51, 43.10s/trial, best loss: -0.5752]
|
| 622 |
65%|โโโโโโโ | 65/100 [40:19<26:01, 44.62s/trial, best loss: -0.5752]
|
| 623 |
66%|โโโโโโโ | 66/100 [40:58<24:23, 43.04s/trial, best loss: -0.5752]
|
| 624 |
67%|โโโโโโโ | 67/100 [41:51<25:12, 45.84s/trial, best loss: -0.5752]
|
| 625 |
68%|โโโโโโโ | 68/100 [42:34<24:06, 45.19s/trial, best loss: -0.5752]
|
| 626 |
69%|โโโโโโโ | 69/100 [43:11<22:05, 42.75s/trial, best loss: -0.5752]
|
| 627 |
70%|โโโโโโโ | 70/100 [43:52<20:59, 41.99s/trial, best loss: -0.5752]
|
| 628 |
71%|โโโโโโโ | 71/100 [44:35<20:27, 42.32s/trial, best loss: -0.5752]
|
| 629 |
72%|โโโโโโโโ | 72/100 [44:58<17:02, 36.50s/trial, best loss: -0.5752]
|
| 630 |
73%|โโโโโโโโ | 73/100 [45:17<14:03, 31.24s/trial, best loss: -0.5752]
|
| 631 |
74%|โโโโโโโโ | 74/100 [45:58<14:54, 34.42s/trial, best loss: -0.5752]
|
| 632 |
75%|โโโโโโโโ | 75/100 [46:29<13:49, 33.19s/trial, best loss: -0.5752]
|
| 633 |
76%|โโโโโโโโ | 76/100 [46:50<11:49, 29.56s/trial, best loss: -0.5752]
|
| 634 |
77%|โโโโโโโโ | 77/100 [47:37<13:24, 34.96s/trial, best loss: -0.5752]
|
| 635 |
78%|โโโโโโโโ | 78/100 [48:10<12:32, 34.23s/trial, best loss: -0.5752]
|
| 636 |
79%|โโโโโโโโ | 79/100 [48:29<10:21, 29.59s/trial, best loss: -0.5752]
|
| 637 |
80%|โโโโโโโโ | 80/100 [48:48<08:47, 26.39s/trial, best loss: -0.5752]
|
| 638 |
81%|โโโโโโโโ | 81/100 [49:21<09:03, 28.62s/trial, best loss: -0.5752]
|
| 639 |
82%|โโโโโโโโโ | 82/100 [50:05<09:58, 33.23s/trial, best loss: -0.5752]
|
| 640 |
83%|โโโโโโโโโ | 83/100 [50:31<08:45, 30.90s/trial, best loss: -0.5752]
|
| 641 |
84%|โโโโโโโโโ | 84/100 [51:08<08:44, 32.80s/trial, best loss: -0.5752]
|
| 642 |
85%|โโโโโโโโโ | 85/100 [51:39<08:03, 32.23s/trial, best loss: -0.5752]
|
| 643 |
86%|โโโโโโโโโ | 86/100 [52:06<07:07, 30.56s/trial, best loss: -0.5752]
|
| 644 |
87%|โโโโโโโโโ | 87/100 [52:34<06:26, 29.76s/trial, best loss: -0.5752]
|
| 645 |
88%|โโโโโโโโโ | 88/100 [54:13<10:08, 50.68s/trial, best loss: -0.5752]
|
| 646 |
89%|โโโโโโโโโ | 89/100 [54:46<08:17, 45.21s/trial, best loss: -0.5752]
|
| 647 |
90%|โโโโโโโโโ | 90/100 [55:12<06:34, 39.45s/trial, best loss: -0.5752]
|
| 648 |
91%|โโโโโโโโโ | 91/100 [55:50<05:53, 39.23s/trial, best loss: -0.5752]
|
| 649 |
92%|โโโโโโโโโโ| 92/100 [56:14<04:35, 34.50s/trial, best loss: -0.5752]
|
| 650 |
93%|โโโโโโโโโโ| 93/100 [56:38<03:40, 31.57s/trial, best loss: -0.5752]
|
| 651 |
94%|โโโโโโโโโโ| 94/100 [57:13<03:14, 32.49s/trial, best loss: -0.5752]
|
| 652 |
95%|โโโโโโโโโโ| 95/100 [57:49<02:47, 33.54s/trial, best loss: -0.5752]
|
| 653 |
96%|โโโโโโโโโโ| 96/100 [58:46<02:42, 40.69s/trial, best loss: -0.5752]
|
| 654 |
97%|โโโโโโโโโโ| 97/100 [59:20<01:55, 38.56s/trial, best loss: -0.5752]
|
| 655 |
98%|โโโโโโโโโโ| 98/100 [59:58<01:16, 38.38s/trial, best loss: -0.5752]
|
| 656 |
99%|โโโโโโโโโโ| 99/100 [1:00:25<00:35, 35.02s/trial, best loss: -0.5752]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 657 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 658 |
1%| | 1/100 [00:26<44:04, 26.71s/trial, best loss: -0.5553]
|
| 659 |
2%|โ | 2/100 [01:25<1:14:19, 45.50s/trial, best loss: -0.5578]
|
| 660 |
3%|โ | 3/100 [01:43<53:05, 32.84s/trial, best loss: -0.5642]
|
| 661 |
4%|โ | 4/100 [02:23<57:11, 35.74s/trial, best loss: -0.5722]
|
| 662 |
5%|โ | 5/100 [03:14<1:05:13, 41.19s/trial, best loss: -0.5722]
|
| 663 |
6%|โ | 6/100 [03:53<1:03:36, 40.60s/trial, best loss: -0.5722]
|
| 664 |
7%|โ | 7/100 [04:34<1:03:04, 40.69s/trial, best loss: -0.5722]
|
| 665 |
8%|โ | 8/100 [05:56<1:22:33, 53.85s/trial, best loss: -0.5722]
|
| 666 |
9%|โ | 9/100 [06:33<1:13:50, 48.69s/trial, best loss: -0.5722]
|
| 667 |
10%|โ | 10/100 [07:35<1:19:14, 52.83s/trial, best loss: -0.5722]
|
| 668 |
11%|โ | 11/100 [08:04<1:07:21, 45.41s/trial, best loss: -0.5722]
|
| 669 |
12%|โโ | 12/100 [08:37<1:01:12, 41.74s/trial, best loss: -0.5722]
|
| 670 |
13%|โโ | 13/100 [09:20<1:00:55, 42.02s/trial, best loss: -0.5722]
|
| 671 |
14%|โโ | 14/100 [09:48<53:56, 37.64s/trial, best loss: -0.5722]
|
| 672 |
15%|โโ | 15/100 [10:32<56:09, 39.64s/trial, best loss: -0.5722]
|
| 673 |
16%|โโ | 16/100 [10:50<46:20, 33.10s/trial, best loss: -0.5722]
|
| 674 |
17%|โโ | 17/100 [12:02<1:02:10, 44.95s/trial, best loss: -0.5722]
|
| 675 |
18%|โโ | 18/100 [12:32<55:19, 40.49s/trial, best loss: -0.5733]
|
| 676 |
19%|โโ | 19/100 [13:24<59:17, 43.91s/trial, best loss: -0.5733]
|
| 677 |
20%|โโ | 20/100 [13:59<54:50, 41.13s/trial, best loss: -0.5733]
|
| 678 |
21%|โโ | 21/100 [14:32<51:00, 38.74s/trial, best loss: -0.5746]
|
| 679 |
22%|โโโ | 22/100 [15:02<47:06, 36.24s/trial, best loss: -0.5746]
|
| 680 |
23%|โโโ | 23/100 [15:27<42:08, 32.83s/trial, best loss: -0.5746]
|
| 681 |
24%|โโโ | 24/100 [16:08<44:35, 35.20s/trial, best loss: -0.5755]
|
| 682 |
25%|โโโ | 25/100 [16:32<39:49, 31.86s/trial, best loss: -0.5755]
|
| 683 |
26%|โโโ | 26/100 [17:09<41:12, 33.42s/trial, best loss: -0.5755]
|
| 684 |
27%|โโโ | 27/100 [17:38<38:48, 31.90s/trial, best loss: -0.5755]
|
| 685 |
28%|โโโ | 28/100 [18:12<39:05, 32.58s/trial, best loss: -0.5755]
|
| 686 |
29%|โโโ | 29/100 [18:37<35:55, 30.36s/trial, best loss: -0.5755]
|
| 687 |
30%|โโโ | 30/100 [19:01<33:14, 28.50s/trial, best loss: -0.5755]
|
| 688 |
31%|โโโ | 31/100 [19:44<37:34, 32.68s/trial, best loss: -0.5755]
|
| 689 |
32%|โโโโ | 32/100 [20:22<39:02, 34.45s/trial, best loss: -0.5756]
|
| 690 |
33%|โโโโ | 33/100 [21:26<48:30, 43.44s/trial, best loss: -0.5756]
|
| 691 |
34%|โโโโ | 34/100 [22:10<47:57, 43.60s/trial, best loss: -0.5756]
|
| 692 |
35%|โโโโ | 35/100 [22:53<46:44, 43.14s/trial, best loss: -0.5765]
|
| 693 |
36%|โโโโ | 36/100 [23:22<41:39, 39.06s/trial, best loss: -0.5765]
|
| 694 |
37%|โโโโ | 37/100 [23:59<40:26, 38.52s/trial, best loss: -0.5765]
|
| 695 |
38%|โโโโ | 38/100 [24:33<38:21, 37.12s/trial, best loss: -0.5765]
|
| 696 |
39%|โโโโ | 39/100 [24:59<34:25, 33.87s/trial, best loss: -0.5765]
|
| 697 |
40%|โโโโ | 40/100 [25:43<36:46, 36.77s/trial, best loss: -0.5765]
|
| 698 |
41%|โโโโ | 41/100 [26:10<33:16, 33.83s/trial, best loss: -0.5765]
|
| 699 |
42%|โโโโโ | 42/100 [26:48<33:59, 35.16s/trial, best loss: -0.5795]
|
| 700 |
43%|โโโโโ | 43/100 [27:34<36:30, 38.44s/trial, best loss: -0.5795]
|
| 701 |
44%|โโโโโ | 44/100 [28:07<34:18, 36.75s/trial, best loss: -0.5795]
|
| 702 |
45%|โโโโโ | 45/100 [29:03<38:56, 42.49s/trial, best loss: -0.5795]
|
| 703 |
46%|โโโโโ | 46/100 [30:11<45:07, 50.14s/trial, best loss: -0.5795]
|
| 704 |
47%|โโโโโ | 47/100 [30:41<38:58, 44.12s/trial, best loss: -0.5795]
|
| 705 |
48%|โโโโโ | 48/100 [31:09<34:00, 39.25s/trial, best loss: -0.5795]
|
| 706 |
49%|โโโโโ | 49/100 [31:36<30:15, 35.60s/trial, best loss: -0.5795]
|
| 707 |
50%|โโโโโ | 50/100 [32:00<26:38, 31.96s/trial, best loss: -0.5795]
|
| 708 |
51%|โโโโโ | 51/100 [32:38<27:48, 34.04s/trial, best loss: -0.5795]
|
| 709 |
52%|โโโโโโ | 52/100 [33:11<26:53, 33.62s/trial, best loss: -0.5795]
|
| 710 |
53%|โโโโโโ | 53/100 [34:06<31:27, 40.15s/trial, best loss: -0.5795]
|
| 711 |
54%|โโโโโโ | 54/100 [34:35<28:05, 36.63s/trial, best loss: -0.5795]
|
| 712 |
55%|โโโโโโ | 55/100 [35:03<25:27, 33.96s/trial, best loss: -0.5795]
|
| 713 |
56%|โโโโโโ | 56/100 [35:32<23:48, 32.47s/trial, best loss: -0.5795]
|
| 714 |
57%|โโโโโโ | 57/100 [36:16<25:55, 36.18s/trial, best loss: -0.5795]
|
| 715 |
58%|โโโโโโ | 58/100 [36:39<22:28, 32.12s/trial, best loss: -0.5795]
|
| 716 |
59%|โโโโโโ | 59/100 [37:05<20:46, 30.41s/trial, best loss: -0.5795]
|
| 717 |
60%|โโโโโ๏ฟฝ๏ฟฝ | 60/100 [37:46<22:14, 33.37s/trial, best loss: -0.5795]
|
| 718 |
61%|โโโโโโ | 61/100 [38:24<22:40, 34.89s/trial, best loss: -0.5795]
|
| 719 |
62%|โโโโโโโ | 62/100 [39:05<23:12, 36.64s/trial, best loss: -0.5795]
|
| 720 |
63%|โโโโโโโ | 63/100 [39:57<25:27, 41.29s/trial, best loss: -0.5795]
|
| 721 |
64%|โโโโโโโ | 64/100 [40:19<21:21, 35.59s/trial, best loss: -0.5795]
|
| 722 |
65%|โโโโโโโ | 65/100 [40:52<20:16, 34.76s/trial, best loss: -0.5795]
|
| 723 |
66%|โโโโโโโ | 66/100 [41:14<17:26, 30.79s/trial, best loss: -0.5795]
|
| 724 |
67%|โโโโโโโ | 67/100 [41:44<16:53, 30.70s/trial, best loss: -0.5795]
|
| 725 |
68%|โโโโโโโ | 68/100 [42:07<15:10, 28.45s/trial, best loss: -0.5795]
|
| 726 |
69%|โโโโโโโ | 69/100 [42:27<13:23, 25.92s/trial, best loss: -0.5795]
|
| 727 |
70%|โโโโโโโ | 70/100 [42:55<13:15, 26.52s/trial, best loss: -0.5797]
|
| 728 |
71%|โโโโโโโ | 71/100 [43:20<12:29, 25.85s/trial, best loss: -0.5824]
|
| 729 |
72%|โโโโโโโโ | 72/100 [43:50<12:40, 27.17s/trial, best loss: -0.5824]
|
| 730 |
73%|โโโโโโโโ | 73/100 [44:17<12:11, 27.08s/trial, best loss: -0.5824]
|
| 731 |
74%|โโโโโโโโ | 74/100 [44:38<10:59, 25.37s/trial, best loss: -0.5824]
|
| 732 |
75%|โโโโโโโโ | 75/100 [45:08<11:10, 26.80s/trial, best loss: -0.5824]
|
| 733 |
76%|โโโโโโโโ | 76/100 [45:54<12:56, 32.36s/trial, best loss: -0.5824]
|
| 734 |
77%|โโโโโโโโ | 77/100 [46:12<10:48, 28.20s/trial, best loss: -0.5824]
|
| 735 |
78%|โโโโโโโโ | 78/100 [46:36<09:51, 26.88s/trial, best loss: -0.5824]
|
| 736 |
79%|โโโโโโโโ | 79/100 [46:59<08:58, 25.63s/trial, best loss: -0.5824]
|
| 737 |
80%|โโโโโโโโ | 80/100 [47:29<09:04, 27.20s/trial, best loss: -0.5824]
|
| 738 |
81%|โโโโโโโโ | 81/100 [47:55<08:26, 26.67s/trial, best loss: -0.5824]
|
| 739 |
82%|โโโโโโโโโ | 82/100 [48:35<09:13, 30.73s/trial, best loss: -0.5824]
|
| 740 |
83%|โโโโโโโโโ | 83/100 [48:59<08:06, 28.60s/trial, best loss: -0.5824]
|
| 741 |
84%|โโโโโโโโโ | 84/100 [49:26<07:29, 28.09s/trial, best loss: -0.5824]
|
| 742 |
85%|โโโโโโโโโ | 85/100 [49:47<06:30, 26.06s/trial, best loss: -0.5824]
|
| 743 |
86%|โโโโโโโโโ | 86/100 [50:44<08:15, 35.36s/trial, best loss: -0.5824]
|
| 744 |
87%|โโโโโโโโโ | 87/100 [51:23<07:53, 36.46s/trial, best loss: -0.5824]
|
| 745 |
88%|โโโโโโโโโ | 88/100 [51:46<06:28, 32.41s/trial, best loss: -0.5824]
|
| 746 |
89%|โโโโโโโโโ | 89/100 [52:11<05:32, 30.19s/trial, best loss: -0.5824]
|
| 747 |
90%|โโโโโโโโโ | 90/100 [52:32<04:34, 27.47s/trial, best loss: -0.5824]
|
| 748 |
91%|โโโโโโโโโ | 91/100 [52:57<04:00, 26.68s/trial, best loss: -0.5824]
|
| 749 |
92%|โโโโโโโโโโ| 92/100 [53:34<03:57, 29.64s/trial, best loss: -0.5824]
|
| 750 |
93%|โโโโโโโโโโ| 93/100 [54:12<03:45, 32.28s/trial, best loss: -0.5824]
|
| 751 |
94%|โโโโโโโโโโ| 94/100 [54:43<03:11, 31.88s/trial, best loss: -0.5824]
|
| 752 |
95%|โโโโโโโโโโ| 95/100 [55:31<03:04, 36.86s/trial, best loss: -0.5824]
|
| 753 |
96%|โโโโโโโโโโ| 96/100 [55:57<02:14, 33.56s/trial, best loss: -0.5824]
|
| 754 |
97%|โโโโโโโโโโ| 97/100 [56:19<01:29, 29.99s/trial, best loss: -0.5824]
|
| 755 |
98%|โโโโโโโโโโ| 98/100 [56:47<00:59, 29.54s/trial, best loss: -0.5824]
|
| 756 |
99%|โโโโโโโโโโ| 99/100 [57:09<00:27, 27.11s/trial, best loss: -0.5824]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
nohup: ignoring input
|
| 2 |
+
/bin/bash: /opt/conda/lib/libtinfo.so.6: no version information available (required by /bin/bash)
|
| 3 |
+
==========================================
|
| 4 |
+
XGB CTGAN10000 ํ์ผ ์คํ ์์
|
| 5 |
+
์์ ์๊ฐ: 2025-12-28 04:31:17
|
| 6 |
+
GPU: 0๋ฒ (CUDA_VISIBLE_DEVICES=0)
|
| 7 |
+
==========================================
|
| 8 |
+
|
| 9 |
+
----------------------------------------
|
| 10 |
+
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_busan.py
|
| 11 |
+
์์ ์๊ฐ: 2025-12-28 04:31:17
|
| 12 |
+
----------------------------------------
|
| 13 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 14 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 15 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 16 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 18 |
1%| | 1/100 [01:00<1:39:06, 60.06s/trial, best loss: -0.4522]
|
| 19 |
2%|โ | 2/100 [01:27<1:06:28, 40.70s/trial, best loss: -0.4709]
|
| 20 |
3%|โ | 3/100 [02:00<1:00:22, 37.35s/trial, best loss: -0.4806]
|
| 21 |
4%|โ | 4/100 [02:36<58:57, 36.85s/trial, best loss: -0.4806]
|
| 22 |
5%|โ | 5/100 [02:59<50:07, 31.66s/trial, best loss: -0.4822]
|
| 23 |
6%|โ | 6/100 [03:46<57:59, 37.02s/trial, best loss: -0.4822]
|
| 24 |
7%|โ | 7/100 [04:12<51:49, 33.43s/trial, best loss: -0.4822]
|
| 25 |
8%|โ | 8/100 [04:40<48:45, 31.80s/trial, best loss: -0.4822]
|
| 26 |
9%|โ | 9/100 [05:37<1:00:09, 39.66s/trial, best loss: -0.4822]
|
| 27 |
10%|โ | 10/100 [06:13<57:38, 38.43s/trial, best loss: -0.4822]
|
| 28 |
11%|โ | 11/100 [06:34<49:07, 33.12s/trial, best loss: -0.4822]
|
| 29 |
12%|โโ | 12/100 [07:20<54:22, 37.07s/trial, best loss: -0.4822]
|
| 30 |
13%|โโ | 13/100 [08:01<55:35, 38.34s/trial, best loss: -0.4822]
|
| 31 |
14%|โโ | 14/100 [08:34<52:25, 36.57s/trial, best loss: -0.4822]
|
| 32 |
15%|โโ | 15/100 [09:03<48:30, 34.24s/trial, best loss: -0.4822]
|
| 33 |
16%|โโ | 16/100 [09:29<44:45, 31.97s/trial, best loss: -0.4822]
|
| 34 |
17%|โโ | 17/100 [10:29<55:53, 40.40s/trial, best loss: -0.4822]
|
| 35 |
18%|โโ | 18/100 [10:46<45:13, 33.10s/trial, best loss: -0.4822]
|
| 36 |
19%|โโ | 19/100 [11:11<41:26, 30.70s/trial, best loss: -0.4822]
|
| 37 |
20%|โโ | 20/100 [11:37<39:10, 29.38s/trial, best loss: -0.4822]
|
| 38 |
21%|โโ | 21/100 [12:17<42:42, 32.43s/trial, best loss: -0.4822]
|
| 39 |
22%|โโโ | 22/100 [13:23<55:18, 42.55s/trial, best loss: -0.4822]
|
| 40 |
23%|โโโ | 23/100 [13:58<51:48, 40.37s/trial, best loss: -0.4822]
|
| 41 |
24%|โโโ | 24/100 [14:29<47:44, 37.69s/trial, best loss: -0.4822]
|
| 42 |
25%|โโโ | 25/100 [16:19<1:14:11, 59.35s/trial, best loss: -0.4822]
|
| 43 |
26%|โโโ | 26/100 [16:57<1:05:04, 52.76s/trial, best loss: -0.4822]
|
| 44 |
27%|โโโ | 27/100 [17:39<1:00:28, 49.70s/trial, best loss: -0.4822]
|
| 45 |
28%|โโโ | 28/100 [18:11<53:04, 44.23s/trial, best loss: -0.4822]
|
| 46 |
29%|โโโ | 29/100 [18:34<44:58, 38.01s/trial, best loss: -0.4822]
|
| 47 |
30%|โโโ | 30/100 [19:28<49:57, 42.82s/trial, best loss: -0.4822]
|
| 48 |
31%|โโโ | 31/100 [20:07<47:46, 41.54s/trial, best loss: -0.4822]
|
| 49 |
32%|โโโโ | 32/100 [20:43<45:24, 40.07s/trial, best loss: -0.4822]
|
| 50 |
33%|โโโโ | 33/100 [21:19<43:07, 38.62s/trial, best loss: -0.4822]
|
| 51 |
34%|โโโโ | 34/100 [21:48<39:24, 35.83s/trial, best loss: -0.4822]
|
| 52 |
35%|โโโโ | 35/100 [22:31<41:08, 37.98s/trial, best loss: -0.4822]
|
| 53 |
36%|โโโโ | 36/100 [23:04<39:03, 36.62s/trial, best loss: -0.4822]
|
| 54 |
37%|โโโโ | 37/100 [23:23<32:46, 31.22s/trial, best loss: -0.4822]
|
| 55 |
38%|โโโโ | 38/100 [24:18<39:43, 38.44s/trial, best loss: -0.4822]
|
| 56 |
39%|โโโโ | 39/100 [24:56<38:44, 38.10s/trial, best loss: -0.4822]
|
| 57 |
40%|โโโโ | 40/100 [25:22<34:34, 34.57s/trial, best loss: -0.4822]
|
| 58 |
41%|โโโโ | 41/100 [26:22<41:38, 42.35s/trial, best loss: -0.4822]
|
| 59 |
42%|โโโโโ | 42/100 [26:55<38:01, 39.34s/trial, best loss: -0.4822]
|
| 60 |
43%|โโโโโ | 43/100 [27:18<32:39, 34.38s/trial, best loss: -0.4822]
|
| 61 |
44%|โโโโโ | 44/100 [27:47<30:33, 32.74s/trial, best loss: -0.4822]
|
| 62 |
45%|โโโโโ | 45/100 [28:19<29:49, 32.54s/trial, best loss: -0.4822]
|
| 63 |
46%|โโโโโ | 46/100 [28:45<27:34, 30.64s/trial, best loss: -0.4822]
|
| 64 |
47%|โโโโโ | 47/100 [29:14<26:38, 30.15s/trial, best loss: -0.4822]
|
| 65 |
48%|โโโโโ | 48/100 [29:46<26:33, 30.65s/trial, best loss: -0.4822]
|
| 66 |
49%|โโโโโ | 49/100 [30:25<28:21, 33.36s/trial, best loss: -0.4822]
|
| 67 |
50%|โโโโโ | 50/100 [31:31<35:53, 43.06s/trial, best loss: -0.4822]
|
| 68 |
51%|โโโโโ | 51/100 [31:58<31:21, 38.40s/trial, best loss: -0.4822]
|
| 69 |
52%|โโโโโโ | 52/100 [32:28<28:27, 35.58s/trial, best loss: -0.4822]
|
| 70 |
53%|โโโโโโ | 53/100 [33:11<29:43, 37.96s/trial, best loss: -0.4822]
|
| 71 |
54%|โโโโโโ | 54/100 [33:55<30:23, 39.63s/trial, best loss: -0.4822]
|
| 72 |
55%|โโโโโโ | 55/100 [34:24<27:21, 36.48s/trial, best loss: -0.4822]
|
| 73 |
56%|โโโโโโ | 56/100 [34:51<24:49, 33.84s/trial, best loss: -0.4822]
|
| 74 |
57%|โโโโโโ | 57/100 [35:28<24:50, 34.66s/trial, best loss: -0.4822]
|
| 75 |
58%|โโโโโโ | 58/100 [36:06<25:02, 35.78s/trial, best loss: -0.4822]
|
| 76 |
59%|โโโโโโ | 59/100 [36:42<24:24, 35.72s/trial, best loss: -0.4822]
|
| 77 |
60%|โโโโโโ | 60/100 [37:06<21:31, 32.29s/trial, best loss: -0.4822]
|
| 78 |
61%|โโโโโโ | 61/100 [37:32<19:40, 30.28s/trial, best loss: -0.4822]
|
| 79 |
62%|โโโโโโโ | 62/100 [38:46<27:34, 43.54s/trial, best loss: -0.4822]
|
| 80 |
63%|โโโโโโโ | 63/100 [39:13<23:43, 38.47s/trial, best loss: -0.4822]
|
| 81 |
64%|โโโโโโโ | 64/100 [39:56<23:52, 39.79s/trial, best loss: -0.4822]
|
| 82 |
65%|โโโโโโโ | 65/100 [40:47<25:10, 43.16s/trial, best loss: -0.4822]
|
| 83 |
66%|โโโโโโโ | 66/100 [41:09<20:56, 36.97s/trial, best loss: -0.4822]
|
| 84 |
67%|โโโโโโโ | 67/100 [41:44<19:56, 36.27s/trial, best loss: -0.4822]
|
| 85 |
68%|โโโโโโโ | 68/100 [42:13<18:06, 33.96s/trial, best loss: -0.4822]
|
| 86 |
69%|โโโโโโโ | 69/100 [42:38<16:17, 31.53s/trial, best loss: -0.4822]
|
| 87 |
70%|โโโโโโโ | 70/100 [43:17<16:46, 33.55s/trial, best loss: -0.4822]
|
| 88 |
71%|โโโโโโโ | 71/100 [44:05<18:23, 38.06s/trial, best loss: -0.4822]
|
| 89 |
72%|โโโโโโโโ | 72/100 [44:36<16:42, 35.80s/trial, best loss: -0.4822]
|
| 90 |
73%|โโโโโโโโ | 73/100 [44:57<14:11, 31.55s/trial, best loss: -0.4822]
|
| 91 |
74%|โโโโโโโโ | 74/100 [45:29<13:43, 31.66s/trial, best loss: -0.4822]
|
| 92 |
75%|โโโโโโโโ | 75/100 [45:50<11:52, 28.50s/trial, best loss: -0.4822]
|
| 93 |
76%|โโโโโโโโ | 76/100 [46:19<11:22, 28.43s/trial, best loss: -0.4822]
|
| 94 |
77%|โโโโโโโโ | 77/100 [46:44<10:32, 27.51s/trial, best loss: -0.4822]
|
| 95 |
78%|โโโโโโโโ | 78/100 [47:10<09:56, 27.11s/trial, best loss: -0.4822]
|
| 96 |
79%|โโโโโโโโ | 79/100 [47:56<11:27, 32.75s/trial, best loss: -0.4822]
|
| 97 |
80%|โโโโโโโโ | 80/100 [48:24<10:24, 31.23s/trial, best loss: -0.4822]
|
| 98 |
81%|โโโโโโโโ | 81/100 [48:43<08:45, 27.68s/trial, best loss: -0.4822]
|
| 99 |
82%|โโโโโโโโโ | 82/100 [49:12<08:25, 28.09s/trial, best loss: -0.4822]
|
| 100 |
83%|โโโโโโโโโ | 83/100 [49:39<07:49, 27.62s/trial, best loss: -0.4822]
|
| 101 |
84%|โโโโโโโโโ | 84/100 [50:07<07:24, 27.78s/trial, best loss: -0.4822]
|
| 102 |
85%|โโโโโโโโโ | 85/100 [50:55<08:25, 33.72s/trial, best loss: -0.4822]
|
| 103 |
86%|โโโโโโโโโ | 86/100 [51:11<06:38, 28.47s/trial, best loss: -0.4845]
|
| 104 |
87%|โโโโโโโโโ | 87/100 [51:30<05:33, 25.68s/trial, best loss: -0.4845]
|
| 105 |
88%|โโโโโโโโโ | 88/100 [52:03<05:34, 27.85s/trial, best loss: -0.4845]
|
| 106 |
89%|โโโโโโโโโ | 89/100 [52:36<05:23, 29.37s/trial, best loss: -0.4845]
|
| 107 |
90%|โโโโโโโโโ | 90/100 [53:00<04:38, 27.88s/trial, best loss: -0.4845]
|
| 108 |
91%|โโโโโโโโโ | 91/100 [53:23<03:56, 26.31s/trial, best loss: -0.4845]
|
| 109 |
92%|โโโโโโโโโโ| 92/100 [54:16<04:34, 34.36s/trial, best loss: -0.4845]
|
| 110 |
93%|โโโโโโโโโโ| 93/100 [54:44<03:47, 32.57s/trial, best loss: -0.4845]
|
| 111 |
94%|โโโโโโโโโโ| 94/100 [55:04<02:52, 28.71s/trial, best loss: -0.4845]
|
| 112 |
95%|โโโโโโโโโโ| 95/100 [55:47<02:45, 33.04s/trial, best loss: -0.4845]
|
| 113 |
96%|โโโโโโโโโโ| 96/100 [56:11<02:01, 30.30s/trial, best loss: -0.4845]
|
| 114 |
97%|โโโโโโโโโโ| 97/100 [56:42<01:31, 30.51s/trial, best loss: -0.4845]
|
| 115 |
98%|โโโโโโโโโโ| 98/100 [57:01<00:53, 26.91s/trial, best loss: -0.4845]
|
| 116 |
99%|โโโโโโโโโโ| 99/100 [57:30<00:27, 27.60s/trial, best loss: -0.4881]
|
| 117 |
+
|
| 118 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.6875780545091519, 'gamma': 2.658982028747467, 'learning_rate': 0.11595019019771602, 'max_depth': 12.0, 'min_child_weight': 18.0, 'reg_alpha': 0.9071038284958559, 'reg_lambda': 0.2880553949579837, 'subsample': 0.7100915343806586}
|
| 119 |
+
์ต์ CSI ์ ์: 0.4881 (loss: -0.4881)
|
| 120 |
+
|
| 121 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 122 |
+
- ์ด ์๋ ํ์: 100
|
| 123 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 124 |
+
- ์ต์ด CSI: 0.4522
|
| 125 |
+
- ์ต์ข
CSI: 0.4780
|
| 126 |
+
- ์ต๊ณ CSI: 0.4881
|
| 127 |
+
- ์ต์ CSI: 0.4459
|
| 128 |
+
- ํ๊ท CSI: 0.4737
|
| 129 |
+
|
| 130 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/xgb_ctgan10000_busan_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 131 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 132 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 133 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4329
|
| 134 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 135 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.5007
|
| 136 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 137 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5306
|
| 138 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 139 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/xgb_optima/xgb_ctgan10000_busan.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 140 |
+
|
| 141 |
+
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_busan.py (์์ ์๊ฐ: 3501์ด)
|
| 142 |
+
|
| 143 |
+
----------------------------------------
|
| 144 |
+
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_daegu.py
|
| 145 |
+
์์ ์๊ฐ: 2025-12-28 05:29:38
|
| 146 |
+
----------------------------------------
|
| 147 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 148 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 149 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 150 |
+
|
| 151 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 152 |
1%| | 1/100 [00:44<1:13:09, 44.34s/trial, best loss: -0.4037]
|
| 153 |
2%|โ | 2/100 [01:13<58:05, 35.57s/trial, best loss: -0.4037]
|
| 154 |
3%|โ | 3/100 [01:31<44:34, 27.57s/trial, best loss: -0.4037]
|
| 155 |
4%|โ | 4/100 [02:03<46:37, 29.14s/trial, best loss: -0.427]
|
| 156 |
5%|โ | 5/100 [02:28<43:56, 27.75s/trial, best loss: -0.427]
|
| 157 |
6%|โ | 6/100 [03:09<50:15, 32.08s/trial, best loss: -0.427]
|
| 158 |
7%|โ | 7/100 [03:47<52:46, 34.05s/trial, best loss: -0.427]
|
| 159 |
8%|โ | 8/100 [04:35<59:09, 38.58s/trial, best loss: -0.427]
|
| 160 |
9%|โ | 9/100 [05:06<55:05, 36.32s/trial, best loss: -0.427]
|
| 161 |
10%|โ | 10/100 [05:26<46:43, 31.15s/trial, best loss: -0.427]
|
| 162 |
11%|โ | 11/100 [05:59<47:10, 31.80s/trial, best loss: -0.427]
|
| 163 |
12%|โโ | 12/100 [06:38<49:41, 33.88s/trial, best loss: -0.427]
|
| 164 |
13%|โโ | 13/100 [07:14<49:58, 34.47s/trial, best loss: -0.427]
|
| 165 |
14%|โโ | 14/100 [07:46<48:22, 33.75s/trial, best loss: -0.427]
|
| 166 |
15%|โโ | 15/100 [08:53<1:02:15, 43.95s/trial, best loss: -0.427]
|
| 167 |
16%|โโ | 16/100 [09:27<57:04, 40.77s/trial, best loss: -0.427]
|
| 168 |
17%|โโ | 17/100 [09:54<50:35, 36.57s/trial, best loss: -0.427]
|
| 169 |
18%|โโ | 18/100 [10:31<50:22, 36.86s/trial, best loss: -0.427]
|
| 170 |
19%|โโ | 19/100 [11:01<46:58, 34.80s/trial, best loss: -0.427]
|
| 171 |
20%|โโ | 20/100 [11:33<45:04, 33.81s/trial, best loss: -0.4356]
|
| 172 |
21%|โโ | 21/100 [11:58<41:05, 31.21s/trial, best loss: -0.4356]
|
| 173 |
22%|โโโ | 22/100 [12:28<40:14, 30.96s/trial, best loss: -0.4356]
|
| 174 |
23%|โโโ | 23/100 [12:59<39:36, 30.86s/trial, best loss: -0.4356]
|
| 175 |
24%|โโโ | 24/100 [13:22<36:20, 28.69s/trial, best loss: -0.4356]
|
| 176 |
25%|โโโ | 25/100 [13:43<32:45, 26.20s/trial, best loss: -0.4356]
|
| 177 |
26%|โโโ | 26/100 [14:31<40:32, 32.87s/trial, best loss: -0.4356]
|
| 178 |
27%|โโโ | 27/100 [15:03<39:37, 32.57s/trial, best loss: -0.4356]
|
| 179 |
28%|โโโ | 28/100 [15:44<42:03, 35.05s/trial, best loss: -0.4356]
|
| 180 |
29%|โโโ | 29/100 [16:06<36:44, 31.04s/trial, best loss: -0.4356]
|
| 181 |
30%|โโโ | 30/100 [16:31<34:04, 29.21s/trial, best loss: -0.4356]
|
| 182 |
31%|โโโ | 31/100 [17:21<40:48, 35.48s/trial, best loss: -0.4356]
|
| 183 |
32%|โโโโ | 32/100 [17:53<38:59, 34.40s/trial, best loss: -0.4356]
|
| 184 |
33%|โโโโ | 33/100 [18:25<37:36, 33.68s/trial, best loss: -0.4356]
|
| 185 |
34%|โโโโ | 34/100 [19:02<38:21, 34.87s/trial, best loss: -0.4356]
|
| 186 |
35%|โโโโ | 35/100 [19:46<40:41, 37.56s/trial, best loss: -0.4356]
|
| 187 |
36%|โโโโ | 36/100 [20:19<38:39, 36.24s/trial, best loss: -0.4356]
|
| 188 |
37%|โโโโ | 37/100 [20:58<38:45, 36.92s/trial, best loss: -0.4356]
|
| 189 |
38%|โโโโ | 38/100 [21:35<38:17, 37.06s/trial, best loss: -0.4356]
|
| 190 |
39%|โโโโ | 39/100 [22:13<37:55, 37.30s/trial, best loss: -0.4356]
|
| 191 |
40%|โโโโ | 40/100 [22:50<37:13, 37.22s/trial, best loss: -0.4356]
|
| 192 |
41%|โโโโ | 41/100 [23:24<35:32, 36.15s/trial, best loss: -0.4356]
|
| 193 |
42%|โโโโโ | 42/100 [24:04<36:02, 37.29s/trial, best loss: -0.4356]
|
| 194 |
43%|โโโโโ | 43/100 [24:49<37:45, 39.75s/trial, best loss: -0.4356]
|
| 195 |
44%|โโโโโ | 44/100 [25:16<33:24, 35.80s/trial, best loss: -0.4356]
|
| 196 |
45%|โโโโโ | 45/100 [26:10<37:56, 41.39s/trial, best loss: -0.4356]
|
| 197 |
46%|โโโโโ | 46/100 [26:50<36:48, 40.90s/trial, best loss: -0.4356]
|
| 198 |
47%|โโโโโ | 47/100 [27:14<31:46, 35.97s/trial, best loss: -0.4356]
|
| 199 |
48%|โโโ๏ฟฝ๏ฟฝ๏ฟฝโ | 48/100 [27:47<30:19, 35.00s/trial, best loss: -0.4356]
|
| 200 |
49%|โโโโโ | 49/100 [28:32<32:12, 37.89s/trial, best loss: -0.4356]
|
| 201 |
50%|โโโโโ | 50/100 [29:28<36:14, 43.50s/trial, best loss: -0.4356]
|
| 202 |
51%|โโโโโ | 51/100 [30:21<37:40, 46.14s/trial, best loss: -0.4356]
|
| 203 |
52%|โโโโโโ | 52/100 [31:09<37:22, 46.71s/trial, best loss: -0.4356]
|
| 204 |
53%|โโโโโโ | 53/100 [32:18<41:53, 53.48s/trial, best loss: -0.4356]
|
| 205 |
54%|โโโโโโ | 54/100 [32:59<38:09, 49.77s/trial, best loss: -0.4356]
|
| 206 |
55%|โโโโโโ | 55/100 [33:27<32:22, 43.16s/trial, best loss: -0.4356]
|
| 207 |
56%|โโโโโโ | 56/100 [33:57<28:47, 39.26s/trial, best loss: -0.4356]
|
| 208 |
57%|โโโโโโ | 57/100 [34:23<25:14, 35.22s/trial, best loss: -0.4356]
|
| 209 |
58%|โโโโโโ | 58/100 [34:48<22:39, 32.38s/trial, best loss: -0.4356]
|
| 210 |
59%|โโโโโโ | 59/100 [35:24<22:48, 33.38s/trial, best loss: -0.4356]
|
| 211 |
60%|โโโโโโ | 60/100 [36:06<23:54, 35.87s/trial, best loss: -0.4356]
|
| 212 |
61%|โโโโโโ | 61/100 [36:30<20:57, 32.23s/trial, best loss: -0.4356]
|
| 213 |
62%|โโโโโโโ | 62/100 [37:49<29:19, 46.31s/trial, best loss: -0.4356]
|
| 214 |
63%|โโโโโโโ | 63/100 [38:30<27:42, 44.93s/trial, best loss: -0.4356]
|
| 215 |
64%|โโโโโโโ | 64/100 [39:13<26:27, 44.09s/trial, best loss: -0.4356]
|
| 216 |
65%|โโโโโโโ | 65/100 [40:08<27:38, 47.39s/trial, best loss: -0.4356]
|
| 217 |
66%|โโโโโโโ | 66/100 [40:29<22:22, 39.48s/trial, best loss: -0.4356]
|
| 218 |
67%|โโโโโโโ | 67/100 [40:47<18:14, 33.17s/trial, best loss: -0.4356]
|
| 219 |
68%|โโโโโโโ | 68/100 [41:12<16:25, 30.80s/trial, best loss: -0.4356]
|
| 220 |
69%|โโโโโโโ | 69/100 [41:34<14:30, 28.09s/trial, best loss: -0.4356]
|
| 221 |
70%|โโโโโโโ | 70/100 [41:55<12:53, 25.80s/trial, best loss: -0.4356]
|
| 222 |
71%|โโโโโโโ | 71/100 [42:33<14:15, 29.51s/trial, best loss: -0.4356]
|
| 223 |
72%|โโโโโโโโ | 72/100 [43:08<14:35, 31.26s/trial, best loss: -0.4356]
|
| 224 |
73%|โโโโโโโโ | 73/100 [43:38<13:51, 30.79s/trial, best loss: -0.4356]
|
| 225 |
74%|โโโโโโโโ | 74/100 [44:06<12:57, 29.92s/trial, best loss: -0.4356]
|
| 226 |
75%|โโโโโโโโ | 75/100 [44:40<13:04, 31.37s/trial, best loss: -0.4356]
|
| 227 |
76%|โโโโโโโโ | 76/100 [45:08<12:05, 30.22s/trial, best loss: -0.4356]
|
| 228 |
77%|โโโโโโโโ | 77/100 [45:38<11:33, 30.17s/trial, best loss: -0.4392]
|
| 229 |
78%|โโโโโโโโ | 78/100 [46:12<11:27, 31.26s/trial, best loss: -0.4392]
|
| 230 |
79%|โโโโโโโโ | 79/100 [46:52<11:55, 34.05s/trial, best loss: -0.4392]
|
| 231 |
80%|โโโโโโโโ | 80/100 [47:46<13:18, 39.93s/trial, best loss: -0.4392]
|
| 232 |
81%|โโโโโโโโ | 81/100 [48:28<12:49, 40.49s/trial, best loss: -0.4392]
|
| 233 |
82%|โโโโโโโโโ | 82/100 [49:20<13:11, 43.98s/trial, best loss: -0.4392]
|
| 234 |
83%|โโโโโโโโโ | 83/100 [49:44<10:44, 37.90s/trial, best loss: -0.4392]
|
| 235 |
84%|โโโโโโโโโ | 84/100 [50:14<09:32, 35.78s/trial, best loss: -0.4392]
|
| 236 |
85%|โโโโโโโโโ | 85/100 [50:59<09:38, 38.55s/trial, best loss: -0.4392]
|
| 237 |
86%|โโโโโโโโโ | 86/100 [51:33<08:39, 37.09s/trial, best loss: -0.4392]
|
| 238 |
87%|โโโโโโโโโ | 87/100 [51:53<06:53, 31.80s/trial, best loss: -0.4392]
|
| 239 |
88%|โโโโโโโโโ | 88/100 [52:14<05:45, 28.78s/trial, best loss: -0.4392]
|
| 240 |
89%|โโโโโโโโโ | 89/100 [52:47<05:28, 29.87s/trial, best loss: -0.4392]
|
| 241 |
90%|โโโโโโโโโ | 90/100 [53:16<04:56, 29.61s/trial, best loss: -0.4392]
|
| 242 |
91%|โโโโโโโโโ | 91/100 [53:43<04:21, 29.03s/trial, best loss: -0.4392]
|
| 243 |
92%|โโโโโโโโโโ| 92/100 [54:14<03:54, 29.37s/trial, best loss: -0.4392]
|
| 244 |
93%|โโโโโโโโโโ| 93/100 [54:35<03:08, 26.99s/trial, best loss: -0.4392]
|
| 245 |
94%|โโโโโโโโโโ| 94/100 [54:59<02:36, 26.00s/trial, best loss: -0.4392]
|
| 246 |
95%|โโโโโโโโโโ| 95/100 [55:37<02:28, 29.75s/trial, best loss: -0.4392]
|
| 247 |
96%|โโโโโโโโโโ| 96/100 [55:55<01:45, 26.28s/trial, best loss: -0.4392]
|
| 248 |
97%|โโโโโโโโโโ| 97/100 [56:31<01:27, 29.00s/trial, best loss: -0.4392]
|
| 249 |
98%|โโโโโโโโโโ| 98/100 [56:54<00:54, 27.17s/trial, best loss: -0.4392]
|
| 250 |
99%|โโโโโโโโโโ| 99/100 [57:34<00:31, 31.01s/trial, best loss: -0.4392]
|
| 251 |
+
|
| 252 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.8557253370653987, 'gamma': 1.1563957561197729, 'learning_rate': 0.19232018363683898, 'max_depth': 10.0, 'min_child_weight': 8.0, 'reg_alpha': 0.21149066093980878, 'reg_lambda': 0.2690618200166374, 'subsample': 0.714526167464626}
|
| 253 |
+
์ต์ CSI ์ ์: 0.4392 (loss: -0.4392)
|
| 254 |
+
|
| 255 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 256 |
+
- ์ด ์๋ ํ์: 100
|
| 257 |
+
- ์ฑ๊ณต๏ฟฝ๏ฟฝ๏ฟฝ ์๋: 100
|
| 258 |
+
- ์ต์ด CSI: 0.4037
|
| 259 |
+
- ์ต์ข
CSI: 0.4027
|
| 260 |
+
- ์ต๊ณ CSI: 0.4392
|
| 261 |
+
- ์ต์ CSI: 0.3123
|
| 262 |
+
- ํ๊ท CSI: 0.4163
|
| 263 |
+
|
| 264 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/xgb_ctgan10000_daegu_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 265 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 266 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 267 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4690
|
| 268 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 269 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.4544
|
| 270 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 271 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.3943
|
| 272 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 273 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/xgb_optima/xgb_ctgan10000_daegu.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 274 |
+
|
| 275 |
+
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_daegu.py (์์ ์๊ฐ: 3515์ด)
|
| 276 |
+
|
| 277 |
+
----------------------------------------
|
| 278 |
+
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_daejeon.py
|
| 279 |
+
์์ ์๊ฐ: 2025-12-28 06:28:13
|
| 280 |
+
----------------------------------------
|
| 281 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 282 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 283 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 284 |
+
|
| 285 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 286 |
1%| | 1/100 [00:37<1:02:28, 37.86s/trial, best loss: -0.4839]
|
| 287 |
2%|โ | 2/100 [01:13<59:40, 36.53s/trial, best loss: -0.4839]
|
| 288 |
3%|โ | 3/100 [01:51<1:00:22, 37.34s/trial, best loss: -0.4865]
|
| 289 |
4%|โ | 4/100 [02:59<1:19:11, 49.49s/trial, best loss: -0.4865]
|
| 290 |
5%|โ | 5/100 [04:05<1:27:35, 55.32s/trial, best loss: -0.4953]
|
| 291 |
6%|โ | 6/100 [04:39<1:15:30, 48.19s/trial, best loss: -0.4953]
|
| 292 |
7%|โ | 7/100 [05:08<1:04:51, 41.84s/trial, best loss: -0.4953]
|
| 293 |
8%|โ | 8/100 [05:51<1:04:45, 42.23s/trial, best loss: -0.4953]
|
| 294 |
9%|โ | 9/100 [06:43<1:08:41, 45.30s/trial, best loss: -0.4953]
|
| 295 |
10%|โ | 10/100 [07:11<1:00:00, 40.00s/trial, best loss: -0.4953]
|
| 296 |
11%|โ | 11/100 [07:50<58:33, 39.47s/trial, best loss: -0.4953]
|
| 297 |
12%|โโ | 12/100 [08:40<1:02:40, 42.74s/trial, best loss: -0.502]
|
| 298 |
13%|โโ | 13/100 [09:11<56:49, 39.19s/trial, best loss: -0.502]
|
| 299 |
14%|โโ | 14/100 [10:06<1:03:07, 44.04s/trial, best loss: -0.502]
|
| 300 |
15%|โโ | 15/100 [10:59<1:06:00, 46.60s/trial, best loss: -0.502]
|
| 301 |
16%|โโ | 16/100 [11:49<1:06:55, 47.80s/trial, best loss: -0.502]
|
| 302 |
17%|โโ | 17/100 [13:07<1:18:45, 56.93s/trial, best loss: -0.502]
|
| 303 |
18%|โโ | 18/100 [13:24<1:01:13, 44.79s/trial, best loss: -0.502]
|
| 304 |
19%|โโ | 19/100 [13:55<54:42, 40.53s/trial, best loss: -0.502]
|
| 305 |
20%|โโ | 20/100 [14:36<54:26, 40.83s/trial, best loss: -0.502]
|
| 306 |
21%|โโ | 21/100 [15:25<57:02, 43.32s/trial, best loss: -0.502]
|
| 307 |
22%|โโโ | 22/100 [15:51<49:20, 37.95s/trial, best loss: -0.502]
|
| 308 |
23%|โโโ | 23/100 [16:26<47:50, 37.28s/trial, best loss: -0.502]
|
| 309 |
24%|โโโ | 24/100 [16:53<43:12, 34.11s/trial, best loss: -0.502]
|
| 310 |
25%|โโโ | 25/100 [17:17<38:47, 31.04s/trial, best loss: -0.502]
|
| 311 |
26%|โโโ | 26/100 [17:53<39:57, 32.41s/trial, best loss: -0.502]
|
| 312 |
27%|โโโ | 27/100 [18:24<39:06, 32.14s/trial, best loss: -0.502]
|
| 313 |
28%|โโโ | 28/100 [19:03<40:56, 34.12s/trial, best loss: -0.502]
|
| 314 |
29%|โโโ | 29/100 [19:45<43:05, 36.42s/trial, best loss: -0.5029]
|
| 315 |
30%|โโโ | 30/100 [20:21<42:37, 36.54s/trial, best loss: -0.5029]
|
| 316 |
31%|โโโ | 31/100 [20:55<40:57, 35.62s/trial, best loss: -0.5029]
|
| 317 |
32%|โโโโ | 32/100 [21:32<40:42, 35.92s/trial, best loss: -0.5029]
|
| 318 |
33%|โโโโ | 33/100 [22:06<39:42, 35.55s/trial, best loss: -0.5029]
|
| 319 |
34%|โโโโ | 34/100 [22:48<41:01, 37.30s/trial, best loss: -0.5029]
|
| 320 |
35%|โโโโ | 35/100 [23:25<40:19, 37.23s/trial, best loss: -0.5029]
|
| 321 |
36%|โโโโ | 36/100 [24:00<38:58, 36.54s/trial, best loss: -0.5029]
|
| 322 |
37%|โโโโ | 37/100 [24:24<34:28, 32.83s/trial, best loss: -0.5029]
|
| 323 |
38%|โโโโ | 38/100 [24:57<34:06, 33.01s/trial, best loss: -0.5029]
|
| 324 |
39%|โโโโ | 39/100 [25:44<37:50, 37.22s/trial, best loss: -0.5029]
|
| 325 |
40%|โโโโ | 40/100 [26:30<39:40, 39.68s/trial, best loss: -0.5029]
|
| 326 |
41%|โโโโ | 41/100 [27:20<42:07, 42.84s/trial, best loss: -0.5029]
|
| 327 |
42%|โโโโโ | 42/100 [27:51<38:06, 39.41s/trial, best loss: -0.5029]
|
| 328 |
43%|โโโโโ | 43/100 [28:15<33:02, 34.79s/trial, best loss: -0.5029]
|
| 329 |
44%|โโโโโ | 44/100 [29:30<43:38, 46.75s/trial, best loss: -0.5029]
|
| 330 |
45%|โโโโโ | 45/100 [30:15<42:20, 46.19s/trial, best loss: -0.5029]
|
| 331 |
46%|โโโโโ | 46/100 [30:53<39:26, 43.82s/trial, best loss: -0.5029]
|
| 332 |
47%|โโโโโ | 47/100 [31:15<32:57, 37.32s/trial, best loss: -0.5029]
|
| 333 |
48%|โโโโโ | 48/100 [31:43<29:44, 34.32s/trial, best loss: -0.5029]
|
| 334 |
49%|โโโโโ | 49/100 [32:11<27:32, 32.40s/trial, best loss: -0.5029]
|
| 335 |
50%|โโโโโ | 50/100 [32:38<25:52, 31.05s/trial, best loss: -0.5029]
|
| 336 |
51%|โโโโโ | 51/100 [33:21<28:12, 34.55s/trial, best loss: -0.5029]
|
| 337 |
52%|โโโโโโ | 52/100 [33:56<27:48, 34.77s/trial, best loss: -0.5029]
|
| 338 |
53%|โโโโโโ | 53/100 [34:35<28:10, 35.98s/trial, best loss: -0.5029]
|
| 339 |
54%|โโโโโโ | 54/100 [35:06<26:20, 34.36s/trial, best loss: -0.5029]
|
| 340 |
55%|โโโโโโ | 55/100 [35:38<25:22, 33.84s/trial, best loss: -0.5029]
|
| 341 |
56%|โโโโโโ | 56/100 [36:30<28:49, 39.30s/trial, best loss: -0.5029]
|
| 342 |
57%|โโโโโโ | 57/100 [37:21<30:29, 42.55s/trial, best loss: -0.5029]
|
| 343 |
58%|โโโโโโ | 58/100 [38:01<29:24, 42.00s/trial, best loss: -0.5029]
|
| 344 |
59%|โโโโโโ | 59/100 [38:39<27:43, 40.57s/trial, best loss: -0.5029]
|
| 345 |
60%|โโโโโโ | 60/100 [39:17<26:36, 39.92s/trial, best loss: -0.5029]
|
| 346 |
61%|โโโโโโ | 61/100 [40:33<33:02, 50.83s/trial, best loss: -0.5029]
|
| 347 |
62%|โโโโโโโ | 62/100 [41:01<27:54, 44.05s/trial, best loss: -0.5029]
|
| 348 |
63%|โโโโโโโ | 63/100 [41:30<24:15, 39.33s/trial, best loss: -0.5029]
|
| 349 |
64%|โโโโโโโ | 64/100 [42:06<22:58, 38.29s/trial, best loss: -0.5029]
|
| 350 |
65%|โโโโโโโ | 65/100 [42:37<21:10, 36.30s/trial, best loss: -0.5029]
|
| 351 |
66%|โโโโโโโ | 66/100 [43:07<19:29, 34.39s/trial, best loss: -0.5029]
|
| 352 |
67%|โโโโโโโ | 67/100 [43:41<18:52, 34.31s/trial, best loss: -0.5029]
|
| 353 |
68%|โโโโโโโ | 68/100 [44:11<17:29, 32.80s/trial, best loss: -0.5029]
|
| 354 |
69%|โโโโโโโ | 69/100 [44:39<16:10, 31.32s/trial, best loss: -0.5029]
|
| 355 |
70%|โโโโโโโ | 70/100 [45:18<16:51, 33.72s/trial, best loss: -0.5029]
|
| 356 |
71%|โโโโโโโ | 71/100 [46:03<17:59, 37.22s/trial, best loss: -0.5029]
|
| 357 |
72%|โโโโโโโโ | 72/100 [46:37<16:54, 36.22s/trial, best loss: -0.5029]
|
| 358 |
73%|โโโโโโโโ | 73/100 [47:05<15:07, 33.61s/trial, best loss: -0.5029]
|
| 359 |
74%|โโโโโโโโ | 74/100 [47:28<13:13, 30.51s/trial, best loss: -0.5029]
|
| 360 |
75%|โโโโโโโโ | 75/100 [48:09<14:03, 33.75s/trial, best loss: -0.5029]
|
| 361 |
76%|โโโโโโโโ | 76/100 [48:34<12:28, 31.19s/trial, best loss: -0.5029]
|
| 362 |
77%|โโโโโโโโ | 77/100 [49:12<12:40, 33.05s/trial, best loss: -0.5029]
|
| 363 |
78%|โโโโโโโโ | 78/100 [49:46<12:17, 33.50s/trial, best loss: -0.5029]
|
| 364 |
79%|โโโโโโโโ | 79/100 [50:25<12:18, 35.15s/trial, best loss: -0.5029]
|
| 365 |
80%|โโโโโโโโ | 80/100 [51:02<11:49, 35.46s/trial, best loss: -0.5029]
|
| 366 |
81%|โโโโโโโโ | 81/100 [52:07<14:07, 44.61s/trial, best loss: -0.5029]
|
| 367 |
82%|โโโโโโโโโ | 82/100 [52:39<12:13, 40.76s/trial, best loss: -0.5029]
|
| 368 |
83%|โโโโโโโโโ | 83/100 [53:41<13:21, 47.14s/trial, best loss: -0.5029]
|
| 369 |
84%|โโโโโโโโโ | 84/100 [54:31<12:47, 47.94s/trial, best loss: -0.5029]
|
| 370 |
85%|โโโโโโโโโ | 85/100 [54:54<10:06, 40.42s/trial, best loss: -0.5029]
|
| 371 |
86%|โโโโโโโโโ | 86/100 [55:25<08:46, 37.60s/trial, best loss: -0.5029]
|
| 372 |
87%|โโโโโโโโโ | 87/100 [55:54<07:35, 35.01s/trial, best loss: -0.5029]
|
| 373 |
88%|โโโโโโโโโ | 88/100 [56:45<07:56, 39.74s/trial, best loss: -0.5029]
|
| 374 |
89%|โโโโโโโโโ | 89/100 [57:25<07:18, 39.87s/trial, best loss: -0.5029]
|
| 375 |
90%|โโโโโโโโโ | 90/100 [58:02<06:31, 39.12s/trial, best loss: -0.5029]
|
| 376 |
91%|โโโโโโโโโ | 91/100 [58:38<05:42, 38.08s/trial, best loss: -0.5029]
|
| 377 |
92%|โโโโโโโโโโ| 92/100 [59:05<04:39, 34.90s/trial, best loss: -0.5029]
|
| 378 |
93%|โโโโโโโโโโ| 93/100 [1:00:12<05:10, 44.39s/trial, best loss: -0.5029]
|
| 379 |
94%|โโโโโโโโโโ| 94/100 [1:00:53<04:19, 43.29s/trial, best loss: -0.5029]
|
| 380 |
95%|โโโโโโโโโโ| 95/100 [1:01:48<03:54, 46.95s/trial, best loss: -0.5029]
|
| 381 |
96%|โโโโโโโโโโ| 96/100 [1:02:42<03:16, 49.08s/trial, best loss: -0.5029]
|
| 382 |
97%|โโโโโโโโโโ| 97/100 [1:03:52<02:46, 55.36s/trial, best loss: -0.5029]
|
| 383 |
98%|โโโโโโโโโโ| 98/100 [1:04:30<01:39, 49.96s/trial, best loss: -0.5029]
|
| 384 |
99%|โโโโโโโโโโ| 99/100 [1:05:12<00:47, 47.59s/trial, best loss: -0.5029]
|
| 385 |
+
|
| 386 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.7816067762051363, 'gamma': 0.5799629095615334, 'learning_rate': 0.06287412401679013, 'max_depth': 3.0, 'min_child_weight': 5.0, 'reg_alpha': 0.36731169488772253, 'reg_lambda': 0.03192020366519255, 'subsample': 0.6004605601176048}
|
| 387 |
+
์ต์ CSI ์ ์: 0.5029 (loss: -0.5029)
|
| 388 |
+
|
| 389 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 390 |
+
- ์ด ์๋ ํ์: 100
|
| 391 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 392 |
+
- ์ต์ด CSI: 0.4839
|
| 393 |
+
- ์ต์ข
CSI: 0.4873
|
| 394 |
+
- ์ต๊ณ CSI: 0.5029
|
| 395 |
+
- ์ต์ CSI: 0.4796
|
| 396 |
+
- ํ๊ท CSI: 0.4918
|
| 397 |
+
|
| 398 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/xgb_ctgan10000_daejeon_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 399 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 400 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 401 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4534
|
| 402 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 403 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.4712
|
| 404 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 405 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5842
|
| 406 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 407 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/xgb_optima/xgb_ctgan10000_daejeon.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 408 |
+
|
| 409 |
+
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_daejeon.py (์์ ์๊ฐ: 3996์ด)
|
| 410 |
+
|
| 411 |
+
----------------------------------------
|
| 412 |
+
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_gwangju.py
|
| 413 |
+
์์ ์๊ฐ: 2025-12-28 07:34:49
|
| 414 |
+
----------------------------------------
|
| 415 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 416 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 417 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 418 |
+
|
| 419 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 420 |
1%| | 1/100 [00:25<41:41, 25.27s/trial, best loss: -0.4941]
|
| 421 |
2%|โ | 2/100 [01:28<1:17:46, 47.61s/trial, best loss: -0.4941]
|
| 422 |
3%|โ | 3/100 [02:09<1:11:52, 44.46s/trial, best loss: -0.4941]
|
| 423 |
4%|โ | 4/100 [03:21<1:28:25, 55.27s/trial, best loss: -0.4941]
|
| 424 |
5%|โ | 5/100 [04:15<1:26:54, 54.89s/trial, best loss: -0.4941]
|
| 425 |
6%|โ | 6/100 [04:47<1:14:05, 47.29s/trial, best loss: -0.4941]
|
| 426 |
7%|โ | 7/100 [05:30<1:11:03, 45.85s/trial, best loss: -0.4941]
|
| 427 |
8%|โ | 8/100 [06:17<1:10:33, 46.01s/trial, best loss: -0.4941]
|
| 428 |
9%|โ | 9/100 [06:38<58:16, 38.42s/trial, best loss: -0.4941]
|
| 429 |
10%|โ | 10/100 [07:21<59:33, 39.70s/trial, best loss: -0.4941]
|
| 430 |
11%|โ | 11/100 [08:11<1:03:31, 42.82s/trial, best loss: -0.4941]
|
| 431 |
12%|โโ | 12/100 [08:40<56:37, 38.61s/trial, best loss: -0.4941]
|
| 432 |
13%|โโ | 13/100 [09:29<1:00:31, 41.74s/trial, best loss: -0.4941]
|
| 433 |
14%|โโ | 14/100 [09:52<51:46, 36.12s/trial, best loss: -0.4941]
|
| 434 |
15%|โโ | 15/100 [10:31<52:22, 36.96s/trial, best loss: -0.4941]
|
| 435 |
16%|โโ | 16/100 [11:05<50:37, 36.16s/trial, best loss: -0.4941]
|
| 436 |
17%|โโ | 17/100 [12:46<1:16:56, 55.62s/trial, best loss: -0.4941]
|
| 437 |
18%|โโ | 18/100 [13:14<1:04:51, 47.46s/trial, best loss: -0.4941]
|
| 438 |
19%|โโ | 19/100 [13:50<59:23, 44.00s/trial, best loss: -0.4941]
|
| 439 |
20%|โโ | 20/100 [14:43<1:02:07, 46.59s/trial, best loss: -0.4941]
|
| 440 |
21%|โโ | 21/100 [15:08<52:40, 40.00s/trial, best loss: -0.4941]
|
| 441 |
22%|โโโ | 22/100 [15:46<51:25, 39.56s/trial, best loss: -0.4941]
|
| 442 |
23%|โโโ | 23/100 [16:16<47:05, 36.70s/trial, best loss: -0.4975]
|
| 443 |
24%|โโโ | 24/100 [16:56<47:48, 37.75s/trial, best loss: -0.4975]
|
| 444 |
25%|โโโ | 25/100 [17:26<44:15, 35.41s/trial, best loss: -0.4975]
|
| 445 |
26%|โโโ | 26/100 [17:53<40:27, 32.81s/trial, best loss: -0.4975]
|
| 446 |
27%|โโโ | 27/100 [18:16<36:21, 29.89s/trial, best loss: -0.4975]
|
| 447 |
28%|โโโ | 28/100 [18:58<40:12, 33.50s/trial, best loss: -0.4975]
|
| 448 |
29%|โโโ | 29/100 [19:58<48:53, 41.32s/trial, best loss: -0.4975]
|
| 449 |
30%|โโโ | 30/100 [20:29<44:54, 38.49s/trial, best loss: -0.4975]
|
| 450 |
31%|โโโ | 31/100 [21:09<44:27, 38.66s/trial, best loss: -0.4975]
|
| 451 |
32%|โโโโ | 32/100 [21:48<44:08, 38.94s/trial, best loss: -0.4991]
|
| 452 |
33%|โโโโ | 33/100 [22:18<40:26, 36.21s/trial, best loss: -0.4991]
|
| 453 |
34%|โโโโ | 34/100 [22:47<37:32, 34.13s/trial, best loss: -0.4991]
|
| 454 |
35%|โโโโ | 35/100 [23:14<34:32, 31.88s/trial, best loss: -0.4991]
|
| 455 |
36%|โโโโ | 36/100 [23:39<31:40, 29.70s/trial, best loss: -0.4991]
|
| 456 |
37%|โโโโ | 37/100 [24:20<34:47, 33.13s/trial, best loss: -0.4991]
|
| 457 |
38%|โโโโ | 38/100 [24:54<34:35, 33.47s/trial, best loss: -0.4991]
|
| 458 |
39%|โโโโ | 39/100 [25:26<33:35, 33.05s/trial, best loss: -0.4991]
|
| 459 |
40%|โโโโ | 40/100 [26:03<34:11, 34.19s/trial, best loss: -0.4991]
|
| 460 |
41%|โโโโ | 41/100 [26:45<35:55, 36.54s/trial, best loss: -0.4991]
|
| 461 |
42%|โโโโโ | 42/100 [27:12<32:38, 33.76s/trial, best loss: -0.4991]
|
| 462 |
43%|โโโโโ | 43/100 [28:18<41:16, 43.45s/trial, best loss: -0.4991]
|
| 463 |
44%|โโโโโ | 44/100 [28:46<36:11, 38.77s/trial, best loss: -0.4991]
|
| 464 |
45%|โโโโโ | 45/100 [29:38<39:08, 42.71s/trial, best loss: -0.4991]
|
| 465 |
46%|โโโโโ | 46/100 [30:24<39:16, 43.64s/trial, best loss: -0.4991]
|
| 466 |
47%|โโโโโ | 47/100 [30:48<33:24, 37.83s/trial, best loss: -0.4991]
|
| 467 |
48%|โโโโโ | 48/100 [31:18<30:43, 35.45s/trial, best loss: -0.4991]
|
| 468 |
49%|โโโโโ | 49/100 [32:28<38:51, 45.71s/trial, best loss: -0.4991]
|
| 469 |
50%|โโโโโ | 50/100 [32:56<33:50, 40.60s/trial, best loss: -0.4991]
|
| 470 |
51%|โโโโโ | 51/100 [33:45<35:11, 43.09s/trial, best loss: -0.4991]
|
| 471 |
52%|โโโโโโ | 52/100 [34:45<38:28, 48.10s/trial, best loss: -0.4991]
|
| 472 |
53%|โโโโโโ | 53/100 [35:06<31:25, 40.11s/trial, best loss: -0.4991]
|
| 473 |
54%|โ๏ฟฝ๏ฟฝ๏ฟฝโโโโ | 54/100 [35:50<31:31, 41.13s/trial, best loss: -0.4991]
|
| 474 |
55%|โโโโโโ | 55/100 [36:31<30:51, 41.15s/trial, best loss: -0.4991]
|
| 475 |
56%|โโโโโโ | 56/100 [36:51<25:32, 34.83s/trial, best loss: -0.4991]
|
| 476 |
57%|โโโโโโ | 57/100 [37:30<25:48, 36.00s/trial, best loss: -0.4991]
|
| 477 |
58%|โโโโโโ | 58/100 [38:18<27:43, 39.60s/trial, best loss: -0.4991]
|
| 478 |
59%|โโโโโโ | 59/100 [38:42<23:51, 34.91s/trial, best loss: -0.4991]
|
| 479 |
60%|โโโโโโ | 60/100 [39:10<21:51, 32.80s/trial, best loss: -0.4991]
|
| 480 |
61%|โโโโโโ | 61/100 [40:10<26:39, 41.02s/trial, best loss: -0.4991]
|
| 481 |
62%|โโโโโโโ | 62/100 [40:54<26:28, 41.80s/trial, best loss: -0.4991]
|
| 482 |
63%|โโโโโโโ | 63/100 [41:14<21:46, 35.32s/trial, best loss: -0.4991]
|
| 483 |
64%|โโโโโโโ | 64/100 [41:41<19:48, 33.02s/trial, best loss: -0.4991]
|
| 484 |
65%|โโโโโโโ | 65/100 [42:14<19:07, 32.80s/trial, best loss: -0.4991]
|
| 485 |
66%|โโโโโโโ | 66/100 [42:50<19:10, 33.83s/trial, best loss: -0.4991]
|
| 486 |
67%|โโโโโโโ | 67/100 [43:20<18:03, 32.84s/trial, best loss: -0.4991]
|
| 487 |
68%|โโโโโโโ | 68/100 [43:49<16:47, 31.49s/trial, best loss: -0.4991]
|
| 488 |
69%|โโโโโโโ | 69/100 [44:17<15:43, 30.42s/trial, best loss: -0.4991]
|
| 489 |
70%|โโโโโโโ | 70/100 [44:43<14:36, 29.21s/trial, best loss: -0.4991]
|
| 490 |
71%|โโโโโโโ | 71/100 [45:10<13:43, 28.40s/trial, best loss: -0.4991]
|
| 491 |
72%|โโโโโโโโ | 72/100 [45:32<12:25, 26.64s/trial, best loss: -0.4991]
|
| 492 |
73%|โโโโโโโโ | 73/100 [46:05<12:50, 28.55s/trial, best loss: -0.4991]
|
| 493 |
74%|โโโโโโโโ | 74/100 [46:38<12:53, 29.74s/trial, best loss: -0.4991]
|
| 494 |
75%|โโโโโโโโ | 75/100 [47:08<12:28, 29.93s/trial, best loss: -0.4991]
|
| 495 |
76%|โโโโโโโโ | 76/100 [47:36<11:40, 29.19s/trial, best loss: -0.4999]
|
| 496 |
77%|โโโโโโโโ | 77/100 [47:58<10:25, 27.18s/trial, best loss: -0.4999]
|
| 497 |
78%|โโโโโโโโ | 78/100 [48:32<10:40, 29.13s/trial, best loss: -0.4999]
|
| 498 |
79%|โโโโโโโโ | 79/100 [48:55<09:34, 27.34s/trial, best loss: -0.4999]
|
| 499 |
80%|โโโโโโโโ | 80/100 [49:24<09:18, 27.92s/trial, best loss: -0.4999]
|
| 500 |
81%|โโโโโโโโ | 81/100 [49:43<07:58, 25.18s/trial, best loss: -0.4999]
|
| 501 |
82%|โโโโโโโโโ | 82/100 [50:03<07:03, 23.55s/trial, best loss: -0.4999]
|
| 502 |
83%|โโโโโโโโโ | 83/100 [50:25<06:35, 23.24s/trial, best loss: -0.4999]
|
| 503 |
84%|โโโโโโโโโ | 84/100 [50:55<06:41, 25.11s/trial, best loss: -0.4999]
|
| 504 |
85%|โโโโโโโโโ | 85/100 [51:15<05:57, 23.82s/trial, best loss: -0.4999]
|
| 505 |
86%|โโโโโโโโโ | 86/100 [52:06<07:24, 31.75s/trial, best loss: -0.4999]
|
| 506 |
87%|โโโโโโโโโ | 87/100 [52:29<06:20, 29.29s/trial, best loss: -0.4999]
|
| 507 |
88%|โโโโโโโโโ | 88/100 [52:56<05:42, 28.56s/trial, best loss: -0.4999]
|
| 508 |
89%|โโโโโโโโโ | 89/100 [53:27<05:23, 29.39s/trial, best loss: -0.4999]
|
| 509 |
90%|โโโโโโโโโ | 90/100 [53:55<04:47, 28.75s/trial, best loss: -0.4999]
|
| 510 |
91%|โโโโโโโโโ | 91/100 [54:28<04:30, 30.04s/trial, best loss: -0.4999]
|
| 511 |
92%|โโโโโโโโโโ| 92/100 [55:22<04:58, 37.30s/trial, best loss: -0.4999]
|
| 512 |
93%|โโโโโโโโโโ| 93/100 [56:11<04:45, 40.74s/trial, best loss: -0.4999]
|
| 513 |
94%|โโโโโโโโโโ| 94/100 [56:39<03:41, 36.98s/trial, best loss: -0.4999]
|
| 514 |
95%|โโโโโโโโโโ| 95/100 [57:03<02:44, 32.98s/trial, best loss: -0.4999]
|
| 515 |
96%|โโโโโโโโโโ| 96/100 [57:33<02:08, 32.24s/trial, best loss: -0.4999]
|
| 516 |
97%|โโโโโโโโโโ| 97/100 [57:51<01:23, 27.84s/trial, best loss: -0.4999]
|
| 517 |
98%|โโโโโโโโโโ| 98/100 [58:14<00:52, 26.39s/trial, best loss: -0.4999]
|
| 518 |
99%|โโโโโโโโโโ| 99/100 [58:35<00:24, 24.80s/trial, best loss: -0.4999]
|
| 519 |
+
|
| 520 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.9825715751506052, 'gamma': 0.029399796024525915, 'learning_rate': 0.08575762330828458, 'max_depth': 11.0, 'min_child_weight': 8.0, 'reg_alpha': 0.8534545581720909, 'reg_lambda': 0.43478744549007325, 'subsample': 0.7629247503643918}
|
| 521 |
+
์ต์ CSI ์ ์: 0.4999 (loss: -0.4999)
|
| 522 |
+
|
| 523 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 524 |
+
- ์ด ์๋ ํ์: 100
|
| 525 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 526 |
+
- ์ต์ด CSI: 0.4941
|
| 527 |
+
- ์ต์ข
CSI: 0.4935
|
| 528 |
+
- ์ต๊ณ CSI: 0.4999
|
| 529 |
+
- ์ต์ CSI: 0.4364
|
| 530 |
+
- ํ๊ท CSI: 0.4867
|
| 531 |
+
|
| 532 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/xgb_ctgan10000_gwangju_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 533 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 534 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 535 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.4102
|
| 536 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 537 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.5658
|
| 538 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 539 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5239
|
| 540 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 541 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/xgb_optima/xgb_ctgan10000_gwangju.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 542 |
+
|
| 543 |
+
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_gwangju.py (์์ ์๊ฐ: 3571์ด)
|
| 544 |
+
|
| 545 |
+
----------------------------------------
|
| 546 |
+
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_incheon.py
|
| 547 |
+
์์ ์๊ฐ: 2025-12-28 08:34:20
|
| 548 |
+
----------------------------------------
|
| 549 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 550 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 551 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 552 |
+
|
| 553 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 554 |
1%| | 1/100 [00:20<34:14, 20.76s/trial, best loss: -0.5632]
|
| 555 |
2%|โ | 2/100 [00:37<30:03, 18.41s/trial, best loss: -0.5632]
|
| 556 |
3%|โ | 3/100 [01:03<35:30, 21.96s/trial, best loss: -0.5632]
|
| 557 |
4%|โ | 4/100 [01:29<37:51, 23.66s/trial, best loss: -0.5632]
|
| 558 |
5%|โ | 5/100 [01:52<36:56, 23.33s/trial, best loss: -0.5632]
|
| 559 |
6%|โ | 6/100 [02:47<53:33, 34.18s/trial, best loss: -0.5632]
|
| 560 |
7%|โ | 7/100 [03:23<53:40, 34.62s/trial, best loss: -0.5633]
|
| 561 |
8%|โ | 8/100 [04:16<1:01:57, 40.41s/trial, best loss: -0.5633]
|
| 562 |
9%|โ | 9/100 [04:34<50:47, 33.49s/trial, best loss: -0.5633]
|
| 563 |
10%|โ | 10/100 [05:16<54:10, 36.11s/trial, best loss: -0.5633]
|
| 564 |
11%|โ | 11/100 [05:43<49:17, 33.23s/trial, best loss: -0.5633]
|
| 565 |
12%|โโ | 12/100 [06:37<57:55, 39.49s/trial, best loss: -0.5633]
|
| 566 |
13%|โโ | 13/100 [07:17<57:38, 39.75s/trial, best loss: -0.5633]
|
| 567 |
14%|โโ | 14/100 [07:53<55:28, 38.71s/trial, best loss: -0.5633]
|
| 568 |
15%|โโ | 15/100 [08:29<53:39, 37.87s/trial, best loss: -0.5633]
|
| 569 |
16%|โโ | 16/100 [08:55<47:53, 34.21s/trial, best loss: -0.5633]
|
| 570 |
17%|โโ | 17/100 [09:19<42:58, 31.06s/trial, best loss: -0.5633]
|
| 571 |
18%|โโ | 18/100 [10:25<56:45, 41.54s/trial, best loss: -0.5633]
|
| 572 |
19%|โโ | 19/100 [10:47<48:32, 35.95s/trial, best loss: -0.5633]
|
| 573 |
20%|โโ | 20/100 [11:12<43:15, 32.45s/trial, best loss: -0.5633]
|
| 574 |
21%|โโ | 21/100 [11:35<39:02, 29.65s/trial, best loss: -0.5633]
|
| 575 |
22%|โโโ | 22/100 [11:55<34:38, 26.64s/trial, best loss: -0.5633]
|
| 576 |
23%|โโโ | 23/100 [12:16<32:13, 25.11s/trial, best loss: -0.5633]
|
| 577 |
24%|โโโ | 24/100 [12:47<33:55, 26.78s/trial, best loss: -0.5633]
|
| 578 |
25%|โโโ | 25/100 [13:49<46:58, 37.58s/trial, best loss: -0.5633]
|
| 579 |
26%|โโโ | 26/100 [14:16<42:20, 34.33s/trial, best loss: -0.5633]
|
| 580 |
27%|โโโ | 27/100 [14:45<39:33, 32.51s/trial, best loss: -0.5633]
|
| 581 |
28%|โโโ | 28/100 [15:10<36:39, 30.55s/trial, best loss: -0.5633]
|
| 582 |
29%|โโโ | 29/100 [15:42<36:29, 30.84s/trial, best loss: -0.5633]
|
| 583 |
30%|โโโ | 30/100 [16:04<32:59, 28.27s/trial, best loss: -0.5633]
|
| 584 |
31%|โโโ | 31/100 [16:38<34:23, 29.91s/trial, best loss: -0.5645]
|
| 585 |
32%|โโโโ | 32/100 [17:22<38:46, 34.21s/trial, best loss: -0.5706]
|
| 586 |
33%|โโโโ | 33/100 [18:15<44:24, 39.76s/trial, best loss: -0.5706]
|
| 587 |
34%|โโโโ | 34/100 [19:01<45:49, 41.65s/trial, best loss: -0.5706]
|
| 588 |
35%|โโโโ | 35/100 [19:35<42:44, 39.45s/trial, best loss: -0.5714]
|
| 589 |
36%|โโโโ | 36/100 [20:19<43:18, 40.60s/trial, best loss: -0.5714]
|
| 590 |
37%|โโโโ | 37/100 [20:54<40:58, 39.02s/trial, best loss: -0.5728]
|
| 591 |
38%|โโโโ | 38/100 [21:20<36:23, 35.21s/trial, best loss: -0.5728]
|
| 592 |
39%|โโโโ | 39/100 [22:31<46:32, 45.77s/trial, best loss: -0.5728]
|
| 593 |
40%|โโโโ | 40/100 [23:00<40:50, 40.84s/trial, best loss: -0.5728]
|
| 594 |
41%|โโโโ | 41/100 [23:50<42:55, 43.65s/trial, best loss: -0.5728]
|
| 595 |
42%|โโโโโ | 42/100 [24:25<39:33, 40.92s/trial, best loss: -0.5728]
|
| 596 |
43%|โโโโโ | 43/100 [25:12<40:33, 42.68s/trial, best loss: -0.5728]
|
| 597 |
44%|โโโโโ | 44/100 [25:44<36:53, 39.53s/trial, best loss: -0.5728]
|
| 598 |
45%|โโโโโ | 45/100 [26:27<37:07, 40.50s/trial, best loss: -0.5728]
|
| 599 |
46%|โโโโโ | 46/100 [26:55<33:11, 36.89s/trial, best loss: -0.5728]
|
| 600 |
47%|โโโโโ | 47/100 [27:29<31:48, 36.00s/trial, best loss: -0.5752]
|
| 601 |
48%|โโโโโ | 48/100 [28:12<32:56, 38.02s/trial, best loss: -0.5752]
|
| 602 |
49%|โโโโโ | 49/100 [29:03<35:42, 42.00s/trial, best loss: -0.5752]
|
| 603 |
50%|โโโโโ | 50/100 [29:44<34:41, 41.64s/trial, best loss: -0.5752]
|
| 604 |
51%|โโโโโ | 51/100 [30:31<35:24, 43.36s/trial, best loss: -0.5752]
|
| 605 |
52%|โโโโโโ | 52/100 [31:10<33:37, 42.03s/trial, best loss: -0.5752]
|
| 606 |
53%|โโโโโโ | 53/100 [32:15<38:25, 49.04s/trial, best loss: -0.5752]
|
| 607 |
54%|โโโโโโ | 54/100 [33:01<36:43, 47.91s/trial, best loss: -0.5752]
|
| 608 |
55%|โโโโโโ | 55/100 [33:49<36:06, 48.15s/trial, best loss: -0.5752]
|
| 609 |
56%|โโโโโโ | 56/100 [34:14<30:07, 41.07s/trial, best loss: -0.5752]
|
| 610 |
57%|โโโโโโ | 57/100 [35:00<30:34, 42.67s/trial, best loss: -0.5752]
|
| 611 |
58%|โโโโโโ | 58/100 [35:40<29:10, 41.68s/trial, best loss: -0.5752]
|
| 612 |
59%|โโโโโโ | 59/100 [36:03<24:48, 36.30s/trial, best loss: -0.5752]
|
| 613 |
60%|โโโโโโ | 60/100 [36:36<23:29, 35.23s/trial, best loss: -0.5752]
|
| 614 |
61%|โโโโโโ | 61/100 [37:05<21:41, 33.38s/trial, best loss: -0.5752]
|
| 615 |
62%|โโโโโโโ | 62/100 [37:54<24:06, 38.07s/trial, best loss: -0.5752]
|
| 616 |
63%|โโโโโโโ | 63/100 [38:44<25:39, 41.62s/trial, best loss: -0.5752]
|
| 617 |
64%|โโโโโโโ | 64/100 [39:31<25:51, 43.10s/trial, best loss: -0.5752]
|
| 618 |
65%|โโโโโโโ | 65/100 [40:19<26:01, 44.62s/trial, best loss: -0.5752]
|
| 619 |
66%|โโโโโโโ | 66/100 [40:58<24:23, 43.04s/trial, best loss: -0.5752]
|
| 620 |
67%|โโโโโโโ | 67/100 [41:51<25:12, 45.84s/trial, best loss: -0.5752]
|
| 621 |
68%|โโโโโโโ | 68/100 [42:34<24:06, 45.19s/trial, best loss: -0.5752]
|
| 622 |
69%|โโโโโโโ | 69/100 [43:11<22:05, 42.75s/trial, best loss: -0.5752]
|
| 623 |
70%|โโโโโโโ | 70/100 [43:52<20:59, 41.99s/trial, best loss: -0.5752]
|
| 624 |
71%|โโโโโโโ | 71/100 [44:35<20:27, 42.32s/trial, best loss: -0.5752]
|
| 625 |
72%|โโโโโโโโ | 72/100 [44:58<17:02, 36.50s/trial, best loss: -0.5752]
|
| 626 |
73%|โโโโโโโโ | 73/100 [45:17<14:03, 31.24s/trial, best loss: -0.5752]
|
| 627 |
74%|โโโโโโโโ | 74/100 [45:58<14:54, 34.42s/trial, best loss: -0.5752]
|
| 628 |
75%|โโโโโโโโ | 75/100 [46:29<13:49, 33.19s/trial, best loss: -0.5752]
|
| 629 |
76%|โโโโโโโโ | 76/100 [46:50<11:49, 29.56s/trial, best loss: -0.5752]
|
| 630 |
77%|โโโโโโโโ | 77/100 [47:37<13:24, 34.96s/trial, best loss: -0.5752]
|
| 631 |
78%|โโโโโโโโ | 78/100 [48:10<12:32, 34.23s/trial, best loss: -0.5752]
|
| 632 |
79%|โโโโโโโโ | 79/100 [48:29<10:21, 29.59s/trial, best loss: -0.5752]
|
| 633 |
80%|โโโโโโโโ | 80/100 [48:48<08:47, 26.39s/trial, best loss: -0.5752]
|
| 634 |
81%|โโโโโโโโ | 81/100 [49:21<09:03, 28.62s/trial, best loss: -0.5752]
|
| 635 |
82%|โโโโโโโโโ | 82/100 [50:05<09:58, 33.23s/trial, best loss: -0.5752]
|
| 636 |
83%|โโโโโโโโโ | 83/100 [50:31<08:45, 30.90s/trial, best loss: -0.5752]
|
| 637 |
84%|โโโโโโโโโ | 84/100 [51:08<08:44, 32.80s/trial, best loss: -0.5752]
|
| 638 |
85%|โโโโโโโโโ | 85/100 [51:39<08:03, 32.23s/trial, best loss: -0.5752]
|
| 639 |
86%|โโโโโโโโโ | 86/100 [52:06<07:07, 30.56s/trial, best loss: -0.5752]
|
| 640 |
87%|โโโโโโโโโ | 87/100 [52:34<06:26, 29.76s/trial, best loss: -0.5752]
|
| 641 |
88%|โโโโโโโโโ | 88/100 [54:13<10:08, 50.68s/trial, best loss: -0.5752]
|
| 642 |
89%|โโโโโโโโโ | 89/100 [54:46<08:17, 45.21s/trial, best loss: -0.5752]
|
| 643 |
90%|โโโโโโโโโ | 90/100 [55:12<06:34, 39.45s/trial, best loss: -0.5752]
|
| 644 |
91%|โโโโโโโโโ | 91/100 [55:50<05:53, 39.23s/trial, best loss: -0.5752]
|
| 645 |
92%|โโโโโโโโโโ| 92/100 [56:14<04:35, 34.50s/trial, best loss: -0.5752]
|
| 646 |
93%|โโโโโโโโโโ| 93/100 [56:38<03:40, 31.57s/trial, best loss: -0.5752]
|
| 647 |
94%|โโโโโโโโโโ| 94/100 [57:13<03:14, 32.49s/trial, best loss: -0.5752]
|
| 648 |
95%|โโโโโโโโโโ| 95/100 [57:49<02:47, 33.54s/trial, best loss: -0.5752]
|
| 649 |
96%|โโโโโโโโโโ| 96/100 [58:46<02:42, 40.69s/trial, best loss: -0.5752]
|
| 650 |
97%|โโโโโโโโโโ| 97/100 [59:20<01:55, 38.56s/trial, best loss: -0.5752]
|
| 651 |
98%|โโโโโโโโโโ| 98/100 [59:58<01:16, 38.38s/trial, best loss: -0.5752]
|
| 652 |
99%|โโโโโโโโโโ| 99/100 [1:00:25<00:35, 35.02s/trial, best loss: -0.5752]
|
| 653 |
+
|
| 654 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.9876604099689714, 'gamma': 2.7259563165720655, 'learning_rate': 0.014353110732979967, 'max_depth': 5.0, 'min_child_weight': 8.0, 'reg_alpha': 0.43412935826888077, 'reg_lambda': 0.45790677460553664, 'subsample': 0.6390967315026312}
|
| 655 |
+
์ต์ CSI ์ ์: 0.5752 (loss: -0.5752)
|
| 656 |
+
|
| 657 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 658 |
+
- ์ด ์๋ ํ์: 100
|
| 659 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 660 |
+
- ์ต์ด CSI: 0.5632
|
| 661 |
+
- ์ต์ข
CSI: 0.5595
|
| 662 |
+
- ์ต๊ณ CSI: 0.5752
|
| 663 |
+
- ์ต์ CSI: 0.5385
|
| 664 |
+
- ํ๊ท CSI: 0.5582
|
| 665 |
+
|
| 666 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/xgb_ctgan10000_incheon_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 667 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 668 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 669 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.5292
|
| 670 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 671 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.6124
|
| 672 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 673 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.5840
|
| 674 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 675 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/xgb_optima/xgb_ctgan10000_incheon.pkl๏ฟฝ๏ฟฝ๏ฟฝ ์ ์ฅ๋์์ต๋๋ค.
|
| 676 |
+
|
| 677 |
+
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_incheon.py (์์ ์๊ฐ: 3691์ด)
|
| 678 |
+
|
| 679 |
+
----------------------------------------
|
| 680 |
+
์คํ ์ค: xgb_ctgan10000/XGB_ctgan10000_seoul.py
|
| 681 |
+
์์ ์๊ฐ: 2025-12-28 09:35:51
|
| 682 |
+
----------------------------------------
|
| 683 |
+
๋ฐ์ดํฐ ๋ก๋ฉ ์ค...
|
| 684 |
+
๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...
|
| 685 |
+
ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...
|
| 686 |
+
|
| 687 |
0%| | 0/100 [00:00<?, ?trial/s, best loss=?]
|
| 688 |
1%| | 1/100 [00:26<44:04, 26.71s/trial, best loss: -0.5553]
|
| 689 |
2%|โ | 2/100 [01:25<1:14:19, 45.50s/trial, best loss: -0.5578]
|
| 690 |
3%|โ | 3/100 [01:43<53:05, 32.84s/trial, best loss: -0.5642]
|
| 691 |
4%|โ | 4/100 [02:23<57:11, 35.74s/trial, best loss: -0.5722]
|
| 692 |
5%|โ | 5/100 [03:14<1:05:13, 41.19s/trial, best loss: -0.5722]
|
| 693 |
6%|โ | 6/100 [03:53<1:03:36, 40.60s/trial, best loss: -0.5722]
|
| 694 |
7%|โ | 7/100 [04:34<1:03:04, 40.69s/trial, best loss: -0.5722]
|
| 695 |
8%|โ | 8/100 [05:56<1:22:33, 53.85s/trial, best loss: -0.5722]
|
| 696 |
9%|โ | 9/100 [06:33<1:13:50, 48.69s/trial, best loss: -0.5722]
|
| 697 |
10%|โ | 10/100 [07:35<1:19:14, 52.83s/trial, best loss: -0.5722]
|
| 698 |
11%|โ | 11/100 [08:04<1:07:21, 45.41s/trial, best loss: -0.5722]
|
| 699 |
12%|โโ | 12/100 [08:37<1:01:12, 41.74s/trial, best loss: -0.5722]
|
| 700 |
13%|โโ | 13/100 [09:20<1:00:55, 42.02s/trial, best loss: -0.5722]
|
| 701 |
14%|โโ | 14/100 [09:48<53:56, 37.64s/trial, best loss: -0.5722]
|
| 702 |
15%|โโ | 15/100 [10:32<56:09, 39.64s/trial, best loss: -0.5722]
|
| 703 |
16%|โโ | 16/100 [10:50<46:20, 33.10s/trial, best loss: -0.5722]
|
| 704 |
17%|โโ | 17/100 [12:02<1:02:10, 44.95s/trial, best loss: -0.5722]
|
| 705 |
18%|โโ | 18/100 [12:32<55:19, 40.49s/trial, best loss: -0.5733]
|
| 706 |
19%|โโ | 19/100 [13:24<59:17, 43.91s/trial, best loss: -0.5733]
|
| 707 |
20%|โโ | 20/100 [13:59<54:50, 41.13s/trial, best loss: -0.5733]
|
| 708 |
21%|โโ | 21/100 [14:32<51:00, 38.74s/trial, best loss: -0.5746]
|
| 709 |
22%|โโโ | 22/100 [15:02<47:06, 36.24s/trial, best loss: -0.5746]
|
| 710 |
23%|โโโ | 23/100 [15:27<42:08, 32.83s/trial, best loss: -0.5746]
|
| 711 |
24%|โโโ | 24/100 [16:08<44:35, 35.20s/trial, best loss: -0.5755]
|
| 712 |
25%|โโโ | 25/100 [16:32<39:49, 31.86s/trial, best loss: -0.5755]
|
| 713 |
26%|โโโ | 26/100 [17:09<41:12, 33.42s/trial, best loss: -0.5755]
|
| 714 |
27%|โโโ | 27/100 [17:38<38:48, 31.90s/trial, best loss: -0.5755]
|
| 715 |
28%|โโโ | 28/100 [18:12<39:05, 32.58s/trial, best loss: -0.5755]
|
| 716 |
29%|โโโ | 29/100 [18:37<35:55, 30.36s/trial, best loss: -0.5755]
|
| 717 |
30%|โโโ | 30/100 [19:01<33:14, 28.50s/trial, best loss: -0.5755]
|
| 718 |
31%|โโโ | 31/100 [19:44<37:34, 32.68s/trial, best loss: -0.5755]
|
| 719 |
32%|โโโโ | 32/100 [20:22<39:02, 34.45s/trial, best loss: -0.5756]
|
| 720 |
33%|โโโโ | 33/100 [21:26<48:30, 43.44s/trial, best loss: -0.5756]
|
| 721 |
34%|โโโโ | 34/100 [22:10<47:57, 43.60s/trial, best loss: -0.5756]
|
| 722 |
35%|โโโโ | 35/100 [22:53<46:44, 43.14s/trial, best loss: -0.5765]
|
| 723 |
36%|โโโโ | 36/100 [23:22<41:39, 39.06s/trial, best loss: -0.5765]
|
| 724 |
37%|โโโโ | 37/100 [23:59<40:26, 38.52s/trial, best loss: -0.5765]
|
| 725 |
38%|โโโโ | 38/100 [24:33<38:21, 37.12s/trial, best loss: -0.5765]
|
| 726 |
39%|โโโโ | 39/100 [24:59<34:25, 33.87s/trial, best loss: -0.5765]
|
| 727 |
40%|โโโโ | 40/100 [25:43<36:46, 36.77s/trial, best loss: -0.5765]
|
| 728 |
41%|โโโโ | 41/100 [26:10<33:16, 33.83s/trial, best loss: -0.5765]
|
| 729 |
42%|โโโโโ | 42/100 [26:48<33:59, 35.16s/trial, best loss: -0.5795]
|
| 730 |
43%|โโโโโ | 43/100 [27:34<36:30, 38.44s/trial, best loss: -0.5795]
|
| 731 |
44%|โโโโโ | 44/100 [28:07<34:18, 36.75s/trial, best loss: -0.5795]
|
| 732 |
45%|โโโโโ | 45/100 [29:03<38:56, 42.49s/trial, best loss: -0.5795]
|
| 733 |
46%|โโโโโ | 46/100 [30:11<45:07, 50.14s/trial, best loss: -0.5795]
|
| 734 |
47%|โโโโโ | 47/100 [30:41<38:58, 44.12s/trial, best loss: -0.5795]
|
| 735 |
48%|โโโโโ | 48/100 [31:09<34:00, 39.25s/trial, best loss: -0.5795]
|
| 736 |
49%|โโโโโ | 49/100 [31:36<30:15, 35.60s/trial, best loss: -0.5795]
|
| 737 |
50%|โโโโโ | 50/100 [32:00<26:38, 31.96s/trial, best loss: -0.5795]
|
| 738 |
51%|โโโโโ | 51/100 [32:38<27:48, 34.04s/trial, best loss: -0.5795]
|
| 739 |
52%|โโโโโโ | 52/100 [33:11<26:53, 33.62s/trial, best loss: -0.5795]
|
| 740 |
53%|โโโโโโ | 53/100 [34:06<31:27, 40.15s/trial, best loss: -0.5795]
|
| 741 |
54%|โโโโโโ | 54/100 [34:35<28:05, 36.63s/trial, best loss: -0.5795]
|
| 742 |
55%|โโโโโโ | 55/100 [35:03<25:27, 33.96s/trial, best loss: -0.5795]
|
| 743 |
56%|โโโโโโ | 56/100 [35:32<23:48, 32.47s/trial, best loss: -0.5795]
|
| 744 |
57%|โโโโโโ | 57/100 [36:16<25:55, 36.18s/trial, best loss: -0.5795]
|
| 745 |
58%|โโโโโโ | 58/100 [36:39<22:28, 32.12s/trial, best loss: -0.5795]
|
| 746 |
59%|โโโโโโ | 59/100 [37:05<20:46, 30.41s/trial, best loss: -0.5795]
|
| 747 |
60%|โโโโโ๏ฟฝ๏ฟฝ | 60/100 [37:46<22:14, 33.37s/trial, best loss: -0.5795]
|
| 748 |
61%|โโโโโโ | 61/100 [38:24<22:40, 34.89s/trial, best loss: -0.5795]
|
| 749 |
62%|โโโโโโโ | 62/100 [39:05<23:12, 36.64s/trial, best loss: -0.5795]
|
| 750 |
63%|โโโโโโโ | 63/100 [39:57<25:27, 41.29s/trial, best loss: -0.5795]
|
| 751 |
64%|โโโโโโโ | 64/100 [40:19<21:21, 35.59s/trial, best loss: -0.5795]
|
| 752 |
65%|โโโโโโโ | 65/100 [40:52<20:16, 34.76s/trial, best loss: -0.5795]
|
| 753 |
66%|โโโโโโโ | 66/100 [41:14<17:26, 30.79s/trial, best loss: -0.5795]
|
| 754 |
67%|โโโโโโโ | 67/100 [41:44<16:53, 30.70s/trial, best loss: -0.5795]
|
| 755 |
68%|โโโโโโโ | 68/100 [42:07<15:10, 28.45s/trial, best loss: -0.5795]
|
| 756 |
69%|โโโโโโโ | 69/100 [42:27<13:23, 25.92s/trial, best loss: -0.5795]
|
| 757 |
70%|โโโโโโโ | 70/100 [42:55<13:15, 26.52s/trial, best loss: -0.5797]
|
| 758 |
71%|โโโโโโโ | 71/100 [43:20<12:29, 25.85s/trial, best loss: -0.5824]
|
| 759 |
72%|โโโโโโโโ | 72/100 [43:50<12:40, 27.17s/trial, best loss: -0.5824]
|
| 760 |
73%|โโโโโโโโ | 73/100 [44:17<12:11, 27.08s/trial, best loss: -0.5824]
|
| 761 |
74%|โโโโโโโโ | 74/100 [44:38<10:59, 25.37s/trial, best loss: -0.5824]
|
| 762 |
75%|โโโโโโโโ | 75/100 [45:08<11:10, 26.80s/trial, best loss: -0.5824]
|
| 763 |
76%|โโโโโโโโ | 76/100 [45:54<12:56, 32.36s/trial, best loss: -0.5824]
|
| 764 |
77%|โโโโโโโโ | 77/100 [46:12<10:48, 28.20s/trial, best loss: -0.5824]
|
| 765 |
78%|โโโโโโโโ | 78/100 [46:36<09:51, 26.88s/trial, best loss: -0.5824]
|
| 766 |
79%|โโโโโโโโ | 79/100 [46:59<08:58, 25.63s/trial, best loss: -0.5824]
|
| 767 |
80%|โโโโโโโโ | 80/100 [47:29<09:04, 27.20s/trial, best loss: -0.5824]
|
| 768 |
81%|โโโโโโโโ | 81/100 [47:55<08:26, 26.67s/trial, best loss: -0.5824]
|
| 769 |
82%|โโโโโโโโโ | 82/100 [48:35<09:13, 30.73s/trial, best loss: -0.5824]
|
| 770 |
83%|โโโโโโโโโ | 83/100 [48:59<08:06, 28.60s/trial, best loss: -0.5824]
|
| 771 |
84%|โโโโโโโโโ | 84/100 [49:26<07:29, 28.09s/trial, best loss: -0.5824]
|
| 772 |
85%|โโโโโโโโโ | 85/100 [49:47<06:30, 26.06s/trial, best loss: -0.5824]
|
| 773 |
86%|โโโโโโโโโ | 86/100 [50:44<08:15, 35.36s/trial, best loss: -0.5824]
|
| 774 |
87%|โโโโโโโโโ | 87/100 [51:23<07:53, 36.46s/trial, best loss: -0.5824]
|
| 775 |
88%|โโโโโโโโโ | 88/100 [51:46<06:28, 32.41s/trial, best loss: -0.5824]
|
| 776 |
89%|โโโโโโโโโ | 89/100 [52:11<05:32, 30.19s/trial, best loss: -0.5824]
|
| 777 |
90%|โโโโโโโโโ | 90/100 [52:32<04:34, 27.47s/trial, best loss: -0.5824]
|
| 778 |
91%|โโโโโโโโโ | 91/100 [52:57<04:00, 26.68s/trial, best loss: -0.5824]
|
| 779 |
92%|โโโโโโโโโโ| 92/100 [53:34<03:57, 29.64s/trial, best loss: -0.5824]
|
| 780 |
93%|โโโโโโโโโโ| 93/100 [54:12<03:45, 32.28s/trial, best loss: -0.5824]
|
| 781 |
94%|โโโโโโโโโโ| 94/100 [54:43<03:11, 31.88s/trial, best loss: -0.5824]
|
| 782 |
95%|โโโโโโโโโโ| 95/100 [55:31<03:04, 36.86s/trial, best loss: -0.5824]
|
| 783 |
96%|โโโโโโโโโโ| 96/100 [55:57<02:14, 33.56s/trial, best loss: -0.5824]
|
| 784 |
97%|โโโโโโโโโโ| 97/100 [56:19<01:29, 29.99s/trial, best loss: -0.5824]
|
| 785 |
98%|โโโโโโโโโโ| 98/100 [56:47<00:59, 29.54s/trial, best loss: -0.5824]
|
| 786 |
99%|โโโโโโโโโโ| 99/100 [57:09<00:27, 27.11s/trial, best loss: -0.5824]
|
| 787 |
+
|
| 788 |
+
์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {'colsample_bytree': 0.8837225390968168, 'gamma': 0.1115044781500254, 'learning_rate': 0.10805110293567466, 'max_depth': 12.0, 'min_child_weight': 4.0, 'reg_alpha': 0.02183712172236562, 'reg_lambda': 0.6932207560084631, 'subsample': 0.6767341133785678}
|
| 789 |
+
์ต์ CSI ์ ์: 0.5824 (loss: -0.5824)
|
| 790 |
+
|
| 791 |
+
์ต์ ํ ๊ณผ์ ์์ฝ:
|
| 792 |
+
- ์ด ์๋ ํ์: 100
|
| 793 |
+
- ์ฑ๊ณตํ ์๋: 100
|
| 794 |
+
- ์ต์ด CSI: 0.5553
|
| 795 |
+
- ์ต์ข
CSI: 0.5700
|
| 796 |
+
- ์ต๊ณ CSI: 0.5824
|
| 797 |
+
- ์ต์ CSI: 0.5435
|
| 798 |
+
- ํ๊ท CSI: 0.5687
|
| 799 |
+
|
| 800 |
+
์ต์ ํ Trials ๊ฐ์ฒด๊ฐ /workspace/visibility_prediction/Analysis_code/optimization_history/xgb_ctgan10000_seoul_trials.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 801 |
+
์ต์ข
๋ชจ๋ธ ํ์ต ์์...
|
| 802 |
+
Fold 1 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2019], ๊ฒ์ฆ ์ฐ๋: 2020)
|
| 803 |
+
Fold 1 ๊ฒ์ฆ CSI: 0.5165
|
| 804 |
+
Fold 2 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2018, 2020], ๊ฒ์ฆ ์ฐ๋: 2019)
|
| 805 |
+
Fold 2 ๊ฒ์ฆ CSI: 0.6230
|
| 806 |
+
Fold 3 ํ์ต ์ค... (ํ์ต ์ฐ๋: [2019, 2020], ๊ฒ์ฆ ์ฐ๋: 2018)
|
| 807 |
+
Fold 3 ๊ฒ์ฆ CSI: 0.6077
|
| 808 |
+
๋ชจ๋ธ ์ ์ฅ ์ค...
|
| 809 |
+
๋ชจ๋ธ์ด /workspace/visibility_prediction/Analysis_code/save_model/xgb_optima/xgb_ctgan10000_seoul.pkl์ ์ ์ฅ๋์์ต๋๋ค.
|
| 810 |
+
|
| 811 |
+
โ ์๋ฃ: xgb_ctgan10000/XGB_ctgan10000_seoul.py (์์ ์๊ฐ: 3488์ด)
|
| 812 |
+
|
| 813 |
+
==========================================
|
| 814 |
+
XGB CTGAN10000 ํ์ผ ์คํ ์๋ฃ
|
| 815 |
+
์ข
๋ฃ ์๊ฐ: 2025-12-28 10:33:59
|
| 816 |
+
์ด ์์ ์๊ฐ: 6์๊ฐ 2๋ถ 42์ด
|
| 817 |
+
์ฑ๊ณต: 6๊ฐ
|
| 818 |
+
์คํจ: 0๊ฐ
|
| 819 |
+
==========================================
|
Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_daegu.py
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import os
|
| 3 |
+
import numpy as np
|
| 4 |
+
import joblib
|
| 5 |
+
from xgboost import XGBClassifier
|
| 6 |
+
from warnings import filterwarnings
|
| 7 |
+
filterwarnings('ignore')
|
| 8 |
+
from sklearn.metrics import confusion_matrix
|
| 9 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 10 |
+
|
| 11 |
+
# ์์ ์ ์
|
| 12 |
+
RANDOM_STATE = 42
|
| 13 |
+
N_ESTIMATORS = 4000
|
| 14 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 15 |
+
MAX_EVALS = 100
|
| 16 |
+
|
| 17 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 18 |
+
FOLD_CONFIGS = [
|
| 19 |
+
([2018, 2019], 2020), # Fold 1
|
| 20 |
+
([2018, 2020], 2019), # Fold 2
|
| 21 |
+
([2019, 2020], 2018), # Fold 3
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
def calculate_csi(Y_test, pred):
|
| 25 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 26 |
+
|
| 27 |
+
Args:
|
| 28 |
+
Y_test: ์ค์ ๋ ์ด๋ธ
|
| 29 |
+
pred: ์์ธก ๋ ์ด๋ธ
|
| 30 |
+
|
| 31 |
+
Returns:
|
| 32 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 33 |
+
"""
|
| 34 |
+
cm = confusion_matrix(Y_test, pred)
|
| 35 |
+
H = (cm[0, 0] + cm[1, 1])
|
| 36 |
+
F = (cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1])
|
| 37 |
+
M = (cm[0, 2] + cm[1, 2])
|
| 38 |
+
CSI = H / (H + F + M + 1e-10)
|
| 39 |
+
return CSI
|
| 40 |
+
|
| 41 |
+
def eval_metric_csi(y_true, pred_prob):
|
| 42 |
+
"""XGBoost์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 43 |
+
|
| 44 |
+
Args:
|
| 45 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 46 |
+
pred_prob: ์์ธก ํ๋ฅ
|
| 47 |
+
|
| 48 |
+
Returns:
|
| 49 |
+
CSI ์ ์์ ์์๊ฐ
|
| 50 |
+
"""
|
| 51 |
+
pred = np.argmax(pred_prob, axis=1)
|
| 52 |
+
csi = calculate_csi(y_true, pred)
|
| 53 |
+
return -1*csi
|
| 54 |
+
|
| 55 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 56 |
+
"""
|
| 57 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 58 |
+
|
| 59 |
+
Args:
|
| 60 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 61 |
+
|
| 62 |
+
Returns:
|
| 63 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 64 |
+
"""
|
| 65 |
+
df = df.copy()
|
| 66 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 67 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 68 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 69 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 70 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 71 |
+
return df
|
| 72 |
+
|
| 73 |
+
def preprocessing(df):
|
| 74 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 78 |
+
|
| 79 |
+
Returns:
|
| 80 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 81 |
+
"""
|
| 82 |
+
df = df[df.columns].copy()
|
| 83 |
+
df['year'] = df['year'].astype('int')
|
| 84 |
+
df['month'] = df['month'].astype('int')
|
| 85 |
+
df['hour'] = df['hour'].astype('int')
|
| 86 |
+
df = add_derived_features(df).copy()
|
| 87 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 88 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 89 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 90 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 91 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 92 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 93 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 94 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 95 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 96 |
+
return df
|
| 97 |
+
|
| 98 |
+
def create_xgb_model(search_space=None, best_params=None):
|
| 99 |
+
"""XGBoost ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 100 |
+
|
| 101 |
+
Args:
|
| 102 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 103 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 104 |
+
|
| 105 |
+
Returns:
|
| 106 |
+
XGBClassifier ์ธ์คํด์ค
|
| 107 |
+
"""
|
| 108 |
+
base_params = {
|
| 109 |
+
'n_estimators': N_ESTIMATORS,
|
| 110 |
+
'tree_method': 'hist',
|
| 111 |
+
'device': 'cuda',
|
| 112 |
+
'enable_categorical': True,
|
| 113 |
+
'eval_metric': eval_metric_csi,
|
| 114 |
+
'objective': 'multi:softprob',
|
| 115 |
+
'random_state': RANDOM_STATE,
|
| 116 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if search_space is not None:
|
| 120 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 121 |
+
params = {
|
| 122 |
+
**base_params,
|
| 123 |
+
'learning_rate': search_space['learning_rate'],
|
| 124 |
+
'max_depth': int(search_space['max_depth']),
|
| 125 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 126 |
+
'gamma': search_space['gamma'],
|
| 127 |
+
'subsample': search_space['subsample'],
|
| 128 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 129 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 130 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 131 |
+
}
|
| 132 |
+
elif best_params is not None:
|
| 133 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 134 |
+
params = {
|
| 135 |
+
**base_params,
|
| 136 |
+
'learning_rate': best_params['learning_rate'],
|
| 137 |
+
'max_depth': int(best_params['max_depth']),
|
| 138 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 139 |
+
'gamma': best_params['gamma'],
|
| 140 |
+
'subsample': best_params['subsample'],
|
| 141 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 142 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 143 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 144 |
+
}
|
| 145 |
+
else:
|
| 146 |
+
params = base_params
|
| 147 |
+
|
| 148 |
+
return XGBClassifier(**params)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ ๋ฐ ์ ์ฒ๋ฆฌ
|
| 152 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 153 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 154 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 155 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 156 |
+
df_daegu = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/daegu_train.csv"))
|
| 157 |
+
df_ctgan_daegu_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_daegu.csv"))
|
| 158 |
+
df_ctgan_daegu_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_daegu.csv"))
|
| 159 |
+
df_ctgan_daegu_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_daegu.csv"))
|
| 160 |
+
|
| 161 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 162 |
+
df_ctgan_daegu_1 = preprocessing(df_ctgan_daegu_1)
|
| 163 |
+
df_ctgan_daegu_2 = preprocessing(df_ctgan_daegu_2)
|
| 164 |
+
df_ctgan_daegu_3 = preprocessing(df_ctgan_daegu_3)
|
| 165 |
+
df_daegu = preprocessing(df_daegu)
|
| 166 |
+
|
| 167 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 168 |
+
df_ctgan_list = [df_ctgan_daegu_1, df_ctgan_daegu_2, df_ctgan_daegu_3]
|
| 169 |
+
|
| 170 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 171 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 172 |
+
|
| 173 |
+
Args:
|
| 174 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 175 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 176 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 177 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 178 |
+
|
| 179 |
+
Returns:
|
| 180 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 181 |
+
"""
|
| 182 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 183 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 184 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 185 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 186 |
+
|
| 187 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 188 |
+
val_mask = df_original['year'] == val_year
|
| 189 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 190 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 191 |
+
|
| 192 |
+
X_train.drop(columns=['year'], inplace=True)
|
| 193 |
+
X_val.drop(columns=['year'], inplace=True)
|
| 194 |
+
|
| 195 |
+
return X_train, X_val, y_train, y_val
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 199 |
+
xgb_search_space = {
|
| 200 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 201 |
+
'max_depth': hp.quniform('max_depth', 3, 12, 1),
|
| 202 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 203 |
+
'gamma': hp.uniform('gamma', 0, 5), # ํธ๋ฆฌ ๋ถํ ์ ์ํ ์ต์ ์์ค ๊ฐ์ ๊ฐ
|
| 204 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 205 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 206 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 207 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
def objective_func(search_space):
|
| 211 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 212 |
+
|
| 213 |
+
Args:
|
| 214 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 215 |
+
|
| 216 |
+
Returns:
|
| 217 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 218 |
+
"""
|
| 219 |
+
xgb_model = create_xgb_model(search_space=search_space)
|
| 220 |
+
csi_scores = []
|
| 221 |
+
|
| 222 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 223 |
+
for df_sampled, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 224 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 225 |
+
df_sampled, df_daegu, train_years, val_year
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 229 |
+
csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 230 |
+
csi_scores.append(csi)
|
| 231 |
+
|
| 232 |
+
return -1*round(np.mean(csi_scores), 4)
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 236 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 237 |
+
trials = Trials()
|
| 238 |
+
xgb_best = fmin(
|
| 239 |
+
fn=objective_func,
|
| 240 |
+
space=xgb_search_space,
|
| 241 |
+
algo=tpe.suggest,
|
| 242 |
+
max_evals=MAX_EVALS,
|
| 243 |
+
trials=trials
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 247 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {xgb_best}")
|
| 248 |
+
|
| 249 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 250 |
+
best_loss = trials.best_trial['result']['loss']
|
| 251 |
+
best_csi = -best_loss
|
| 252 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 253 |
+
|
| 254 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 255 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 256 |
+
csi_scores = [-loss for loss in losses]
|
| 257 |
+
|
| 258 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 259 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 260 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 261 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 262 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 263 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 264 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 265 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 266 |
+
|
| 267 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 268 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 269 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 270 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 271 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 272 |
+
trials_path = os.path.join(base_dir, "optimization_history/xgb_ctgan10000_daegu_trials.pkl")
|
| 273 |
+
joblib.dump(trials, trials_path)
|
| 274 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 275 |
+
|
| 276 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 277 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 278 |
+
models = []
|
| 279 |
+
|
| 280 |
+
for fold_idx, (df_sampled, (train_years, val_year)) in enumerate(
|
| 281 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 282 |
+
):
|
| 283 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 284 |
+
|
| 285 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 286 |
+
df_sampled, df_daegu, train_years, val_year
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
xgb_model = create_xgb_model(best_params=xgb_best)
|
| 290 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 291 |
+
|
| 292 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 293 |
+
val_csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 294 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 295 |
+
|
| 296 |
+
models.append(xgb_model)
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 300 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 301 |
+
os.makedirs(os.path.join(base_dir, "save_model/xgb_optima"), exist_ok=True)
|
| 302 |
+
model_save_path = os.path.join(base_dir, "save_model/xgb_optima/xgb_ctgan10000_daegu.pkl")
|
| 303 |
+
joblib.dump(models, model_save_path)
|
| 304 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 305 |
+
|
Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_daejeon.py
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import os
|
| 3 |
+
import numpy as np
|
| 4 |
+
import joblib
|
| 5 |
+
from xgboost import XGBClassifier
|
| 6 |
+
from warnings import filterwarnings
|
| 7 |
+
filterwarnings('ignore')
|
| 8 |
+
from sklearn.metrics import confusion_matrix
|
| 9 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 10 |
+
|
| 11 |
+
# ์์ ์ ์
|
| 12 |
+
RANDOM_STATE = 42
|
| 13 |
+
N_ESTIMATORS = 4000
|
| 14 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 15 |
+
MAX_EVALS = 100
|
| 16 |
+
|
| 17 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 18 |
+
FOLD_CONFIGS = [
|
| 19 |
+
([2018, 2019], 2020), # Fold 1
|
| 20 |
+
([2018, 2020], 2019), # Fold 2
|
| 21 |
+
([2019, 2020], 2018), # Fold 3
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
def calculate_csi(Y_test, pred):
|
| 25 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 26 |
+
|
| 27 |
+
Args:
|
| 28 |
+
Y_test: ์ค์ ๋ ์ด๋ธ
|
| 29 |
+
pred: ์์ธก ๋ ์ด๋ธ
|
| 30 |
+
|
| 31 |
+
Returns:
|
| 32 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 33 |
+
"""
|
| 34 |
+
cm = confusion_matrix(Y_test, pred)
|
| 35 |
+
H = (cm[0, 0] + cm[1, 1])
|
| 36 |
+
F = (cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1])
|
| 37 |
+
M = (cm[0, 2] + cm[1, 2])
|
| 38 |
+
CSI = H / (H + F + M + 1e-10)
|
| 39 |
+
return CSI
|
| 40 |
+
|
| 41 |
+
def eval_metric_csi(y_true, pred_prob):
|
| 42 |
+
"""XGBoost์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 43 |
+
|
| 44 |
+
Args:
|
| 45 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 46 |
+
pred_prob: ์์ธก ํ๋ฅ
|
| 47 |
+
|
| 48 |
+
Returns:
|
| 49 |
+
CSI ์ ์์ ์์๊ฐ
|
| 50 |
+
"""
|
| 51 |
+
pred = np.argmax(pred_prob, axis=1)
|
| 52 |
+
csi = calculate_csi(y_true, pred)
|
| 53 |
+
return -1*csi
|
| 54 |
+
|
| 55 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 56 |
+
"""
|
| 57 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 58 |
+
|
| 59 |
+
Args:
|
| 60 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 61 |
+
|
| 62 |
+
Returns:
|
| 63 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 64 |
+
"""
|
| 65 |
+
df = df.copy()
|
| 66 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 67 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 68 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 69 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 70 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 71 |
+
return df
|
| 72 |
+
|
| 73 |
+
def preprocessing(df):
|
| 74 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 78 |
+
|
| 79 |
+
Returns:
|
| 80 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 81 |
+
"""
|
| 82 |
+
df = df[df.columns].copy()
|
| 83 |
+
df['year'] = df['year'].astype('int')
|
| 84 |
+
df['month'] = df['month'].astype('int')
|
| 85 |
+
df['hour'] = df['hour'].astype('int')
|
| 86 |
+
df = add_derived_features(df).copy()
|
| 87 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 88 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 89 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 90 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 91 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 92 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 93 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 94 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 95 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 96 |
+
return df
|
| 97 |
+
|
| 98 |
+
def create_xgb_model(search_space=None, best_params=None):
|
| 99 |
+
"""XGBoost ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 100 |
+
|
| 101 |
+
Args:
|
| 102 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 103 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 104 |
+
|
| 105 |
+
Returns:
|
| 106 |
+
XGBClassifier ์ธ์คํด์ค
|
| 107 |
+
"""
|
| 108 |
+
base_params = {
|
| 109 |
+
'n_estimators': N_ESTIMATORS,
|
| 110 |
+
'tree_method': 'hist',
|
| 111 |
+
'device': 'cuda',
|
| 112 |
+
'enable_categorical': True,
|
| 113 |
+
'eval_metric': eval_metric_csi,
|
| 114 |
+
'objective': 'multi:softprob',
|
| 115 |
+
'random_state': RANDOM_STATE,
|
| 116 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if search_space is not None:
|
| 120 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 121 |
+
params = {
|
| 122 |
+
**base_params,
|
| 123 |
+
'learning_rate': search_space['learning_rate'],
|
| 124 |
+
'max_depth': int(search_space['max_depth']),
|
| 125 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 126 |
+
'gamma': search_space['gamma'],
|
| 127 |
+
'subsample': search_space['subsample'],
|
| 128 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 129 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 130 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 131 |
+
}
|
| 132 |
+
elif best_params is not None:
|
| 133 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 134 |
+
params = {
|
| 135 |
+
**base_params,
|
| 136 |
+
'learning_rate': best_params['learning_rate'],
|
| 137 |
+
'max_depth': int(best_params['max_depth']),
|
| 138 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 139 |
+
'gamma': best_params['gamma'],
|
| 140 |
+
'subsample': best_params['subsample'],
|
| 141 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 142 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 143 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 144 |
+
}
|
| 145 |
+
else:
|
| 146 |
+
params = base_params
|
| 147 |
+
|
| 148 |
+
return XGBClassifier(**params)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ ๋ฐ ์ ์ฒ๋ฆฌ
|
| 152 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 153 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 154 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 155 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 156 |
+
df_daejeon = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/daejeon_train.csv"))
|
| 157 |
+
df_ctgan_daejeon_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_daejeon.csv"))
|
| 158 |
+
df_ctgan_daejeon_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_daejeon.csv"))
|
| 159 |
+
df_ctgan_daejeon_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_daejeon.csv"))
|
| 160 |
+
|
| 161 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 162 |
+
df_ctgan_daejeon_1 = preprocessing(df_ctgan_daejeon_1)
|
| 163 |
+
df_ctgan_daejeon_2 = preprocessing(df_ctgan_daejeon_2)
|
| 164 |
+
df_ctgan_daejeon_3 = preprocessing(df_ctgan_daejeon_3)
|
| 165 |
+
df_daejeon = preprocessing(df_daejeon)
|
| 166 |
+
|
| 167 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 168 |
+
df_ctgan_list = [df_ctgan_daejeon_1, df_ctgan_daejeon_2, df_ctgan_daejeon_3]
|
| 169 |
+
|
| 170 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 171 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 172 |
+
|
| 173 |
+
Args:
|
| 174 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 175 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 176 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 177 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 178 |
+
|
| 179 |
+
Returns:
|
| 180 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 181 |
+
"""
|
| 182 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 183 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 184 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 185 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 186 |
+
|
| 187 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 188 |
+
val_mask = df_original['year'] == val_year
|
| 189 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 190 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 191 |
+
|
| 192 |
+
X_train.drop(columns=['year'], inplace=True)
|
| 193 |
+
X_val.drop(columns=['year'], inplace=True)
|
| 194 |
+
|
| 195 |
+
return X_train, X_val, y_train, y_val
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 199 |
+
xgb_search_space = {
|
| 200 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 201 |
+
'max_depth': hp.quniform('max_depth', 3, 12, 1),
|
| 202 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 203 |
+
'gamma': hp.uniform('gamma', 0, 5), # ํธ๋ฆฌ ๋ถํ ์ ์ํ ์ต์ ์์ค ๊ฐ์ ๊ฐ
|
| 204 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 205 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 206 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 207 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
def objective_func(search_space):
|
| 211 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 212 |
+
|
| 213 |
+
Args:
|
| 214 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 215 |
+
|
| 216 |
+
Returns:
|
| 217 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 218 |
+
"""
|
| 219 |
+
xgb_model = create_xgb_model(search_space=search_space)
|
| 220 |
+
csi_scores = []
|
| 221 |
+
|
| 222 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 223 |
+
for df_sampled, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 224 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 225 |
+
df_sampled, df_daejeon, train_years, val_year
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 229 |
+
csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 230 |
+
csi_scores.append(csi)
|
| 231 |
+
|
| 232 |
+
return -1*round(np.mean(csi_scores), 4)
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 236 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 237 |
+
trials = Trials()
|
| 238 |
+
xgb_best = fmin(
|
| 239 |
+
fn=objective_func,
|
| 240 |
+
space=xgb_search_space,
|
| 241 |
+
algo=tpe.suggest,
|
| 242 |
+
max_evals=MAX_EVALS,
|
| 243 |
+
trials=trials
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 247 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {xgb_best}")
|
| 248 |
+
|
| 249 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 250 |
+
best_loss = trials.best_trial['result']['loss']
|
| 251 |
+
best_csi = -best_loss
|
| 252 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 253 |
+
|
| 254 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 255 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 256 |
+
csi_scores = [-loss for loss in losses]
|
| 257 |
+
|
| 258 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 259 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 260 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 261 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 262 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 263 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 264 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 265 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 266 |
+
|
| 267 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 268 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 269 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 270 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 271 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 272 |
+
trials_path = os.path.join(base_dir, "optimization_history/xgb_ctgan10000_daejeon_trials.pkl")
|
| 273 |
+
joblib.dump(trials, trials_path)
|
| 274 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 275 |
+
|
| 276 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 277 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 278 |
+
models = []
|
| 279 |
+
|
| 280 |
+
for fold_idx, (df_sampled, (train_years, val_year)) in enumerate(
|
| 281 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 282 |
+
):
|
| 283 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 284 |
+
|
| 285 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 286 |
+
df_sampled, df_daejeon, train_years, val_year
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
xgb_model = create_xgb_model(best_params=xgb_best)
|
| 290 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 291 |
+
|
| 292 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 293 |
+
val_csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 294 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 295 |
+
|
| 296 |
+
models.append(xgb_model)
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 300 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 301 |
+
os.makedirs(os.path.join(base_dir, "save_model/xgb_optima"), exist_ok=True)
|
| 302 |
+
model_save_path = os.path.join(base_dir, "save_model/xgb_optima/xgb_ctgan10000_daejeon.pkl")
|
| 303 |
+
joblib.dump(models, model_save_path)
|
| 304 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 305 |
+
|
Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_gwangju.py
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import os
|
| 3 |
+
import numpy as np
|
| 4 |
+
import joblib
|
| 5 |
+
from xgboost import XGBClassifier
|
| 6 |
+
from warnings import filterwarnings
|
| 7 |
+
filterwarnings('ignore')
|
| 8 |
+
from sklearn.metrics import confusion_matrix
|
| 9 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 10 |
+
|
| 11 |
+
# ์์ ์ ์
|
| 12 |
+
RANDOM_STATE = 42
|
| 13 |
+
N_ESTIMATORS = 4000
|
| 14 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 15 |
+
MAX_EVALS = 100
|
| 16 |
+
|
| 17 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 18 |
+
FOLD_CONFIGS = [
|
| 19 |
+
([2018, 2019], 2020), # Fold 1
|
| 20 |
+
([2018, 2020], 2019), # Fold 2
|
| 21 |
+
([2019, 2020], 2018), # Fold 3
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
def calculate_csi(Y_test, pred):
|
| 25 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 26 |
+
|
| 27 |
+
Args:
|
| 28 |
+
Y_test: ์ค์ ๋ ์ด๋ธ
|
| 29 |
+
pred: ์์ธก ๋ ์ด๋ธ
|
| 30 |
+
|
| 31 |
+
Returns:
|
| 32 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 33 |
+
"""
|
| 34 |
+
cm = confusion_matrix(Y_test, pred)
|
| 35 |
+
H = (cm[0, 0] + cm[1, 1])
|
| 36 |
+
F = (cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1])
|
| 37 |
+
M = (cm[0, 2] + cm[1, 2])
|
| 38 |
+
CSI = H / (H + F + M + 1e-10)
|
| 39 |
+
return CSI
|
| 40 |
+
|
| 41 |
+
def eval_metric_csi(y_true, pred_prob):
|
| 42 |
+
"""XGBoost์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 43 |
+
|
| 44 |
+
Args:
|
| 45 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 46 |
+
pred_prob: ์์ธก ํ๋ฅ
|
| 47 |
+
|
| 48 |
+
Returns:
|
| 49 |
+
CSI ์ ์์ ์์๊ฐ
|
| 50 |
+
"""
|
| 51 |
+
pred = np.argmax(pred_prob, axis=1)
|
| 52 |
+
csi = calculate_csi(y_true, pred)
|
| 53 |
+
return -1*csi
|
| 54 |
+
|
| 55 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 56 |
+
"""
|
| 57 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 58 |
+
|
| 59 |
+
Args:
|
| 60 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 61 |
+
|
| 62 |
+
Returns:
|
| 63 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 64 |
+
"""
|
| 65 |
+
df = df.copy()
|
| 66 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 67 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 68 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 69 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 70 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 71 |
+
return df
|
| 72 |
+
|
| 73 |
+
def preprocessing(df):
|
| 74 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 78 |
+
|
| 79 |
+
Returns:
|
| 80 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 81 |
+
"""
|
| 82 |
+
df = df[df.columns].copy()
|
| 83 |
+
df['year'] = df['year'].astype('int')
|
| 84 |
+
df['month'] = df['month'].astype('int')
|
| 85 |
+
df['hour'] = df['hour'].astype('int')
|
| 86 |
+
df = add_derived_features(df).copy()
|
| 87 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 88 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 89 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 90 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 91 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 92 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 93 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 94 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 95 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 96 |
+
return df
|
| 97 |
+
|
| 98 |
+
def create_xgb_model(search_space=None, best_params=None):
|
| 99 |
+
"""XGBoost ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 100 |
+
|
| 101 |
+
Args:
|
| 102 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 103 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 104 |
+
|
| 105 |
+
Returns:
|
| 106 |
+
XGBClassifier ์ธ์คํด์ค
|
| 107 |
+
"""
|
| 108 |
+
base_params = {
|
| 109 |
+
'n_estimators': N_ESTIMATORS,
|
| 110 |
+
'tree_method': 'hist',
|
| 111 |
+
'device': 'cuda',
|
| 112 |
+
'enable_categorical': True,
|
| 113 |
+
'eval_metric': eval_metric_csi,
|
| 114 |
+
'objective': 'multi:softprob',
|
| 115 |
+
'random_state': RANDOM_STATE,
|
| 116 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if search_space is not None:
|
| 120 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 121 |
+
params = {
|
| 122 |
+
**base_params,
|
| 123 |
+
'learning_rate': search_space['learning_rate'],
|
| 124 |
+
'max_depth': int(search_space['max_depth']),
|
| 125 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 126 |
+
'gamma': search_space['gamma'],
|
| 127 |
+
'subsample': search_space['subsample'],
|
| 128 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 129 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 130 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 131 |
+
}
|
| 132 |
+
elif best_params is not None:
|
| 133 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 134 |
+
params = {
|
| 135 |
+
**base_params,
|
| 136 |
+
'learning_rate': best_params['learning_rate'],
|
| 137 |
+
'max_depth': int(best_params['max_depth']),
|
| 138 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 139 |
+
'gamma': best_params['gamma'],
|
| 140 |
+
'subsample': best_params['subsample'],
|
| 141 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 142 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 143 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 144 |
+
}
|
| 145 |
+
else:
|
| 146 |
+
params = base_params
|
| 147 |
+
|
| 148 |
+
return XGBClassifier(**params)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ ๋ฐ ์ ์ฒ๋ฆฌ
|
| 152 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 153 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 154 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 155 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 156 |
+
df_gwangju = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/gwangju_train.csv"))
|
| 157 |
+
df_ctgan_gwangju_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_gwangju.csv"))
|
| 158 |
+
df_ctgan_gwangju_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_gwangju.csv"))
|
| 159 |
+
df_ctgan_gwangju_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_gwangju.csv"))
|
| 160 |
+
|
| 161 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 162 |
+
df_ctgan_gwangju_1 = preprocessing(df_ctgan_gwangju_1)
|
| 163 |
+
df_ctgan_gwangju_2 = preprocessing(df_ctgan_gwangju_2)
|
| 164 |
+
df_ctgan_gwangju_3 = preprocessing(df_ctgan_gwangju_3)
|
| 165 |
+
df_gwangju = preprocessing(df_gwangju)
|
| 166 |
+
|
| 167 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 168 |
+
df_ctgan_list = [df_ctgan_gwangju_1, df_ctgan_gwangju_2, df_ctgan_gwangju_3]
|
| 169 |
+
|
| 170 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 171 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 172 |
+
|
| 173 |
+
Args:
|
| 174 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 175 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 176 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 177 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 178 |
+
|
| 179 |
+
Returns:
|
| 180 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 181 |
+
"""
|
| 182 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 183 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 184 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 185 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 186 |
+
|
| 187 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 188 |
+
val_mask = df_original['year'] == val_year
|
| 189 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 190 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 191 |
+
|
| 192 |
+
X_train.drop(columns=['year'], inplace=True)
|
| 193 |
+
X_val.drop(columns=['year'], inplace=True)
|
| 194 |
+
|
| 195 |
+
return X_train, X_val, y_train, y_val
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 199 |
+
xgb_search_space = {
|
| 200 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 201 |
+
'max_depth': hp.quniform('max_depth', 3, 12, 1),
|
| 202 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 203 |
+
'gamma': hp.uniform('gamma', 0, 5), # ํธ๋ฆฌ ๋ถํ ์ ์ํ ์ต์ ์์ค ๊ฐ์ ๊ฐ
|
| 204 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 205 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 206 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 207 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
def objective_func(search_space):
|
| 211 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 212 |
+
|
| 213 |
+
Args:
|
| 214 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 215 |
+
|
| 216 |
+
Returns:
|
| 217 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 218 |
+
"""
|
| 219 |
+
xgb_model = create_xgb_model(search_space=search_space)
|
| 220 |
+
csi_scores = []
|
| 221 |
+
|
| 222 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 223 |
+
for df_sampled, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 224 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 225 |
+
df_sampled, df_gwangju, train_years, val_year
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 229 |
+
csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 230 |
+
csi_scores.append(csi)
|
| 231 |
+
|
| 232 |
+
return -1*round(np.mean(csi_scores), 4)
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 236 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 237 |
+
trials = Trials()
|
| 238 |
+
xgb_best = fmin(
|
| 239 |
+
fn=objective_func,
|
| 240 |
+
space=xgb_search_space,
|
| 241 |
+
algo=tpe.suggest,
|
| 242 |
+
max_evals=MAX_EVALS,
|
| 243 |
+
trials=trials
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 247 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {xgb_best}")
|
| 248 |
+
|
| 249 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 250 |
+
best_loss = trials.best_trial['result']['loss']
|
| 251 |
+
best_csi = -best_loss
|
| 252 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 253 |
+
|
| 254 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 255 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 256 |
+
csi_scores = [-loss for loss in losses]
|
| 257 |
+
|
| 258 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 259 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 260 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 261 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 262 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 263 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 264 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 265 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 266 |
+
|
| 267 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 268 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 269 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 270 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 271 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 272 |
+
trials_path = os.path.join(base_dir, "optimization_history/xgb_ctgan10000_gwangju_trials.pkl")
|
| 273 |
+
joblib.dump(trials, trials_path)
|
| 274 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 275 |
+
|
| 276 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 277 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 278 |
+
models = []
|
| 279 |
+
|
| 280 |
+
for fold_idx, (df_sampled, (train_years, val_year)) in enumerate(
|
| 281 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 282 |
+
):
|
| 283 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 284 |
+
|
| 285 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 286 |
+
df_sampled, df_gwangju, train_years, val_year
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
xgb_model = create_xgb_model(best_params=xgb_best)
|
| 290 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 291 |
+
|
| 292 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 293 |
+
val_csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 294 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 295 |
+
|
| 296 |
+
models.append(xgb_model)
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 300 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 301 |
+
os.makedirs(os.path.join(base_dir, "save_model/xgb_optima"), exist_ok=True)
|
| 302 |
+
model_save_path = os.path.join(base_dir, "save_model/xgb_optima/xgb_ctgan10000_gwangju.pkl")
|
| 303 |
+
joblib.dump(models, model_save_path)
|
| 304 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 305 |
+
|
Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_incheon.py
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import os
|
| 3 |
+
import numpy as np
|
| 4 |
+
import joblib
|
| 5 |
+
from xgboost import XGBClassifier
|
| 6 |
+
from warnings import filterwarnings
|
| 7 |
+
filterwarnings('ignore')
|
| 8 |
+
from sklearn.metrics import confusion_matrix
|
| 9 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 10 |
+
|
| 11 |
+
# ์์ ์ ์
|
| 12 |
+
RANDOM_STATE = 42
|
| 13 |
+
N_ESTIMATORS = 4000
|
| 14 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 15 |
+
MAX_EVALS = 100
|
| 16 |
+
|
| 17 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 18 |
+
FOLD_CONFIGS = [
|
| 19 |
+
([2018, 2019], 2020), # Fold 1
|
| 20 |
+
([2018, 2020], 2019), # Fold 2
|
| 21 |
+
([2019, 2020], 2018), # Fold 3
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
def calculate_csi(Y_test, pred):
|
| 25 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 26 |
+
|
| 27 |
+
Args:
|
| 28 |
+
Y_test: ์ค์ ๋ ์ด๋ธ
|
| 29 |
+
pred: ์์ธก ๋ ์ด๋ธ
|
| 30 |
+
|
| 31 |
+
Returns:
|
| 32 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 33 |
+
"""
|
| 34 |
+
cm = confusion_matrix(Y_test, pred)
|
| 35 |
+
H = (cm[0, 0] + cm[1, 1])
|
| 36 |
+
F = (cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1])
|
| 37 |
+
M = (cm[0, 2] + cm[1, 2])
|
| 38 |
+
CSI = H / (H + F + M + 1e-10)
|
| 39 |
+
return CSI
|
| 40 |
+
|
| 41 |
+
def eval_metric_csi(y_true, pred_prob):
|
| 42 |
+
"""XGBoost์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 43 |
+
|
| 44 |
+
Args:
|
| 45 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 46 |
+
pred_prob: ์์ธก ํ๋ฅ
|
| 47 |
+
|
| 48 |
+
Returns:
|
| 49 |
+
CSI ์ ์์ ์์๊ฐ
|
| 50 |
+
"""
|
| 51 |
+
pred = np.argmax(pred_prob, axis=1)
|
| 52 |
+
csi = calculate_csi(y_true, pred)
|
| 53 |
+
return -1*csi
|
| 54 |
+
|
| 55 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 56 |
+
"""
|
| 57 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 58 |
+
|
| 59 |
+
Args:
|
| 60 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 61 |
+
|
| 62 |
+
Returns:
|
| 63 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 64 |
+
"""
|
| 65 |
+
df = df.copy()
|
| 66 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 67 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 68 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 69 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 70 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 71 |
+
return df
|
| 72 |
+
|
| 73 |
+
def preprocessing(df):
|
| 74 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 78 |
+
|
| 79 |
+
Returns:
|
| 80 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 81 |
+
"""
|
| 82 |
+
df = df[df.columns].copy()
|
| 83 |
+
df['year'] = df['year'].astype('int')
|
| 84 |
+
df['month'] = df['month'].astype('int')
|
| 85 |
+
df['hour'] = df['hour'].astype('int')
|
| 86 |
+
df = add_derived_features(df).copy()
|
| 87 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 88 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 89 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 90 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 91 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 92 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 93 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 94 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 95 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 96 |
+
return df
|
| 97 |
+
|
| 98 |
+
def create_xgb_model(search_space=None, best_params=None):
|
| 99 |
+
"""XGBoost ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 100 |
+
|
| 101 |
+
Args:
|
| 102 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 103 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 104 |
+
|
| 105 |
+
Returns:
|
| 106 |
+
XGBClassifier ์ธ์คํด์ค
|
| 107 |
+
"""
|
| 108 |
+
base_params = {
|
| 109 |
+
'n_estimators': N_ESTIMATORS,
|
| 110 |
+
'tree_method': 'hist',
|
| 111 |
+
'device': 'cuda',
|
| 112 |
+
'enable_categorical': True,
|
| 113 |
+
'eval_metric': eval_metric_csi,
|
| 114 |
+
'objective': 'multi:softprob',
|
| 115 |
+
'random_state': RANDOM_STATE,
|
| 116 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if search_space is not None:
|
| 120 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 121 |
+
params = {
|
| 122 |
+
**base_params,
|
| 123 |
+
'learning_rate': search_space['learning_rate'],
|
| 124 |
+
'max_depth': int(search_space['max_depth']),
|
| 125 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 126 |
+
'gamma': search_space['gamma'],
|
| 127 |
+
'subsample': search_space['subsample'],
|
| 128 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 129 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 130 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 131 |
+
}
|
| 132 |
+
elif best_params is not None:
|
| 133 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 134 |
+
params = {
|
| 135 |
+
**base_params,
|
| 136 |
+
'learning_rate': best_params['learning_rate'],
|
| 137 |
+
'max_depth': int(best_params['max_depth']),
|
| 138 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 139 |
+
'gamma': best_params['gamma'],
|
| 140 |
+
'subsample': best_params['subsample'],
|
| 141 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 142 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 143 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 144 |
+
}
|
| 145 |
+
else:
|
| 146 |
+
params = base_params
|
| 147 |
+
|
| 148 |
+
return XGBClassifier(**params)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ ๋ฐ ์ ์ฒ๋ฆฌ
|
| 152 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 153 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 154 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 155 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 156 |
+
df_incheon = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/incheon_train.csv"))
|
| 157 |
+
df_ctgan_incheon_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_incheon.csv"))
|
| 158 |
+
df_ctgan_incheon_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_incheon.csv"))
|
| 159 |
+
df_ctgan_incheon_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_incheon.csv"))
|
| 160 |
+
|
| 161 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 162 |
+
df_ctgan_incheon_1 = preprocessing(df_ctgan_incheon_1)
|
| 163 |
+
df_ctgan_incheon_2 = preprocessing(df_ctgan_incheon_2)
|
| 164 |
+
df_ctgan_incheon_3 = preprocessing(df_ctgan_incheon_3)
|
| 165 |
+
df_incheon = preprocessing(df_incheon)
|
| 166 |
+
|
| 167 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 168 |
+
df_ctgan_list = [df_ctgan_incheon_1, df_ctgan_incheon_2, df_ctgan_incheon_3]
|
| 169 |
+
|
| 170 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 171 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 172 |
+
|
| 173 |
+
Args:
|
| 174 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 175 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 176 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 177 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 178 |
+
|
| 179 |
+
Returns:
|
| 180 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 181 |
+
"""
|
| 182 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 183 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 184 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 185 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 186 |
+
|
| 187 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 188 |
+
val_mask = df_original['year'] == val_year
|
| 189 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 190 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 191 |
+
|
| 192 |
+
X_train.drop(columns=['year'], inplace=True)
|
| 193 |
+
X_val.drop(columns=['year'], inplace=True)
|
| 194 |
+
|
| 195 |
+
return X_train, X_val, y_train, y_val
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 199 |
+
xgb_search_space = {
|
| 200 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 201 |
+
'max_depth': hp.quniform('max_depth', 3, 12, 1),
|
| 202 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 203 |
+
'gamma': hp.uniform('gamma', 0, 5), # ํธ๋ฆฌ ๋ถํ ์ ์ํ ์ต์ ์์ค ๊ฐ์ ๊ฐ
|
| 204 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 205 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 206 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 207 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
def objective_func(search_space):
|
| 211 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 212 |
+
|
| 213 |
+
Args:
|
| 214 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 215 |
+
|
| 216 |
+
Returns:
|
| 217 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 218 |
+
"""
|
| 219 |
+
xgb_model = create_xgb_model(search_space=search_space)
|
| 220 |
+
csi_scores = []
|
| 221 |
+
|
| 222 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 223 |
+
for df_sampled, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 224 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 225 |
+
df_sampled, df_incheon, train_years, val_year
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 229 |
+
csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 230 |
+
csi_scores.append(csi)
|
| 231 |
+
|
| 232 |
+
return -1*round(np.mean(csi_scores), 4)
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 236 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 237 |
+
trials = Trials()
|
| 238 |
+
xgb_best = fmin(
|
| 239 |
+
fn=objective_func,
|
| 240 |
+
space=xgb_search_space,
|
| 241 |
+
algo=tpe.suggest,
|
| 242 |
+
max_evals=MAX_EVALS,
|
| 243 |
+
trials=trials
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 247 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {xgb_best}")
|
| 248 |
+
|
| 249 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 250 |
+
best_loss = trials.best_trial['result']['loss']
|
| 251 |
+
best_csi = -best_loss
|
| 252 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 253 |
+
|
| 254 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 255 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 256 |
+
csi_scores = [-loss for loss in losses]
|
| 257 |
+
|
| 258 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 259 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 260 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 261 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 262 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 263 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 264 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 265 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 266 |
+
|
| 267 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 268 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 269 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 270 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 271 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 272 |
+
trials_path = os.path.join(base_dir, "optimization_history/xgb_ctgan10000_incheon_trials.pkl")
|
| 273 |
+
joblib.dump(trials, trials_path)
|
| 274 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 275 |
+
|
| 276 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 277 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 278 |
+
models = []
|
| 279 |
+
|
| 280 |
+
for fold_idx, (df_sampled, (train_years, val_year)) in enumerate(
|
| 281 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 282 |
+
):
|
| 283 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 284 |
+
|
| 285 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 286 |
+
df_sampled, df_incheon, train_years, val_year
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
xgb_model = create_xgb_model(best_params=xgb_best)
|
| 290 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 291 |
+
|
| 292 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 293 |
+
val_csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 294 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 295 |
+
|
| 296 |
+
models.append(xgb_model)
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 300 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 301 |
+
os.makedirs(os.path.join(base_dir, "save_model/xgb_optima"), exist_ok=True)
|
| 302 |
+
model_save_path = os.path.join(base_dir, "save_model/xgb_optima/xgb_ctgan10000_incheon.pkl")
|
| 303 |
+
joblib.dump(models, model_save_path)
|
| 304 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 305 |
+
|
Analysis_code/5.optima/xgb_ctgan10000/XGB_ctgan10000_seoul.py
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import os
|
| 3 |
+
import numpy as np
|
| 4 |
+
import joblib
|
| 5 |
+
from xgboost import XGBClassifier
|
| 6 |
+
from warnings import filterwarnings
|
| 7 |
+
filterwarnings('ignore')
|
| 8 |
+
from sklearn.metrics import confusion_matrix
|
| 9 |
+
from hyperopt import fmin, tpe, Trials, hp
|
| 10 |
+
|
| 11 |
+
# ์์ ์ ์
|
| 12 |
+
RANDOM_STATE = 42
|
| 13 |
+
N_ESTIMATORS = 4000
|
| 14 |
+
EARLY_STOPPING_ROUNDS = 400
|
| 15 |
+
MAX_EVALS = 100
|
| 16 |
+
|
| 17 |
+
# Fold ์ค์ : (train_years, val_year)
|
| 18 |
+
FOLD_CONFIGS = [
|
| 19 |
+
([2018, 2019], 2020), # Fold 1
|
| 20 |
+
([2018, 2020], 2019), # Fold 2
|
| 21 |
+
([2019, 2020], 2018), # Fold 3
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
def calculate_csi(Y_test, pred):
|
| 25 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 26 |
+
|
| 27 |
+
Args:
|
| 28 |
+
Y_test: ์ค์ ๋ ์ด๋ธ
|
| 29 |
+
pred: ์์ธก ๋ ์ด๋ธ
|
| 30 |
+
|
| 31 |
+
Returns:
|
| 32 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 33 |
+
"""
|
| 34 |
+
cm = confusion_matrix(Y_test, pred)
|
| 35 |
+
H = (cm[0, 0] + cm[1, 1])
|
| 36 |
+
F = (cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1])
|
| 37 |
+
M = (cm[0, 2] + cm[1, 2])
|
| 38 |
+
CSI = H / (H + F + M + 1e-10)
|
| 39 |
+
return CSI
|
| 40 |
+
|
| 41 |
+
def eval_metric_csi(y_true, pred_prob):
|
| 42 |
+
"""XGBoost์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 43 |
+
|
| 44 |
+
Args:
|
| 45 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 46 |
+
pred_prob: ์์ธก ํ๋ฅ
|
| 47 |
+
|
| 48 |
+
Returns:
|
| 49 |
+
CSI ์ ์์ ์์๊ฐ
|
| 50 |
+
"""
|
| 51 |
+
pred = np.argmax(pred_prob, axis=1)
|
| 52 |
+
csi = calculate_csi(y_true, pred)
|
| 53 |
+
return -1*csi
|
| 54 |
+
|
| 55 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 56 |
+
"""
|
| 57 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 58 |
+
|
| 59 |
+
Args:
|
| 60 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 61 |
+
|
| 62 |
+
Returns:
|
| 63 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 64 |
+
"""
|
| 65 |
+
df = df.copy()
|
| 66 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 67 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 68 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 69 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 70 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 71 |
+
return df
|
| 72 |
+
|
| 73 |
+
def preprocessing(df):
|
| 74 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 78 |
+
|
| 79 |
+
Returns:
|
| 80 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 81 |
+
"""
|
| 82 |
+
df = df[df.columns].copy()
|
| 83 |
+
df['year'] = df['year'].astype('int')
|
| 84 |
+
df['month'] = df['month'].astype('int')
|
| 85 |
+
df['hour'] = df['hour'].astype('int')
|
| 86 |
+
df = add_derived_features(df).copy()
|
| 87 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 88 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 89 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 90 |
+
df = df[['temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 91 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 92 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 93 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 94 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 95 |
+
'month_sin', 'month_cos','multi_class']].copy()
|
| 96 |
+
return df
|
| 97 |
+
|
| 98 |
+
def create_xgb_model(search_space=None, best_params=None):
|
| 99 |
+
"""XGBoost ๋ชจ๋ธ์ ์์ฑํฉ๋๋ค.
|
| 100 |
+
|
| 101 |
+
Args:
|
| 102 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ (objective_func์์ ์ฌ์ฉ)
|
| 103 |
+
best_params: ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ (์ต์ข
๋ชจ๋ธ ํ์ต์์ ์ฌ์ฉ)
|
| 104 |
+
|
| 105 |
+
Returns:
|
| 106 |
+
XGBClassifier ์ธ์คํด์ค
|
| 107 |
+
"""
|
| 108 |
+
base_params = {
|
| 109 |
+
'n_estimators': N_ESTIMATORS,
|
| 110 |
+
'tree_method': 'hist',
|
| 111 |
+
'device': 'cuda',
|
| 112 |
+
'enable_categorical': True,
|
| 113 |
+
'eval_metric': eval_metric_csi,
|
| 114 |
+
'objective': 'multi:softprob',
|
| 115 |
+
'random_state': RANDOM_STATE,
|
| 116 |
+
'early_stopping_rounds': EARLY_STOPPING_ROUNDS,
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if search_space is not None:
|
| 120 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์ค
|
| 121 |
+
params = {
|
| 122 |
+
**base_params,
|
| 123 |
+
'learning_rate': search_space['learning_rate'],
|
| 124 |
+
'max_depth': int(search_space['max_depth']),
|
| 125 |
+
'min_child_weight': int(search_space['min_child_weight']),
|
| 126 |
+
'gamma': search_space['gamma'],
|
| 127 |
+
'subsample': search_space['subsample'],
|
| 128 |
+
'colsample_bytree': search_space['colsample_bytree'],
|
| 129 |
+
'reg_alpha': search_space['reg_alpha'],
|
| 130 |
+
'reg_lambda': search_space['reg_lambda'],
|
| 131 |
+
}
|
| 132 |
+
elif best_params is not None:
|
| 133 |
+
# ์ต์ ํ๋ ํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ์์ฑ
|
| 134 |
+
params = {
|
| 135 |
+
**base_params,
|
| 136 |
+
'learning_rate': best_params['learning_rate'],
|
| 137 |
+
'max_depth': int(best_params['max_depth']),
|
| 138 |
+
'min_child_weight': int(best_params['min_child_weight']),
|
| 139 |
+
'gamma': best_params['gamma'],
|
| 140 |
+
'subsample': best_params['subsample'],
|
| 141 |
+
'colsample_bytree': best_params['colsample_bytree'],
|
| 142 |
+
'reg_alpha': best_params['reg_alpha'],
|
| 143 |
+
'reg_lambda': best_params['reg_lambda'],
|
| 144 |
+
}
|
| 145 |
+
else:
|
| 146 |
+
params = base_params
|
| 147 |
+
|
| 148 |
+
return XGBClassifier(**params)
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
# ๋ฐ์ดํฐ ๋ก๋ฉ ๋ฐ ์ ์ฒ๋ฆฌ
|
| 152 |
+
print("๋ฐ์ดํฐ ๋ก๋ฉ ์ค...")
|
| 153 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 154 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 155 |
+
data_base_dir = os.path.abspath(os.path.join(current_file_dir, '../../../data'))
|
| 156 |
+
df_seoul = pd.read_csv(os.path.join(data_base_dir, "data_for_modeling/seoul_train.csv"))
|
| 157 |
+
df_ctgan_seoul_1 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_1_seoul.csv"))
|
| 158 |
+
df_ctgan_seoul_2 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_2_seoul.csv"))
|
| 159 |
+
df_ctgan_seoul_3 = pd.read_csv(os.path.join(data_base_dir, "data_oversampled/ctgan10000/ctgan10000_3_seoul.csv"))
|
| 160 |
+
|
| 161 |
+
print("๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ค...")
|
| 162 |
+
df_ctgan_seoul_1 = preprocessing(df_ctgan_seoul_1)
|
| 163 |
+
df_ctgan_seoul_2 = preprocessing(df_ctgan_seoul_2)
|
| 164 |
+
df_ctgan_seoul_3 = preprocessing(df_ctgan_seoul_3)
|
| 165 |
+
df_seoul = preprocessing(df_seoul)
|
| 166 |
+
|
| 167 |
+
# CTGAN ๋ฐ์ดํฐ ๋ฆฌ์คํธ (fold ์์์ ์ผ์น)
|
| 168 |
+
df_ctgan_list = [df_ctgan_seoul_1, df_ctgan_seoul_2, df_ctgan_seoul_3]
|
| 169 |
+
|
| 170 |
+
def split_data(df_sampled, df_original, train_years, val_year):
|
| 171 |
+
"""๋ฐ์ดํฐ๋ฅผ ํ์ต์ฉ๊ณผ ๊ฒ์ฆ์ฉ์ผ๋ก ๋ถํ ํฉ๋๋ค.
|
| 172 |
+
|
| 173 |
+
Args:
|
| 174 |
+
df_sampled: ์ํ๋ง๋ ๋ฐ์ดํฐํ๋ ์
|
| 175 |
+
df_original: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 176 |
+
train_years: ํ์ต์ ์ฌ์ฉํ ์ฐ๋ ๋ฆฌ์คํธ
|
| 177 |
+
val_year: ๊ฒ์ฆ์ ์ฌ์ฉํ ์ฐ๋
|
| 178 |
+
|
| 179 |
+
Returns:
|
| 180 |
+
(X_train, X_val, y_train, y_val) ํํ
|
| 181 |
+
"""
|
| 182 |
+
# ํ์ต ๋ฐ์ดํฐ: ์ํ๋ง๋ ๋ฐ์ดํฐ์์ train_years์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 183 |
+
train_mask = df_sampled['year'].isin(train_years)
|
| 184 |
+
X_train = df_sampled.loc[train_mask, df_sampled.columns != 'multi_class'].copy()
|
| 185 |
+
y_train = df_sampled.loc[train_mask, 'multi_class']
|
| 186 |
+
|
| 187 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ: ์๋ณธ ๋ฐ์ดํฐ์์ val_year์ ํด๋นํ๋ ๋ฐ์ดํฐ
|
| 188 |
+
val_mask = df_original['year'] == val_year
|
| 189 |
+
X_val = df_original.loc[val_mask, df_original.columns != 'multi_class'].copy()
|
| 190 |
+
y_val = df_original.loc[val_mask, 'multi_class']
|
| 191 |
+
|
| 192 |
+
X_train.drop(columns=['year'], inplace=True)
|
| 193 |
+
X_val.drop(columns=['year'], inplace=True)
|
| 194 |
+
|
| 195 |
+
return X_train, X_val, y_train, y_val
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ ์ ์
|
| 199 |
+
xgb_search_space = {
|
| 200 |
+
'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
|
| 201 |
+
'max_depth': hp.quniform('max_depth', 3, 12, 1),
|
| 202 |
+
'min_child_weight': hp.quniform('min_child_weight', 1, 20, 1),
|
| 203 |
+
'gamma': hp.uniform('gamma', 0, 5), # ํธ๋ฆฌ ๋ถํ ์ ์ํ ์ต์ ์์ค ๊ฐ์ ๊ฐ
|
| 204 |
+
'subsample': hp.uniform('subsample', 0.6, 1.0),
|
| 205 |
+
'colsample_bytree': hp.uniform('colsample_bytree', 0.6, 1.0),
|
| 206 |
+
'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
|
| 207 |
+
'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0)
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
def objective_func(search_space):
|
| 211 |
+
"""ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ๋ฅผ ์ํ ๋ชฉ์ ํจ์.
|
| 212 |
+
|
| 213 |
+
Args:
|
| 214 |
+
search_space: ํ์ดํผํ๋ผ๋ฏธํฐ ๊ฒ์ ๊ณต๊ฐ
|
| 215 |
+
|
| 216 |
+
Returns:
|
| 217 |
+
ํ๊ท CSI ์ ์์ ์์๊ฐ (hyperopt๋ ์ต์ํ๋ฅผ ์ํํ๋ฏ๋ก)
|
| 218 |
+
"""
|
| 219 |
+
xgb_model = create_xgb_model(search_space=search_space)
|
| 220 |
+
csi_scores = []
|
| 221 |
+
|
| 222 |
+
# ๊ฐ fold์ ๋ํด ๊ต์ฐจ ๊ฒ์ฆ ์ํ
|
| 223 |
+
for df_sampled, (train_years, val_year) in zip(df_ctgan_list, FOLD_CONFIGS):
|
| 224 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 225 |
+
df_sampled, df_seoul, train_years, val_year
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 229 |
+
csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 230 |
+
csi_scores.append(csi)
|
| 231 |
+
|
| 232 |
+
return -1*round(np.mean(csi_scores), 4)
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
# ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ
|
| 236 |
+
print("ํ์ดํผํ๋ผ๋ฏธํฐ ์ต์ ํ ์์...")
|
| 237 |
+
trials = Trials()
|
| 238 |
+
xgb_best = fmin(
|
| 239 |
+
fn=objective_func,
|
| 240 |
+
space=xgb_search_space,
|
| 241 |
+
algo=tpe.suggest,
|
| 242 |
+
max_evals=MAX_EVALS,
|
| 243 |
+
trials=trials
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
+
# ์ต์ ํ ๊ฒฐ๊ณผ ๋ถ์ ๋ฐ ์ถ๋ ฅ
|
| 247 |
+
print(f"\n์ต์ ํ ์๋ฃ. ์ต์ ํ๋ผ๋ฏธํฐ: {xgb_best}")
|
| 248 |
+
|
| 249 |
+
# Best loss (CSI ์ ์์ ์์๊ฐ์ด๋ฏ๋ก, ์ค์ CSI๋ -loss)
|
| 250 |
+
best_loss = trials.best_trial['result']['loss']
|
| 251 |
+
best_csi = -best_loss
|
| 252 |
+
print(f"์ต์ CSI ์ ์: {best_csi:.4f} (loss: {best_loss:.4f})")
|
| 253 |
+
|
| 254 |
+
# ๋ชจ๋ trial์ loss ๊ฐ ์ถ์ถ
|
| 255 |
+
losses = [trial['result']['loss'] for trial in trials.trials if trial['result']['status'] == 'ok']
|
| 256 |
+
csi_scores = [-loss for loss in losses]
|
| 257 |
+
|
| 258 |
+
print(f"\n์ต์ ํ ๊ณผ์ ์์ฝ:")
|
| 259 |
+
print(f" - ์ด ์๋ ํ์: {len(trials.trials)}")
|
| 260 |
+
print(f" - ์ฑ๊ณตํ ์๋: {len(losses)}")
|
| 261 |
+
print(f" - ์ต์ด CSI: {csi_scores[0]:.4f}")
|
| 262 |
+
print(f" - ์ต์ข
CSI: {csi_scores[-1]:.4f}")
|
| 263 |
+
print(f" - ์ต๊ณ CSI: {max(csi_scores):.4f}")
|
| 264 |
+
print(f" - ์ต์ CSI: {min(csi_scores):.4f}")
|
| 265 |
+
print(f" - ํ๊ท CSI: {np.mean(csi_scores):.4f}")
|
| 266 |
+
|
| 267 |
+
# Trials ๊ฐ์ฒด ์ ์ฅ
|
| 268 |
+
# ํ์ผ ์์น ๊ธฐ๋ฐ์ผ๋ก base ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
|
| 269 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 270 |
+
base_dir = os.path.dirname(os.path.dirname(current_file_dir)) # 5.optima ๋๋ ํ ๋ฆฌ
|
| 271 |
+
os.makedirs(os.path.join(base_dir, "optimization_history"), exist_ok=True)
|
| 272 |
+
trials_path = os.path.join(base_dir, "optimization_history/xgb_ctgan10000_seoul_trials.pkl")
|
| 273 |
+
joblib.dump(trials, trials_path)
|
| 274 |
+
print(f"\n์ต์ ํ Trials ๊ฐ์ฒด๊ฐ {trials_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 275 |
+
|
| 276 |
+
# ์ต์ ํ๋ ํ์ดํผํ๋ผ๋ฏธํฐ๋ก ์ต์ข
๋ชจ๋ธ ํ์ต
|
| 277 |
+
print("์ต์ข
๋ชจ๋ธ ํ์ต ์์...")
|
| 278 |
+
models = []
|
| 279 |
+
|
| 280 |
+
for fold_idx, (df_sampled, (train_years, val_year)) in enumerate(
|
| 281 |
+
zip(df_ctgan_list, FOLD_CONFIGS), start=1
|
| 282 |
+
):
|
| 283 |
+
print(f"Fold {fold_idx} ํ์ต ์ค... (ํ์ต ์ฐ๋: {train_years}, ๊ฒ์ฆ ์ฐ๋: {val_year})")
|
| 284 |
+
|
| 285 |
+
X_train, X_val, y_train, y_val = split_data(
|
| 286 |
+
df_sampled, df_seoul, train_years, val_year
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
xgb_model = create_xgb_model(best_params=xgb_best)
|
| 290 |
+
xgb_model.fit(X_train, y_train, eval_set=[(X_val, y_val)], verbose=False)
|
| 291 |
+
|
| 292 |
+
# ๊ฒ์ฆ ์ฑ๋ฅ ์ถ๋ ฅ
|
| 293 |
+
val_csi = calculate_csi(y_val, xgb_model.predict(X_val))
|
| 294 |
+
print(f"Fold {fold_idx} ๊ฒ์ฆ CSI: {val_csi:.4f}")
|
| 295 |
+
|
| 296 |
+
models.append(xgb_model)
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
# ๋ชจ๋ธ ์ ์ฅ
|
| 300 |
+
print("๋ชจ๋ธ ์ ์ฅ ์ค...")
|
| 301 |
+
os.makedirs(os.path.join(base_dir, "save_model/xgb_optima"), exist_ok=True)
|
| 302 |
+
model_save_path = os.path.join(base_dir, "save_model/xgb_optima/xgb_ctgan10000_seoul.pkl")
|
| 303 |
+
joblib.dump(models, model_save_path)
|
| 304 |
+
print(f"๋ชจ๋ธ์ด {model_save_path}์ ์ ์ฅ๋์์ต๋๋ค.")
|
| 305 |
+
|
Analysis_code/6.optima_models_analysis/analysis_for_.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/6.optima_models_analysis/best_samples_best_datasample_per_model_per_region.csv
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model,data_sample,region,optimization_library,best_csi,n_trials,best_params
|
| 2 |
+
ft_transformer,ctgan10000,seoul,optuna,0.5936576575682742,100,"{'d_token': 224, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.15689079322421481, 'ffn_dropout': 0.27970845546044715, 'lr': 0.00011858823893766563, 'weight_decay': 0.02942637540327823, 'batch_size': 64}"
|
| 3 |
+
xgb,smote,seoul,hyperopt,0.5914,100,"{'colsample_bytree': 0.9204650350059359, 'gamma': 0.006794691671452219, 'learning_rate': 0.08811009219503893, 'max_depth': 12.0, 'min_child_weight': 3.0, 'reg_alpha': 0.6690476963880017, 'reg_lambda': 0.5388102924254845, 'subsample': 0.8320339664880525}"
|
| 4 |
+
lgb,smote,seoul,hyperopt,0.5895,100,"{'colsample_bytree': 0.7712993813350446, 'learning_rate': 0.014764448164722338, 'max_depth': 13.0, 'min_child_weight': 2.0, 'num_leaves': 144.0, 'reg_alpha': 0.9375760221934153, 'reg_lambda': 0.6881109653195318, 'subsample': 0.6932106255794361}"
|
| 5 |
+
resnet_like,ctgan10000,seoul,optuna,0.5889744558864985,100,"{'d_main': 160, 'd_hidden': 128, 'n_blocks': 4, 'dropout_first': 0.24169683403631037, 'dropout_second': 0.018646743579449815, 'lr': 0.003891520111503718, 'weight_decay': 0.09736563298725749, 'batch_size': 128}"
|
| 6 |
+
deepgbm,smotenc_ctgan20000,seoul,optuna,0.5657974901513136,100,"{'d_main': 128, 'd_hidden': 64, 'n_blocks': 5, 'dropout': 0.1024240157205574, 'lr': 0.009019177625524915, 'weight_decay': 0.08874117499066106, 'batch_size': 256}"
|
| 7 |
+
xgb,smote,incheon,hyperopt,0.6,100,"{'colsample_bytree': 0.8863531635625073, 'gamma': 1.4432252696586687, 'learning_rate': 0.14431831840673584, 'max_depth': 4.0, 'min_child_weight': 4.0, 'reg_alpha': 0.7656890601027424, 'reg_lambda': 0.5796745106013773, 'subsample': 0.8862819830666011}"
|
| 8 |
+
lgb,smote,incheon,hyperopt,0.5986,100,"{'colsample_bytree': 0.7149911519913482, 'learning_rate': 0.14061649313221522, 'max_depth': 4.0, 'min_child_weight': 4.0, 'num_leaves': 46.0, 'reg_alpha': 0.3323739596170201, 'reg_lambda': 0.3615804769440283, 'subsample': 0.7361106038020775}"
|
| 9 |
+
resnet_like,ctgan10000,incheon,optuna,0.5876200434398301,100,"{'d_main': 160, 'd_hidden': 192, 'n_blocks': 3, 'dropout_first': 0.213366405042877, 'dropout_second': 0.0616930432275245, 'lr': 0.005092968501532562, 'weight_decay': 0.06153947659623341, 'batch_size': 256}"
|
| 10 |
+
ft_transformer,smote,incheon,optuna,0.5674050423289939,100,"{'d_token': 96, 'n_blocks': 3, 'n_heads': 8, 'attention_dropout': 0.3637871224837107, 'ffn_dropout': 0.11479322703553738, 'lr': 0.0003009840584939789, 'weight_decay': 0.0003336039035587163, 'batch_size': 32}"
|
| 11 |
+
deepgbm,ctgan10000,incheon,optuna,0.5644485264432356,100,"{'d_main': 64, 'd_hidden': 192, 'n_blocks': 5, 'dropout': 0.16846849111235224, 'lr': 0.007871644587352598, 'weight_decay': 0.0005399258093557023, 'batch_size': 128}"
|
| 12 |
+
xgb,smote,gwangju,hyperopt,0.53,100,"{'colsample_bytree': 0.7658195937298418, 'gamma': 1.040884657831581, 'learning_rate': 0.04553328563585195, 'max_depth': 7.0, 'min_child_weight': 12.0, 'reg_alpha': 0.8031012977426317, 'reg_lambda': 0.6205464163959697, 'subsample': 0.6524796151581305}"
|
| 13 |
+
lgb,smote,gwangju,hyperopt,0.5297,100,"{'colsample_bytree': 0.9919060649789312, 'learning_rate': 0.054631157314326724, 'max_depth': 15.0, 'min_child_weight': 3.0, 'num_leaves': 47.0, 'reg_alpha': 0.9190252546800255, 'reg_lambda': 0.8800706832709921, 'subsample': 0.7859941375783913}"
|
| 14 |
+
deepgbm,ctgan10000,gwangju,optuna,0.5204031176113428,100,"{'d_main': 128, 'd_hidden': 192, 'n_blocks': 6, 'dropout': 0.3938212564993552, 'lr': 0.007164979269975063, 'weight_decay': 0.0923681134285374, 'batch_size': 64}"
|
| 15 |
+
resnet_like,ctgan10000,gwangju,optuna,0.510302842874457,100,"{'d_main': 64, 'd_hidden': 320, 'n_blocks': 3, 'dropout_first': 0.29522157561687634, 'dropout_second': 0.15684305218104422, 'lr': 0.008180657303015811, 'weight_decay': 0.01303718192830624, 'batch_size': 128}"
|
| 16 |
+
ft_transformer,ctgan10000,gwangju,optuna,0.5052817328725289,100,"{'d_token': 160, 'n_blocks': 3, 'n_heads': 4, 'attention_dropout': 0.21128609103276186, 'ffn_dropout': 0.18610731195171396, 'lr': 0.0019139767886005993, 'weight_decay': 0.03127877612669642, 'batch_size': 128}"
|
| 17 |
+
xgb,smote,daejeon,hyperopt,0.5371,100,"{'colsample_bytree': 0.733236256331133, 'gamma': 0.7990977235867733, 'learning_rate': 0.17558281930946487, 'max_depth': 9.0, 'min_child_weight': 11.0, 'reg_alpha': 0.1596833778659402, 'reg_lambda': 0.9170555745286906, 'subsample': 0.6403574066792026}"
|
| 18 |
+
lgb,smote,daejeon,hyperopt,0.5317,100,"{'colsample_bytree': 0.7585295616897205, 'learning_rate': 0.012807299958074884, 'max_depth': 8.0, 'min_child_weight': 2.0, 'num_leaves': 149.0, 'reg_alpha': 0.8175154308532824, 'reg_lambda': 0.7481509687757377, 'subsample': 0.8155067304500027}"
|
| 19 |
+
resnet_like,ctgan10000,daejeon,optuna,0.5101768615009369,100,"{'d_main': 128, 'd_hidden': 256, 'n_blocks': 5, 'dropout_first': 0.1381181811099212, 'dropout_second': 0.11702484025760711, 'lr': 0.0064016726045039805, 'weight_decay': 0.004366638608686326, 'batch_size': 256}"
|
| 20 |
+
deepgbm,ctgan10000,daejeon,optuna,0.5101248146449113,100,"{'d_main': 64, 'd_hidden': 256, 'n_blocks': 2, 'dropout': 0.2845653149911174, 'lr': 0.0030479748817488737, 'weight_decay': 0.08478209494184558, 'batch_size': 32}"
|
| 21 |
+
ft_transformer,ctgan10000,daejeon,optuna,0.5026041056392309,100,"{'d_token': 64, 'n_blocks': 5, 'n_heads': 8, 'attention_dropout': 0.39639878146052787, 'ffn_dropout': 0.16243660840447227, 'lr': 0.0005258652715359098, 'weight_decay': 0.06319928258911829, 'batch_size': 128}"
|
| 22 |
+
xgb,smote,daegu,hyperopt,0.4672,100,"{'colsample_bytree': 0.8132816721507904, 'gamma': 0.9002659162503241, 'learning_rate': 0.04046864452016672, 'max_depth': 4.0, 'min_child_weight': 17.0, 'reg_alpha': 0.4681545450085154, 'reg_lambda': 0.531313515098387, 'subsample': 0.827198506312037}"
|
| 23 |
+
lgb,smote,daegu,hyperopt,0.4671,100,"{'colsample_bytree': 0.999946333457191, 'learning_rate': 0.07031680296643952, 'max_depth': 4.0, 'min_child_weight': 17.0, 'num_leaves': 32.0, 'reg_alpha': 0.055815317687804816, 'reg_lambda': 0.2293760134119255, 'subsample': 0.6363907923464539}"
|
| 24 |
+
resnet_like,ctgan10000,daegu,optuna,0.46086300130604796,100,"{'d_main': 96, 'd_hidden': 256, 'n_blocks': 3, 'dropout_first': 0.27926914874893893, 'dropout_second': 0.13114004557533837, 'lr': 0.004133395383387492, 'weight_decay': 0.05462768451276688, 'batch_size': 32}"
|
| 25 |
+
ft_transformer,ctgan10000,daegu,optuna,0.44918319157422554,100,"{'d_token': 128, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.1615322006432558, 'ffn_dropout': 0.14353691142809796, 'lr': 0.00025225999310114116, 'weight_decay': 0.002948085679186959, 'batch_size': 32}"
|
| 26 |
+
deepgbm,ctgan10000,daegu,optuna,0.4390250453058284,100,"{'d_main': 64, 'd_hidden': 192, 'n_blocks': 2, 'dropout': 0.29112938728448373, 'lr': 0.002745246324742509, 'weight_decay': 0.07823286969698617, 'batch_size': 32}"
|
| 27 |
+
ft_transformer,ctgan10000,busan,optuna,0.4960458104166546,100,"{'d_token': 224, 'n_blocks': 2, 'n_heads': 8, 'attention_dropout': 0.3873943566967484, 'ffn_dropout': 0.14296280926606936, 'lr': 0.0007665967810279031, 'weight_decay': 0.00878158688959246, 'batch_size': 32}"
|
| 28 |
+
xgb,pure,busan,hyperopt,0.4949,100,"{'colsample_bytree': 0.8651175745135303, 'gamma': 2.0220518303820976, 'learning_rate': 0.04196437449161767, 'max_depth': 7.0, 'min_child_weight': 17.0, 'reg_alpha': 0.9213159636887744, 'reg_lambda': 0.9407811453878014, 'subsample': 0.7200034080497129}"
|
| 29 |
+
resnet_like,ctgan10000,busan,optuna,0.49363300915248276,100,"{'d_main': 128, 'd_hidden': 512, 'n_blocks': 2, 'dropout_first': 0.3784300740258752, 'dropout_second': 0.026029354045211155, 'lr': 0.008483242466300268, 'weight_decay': 0.00016367394584020504, 'batch_size': 128}"
|
| 30 |
+
lgb,pure,busan,hyperopt,0.4849,100,"{'colsample_bytree': 0.9406061312055983, 'learning_rate': 0.17468151642796886, 'max_depth': 6.0, 'min_child_weight': 17.0, 'num_leaves': 138.0, 'reg_alpha': 0.4593420461637059, 'reg_lambda': 0.5948987302333338, 'subsample': 0.6557839186758097}"
|
| 31 |
+
deepgbm,ctgan10000,busan,optuna,0.475435864212341,100,"{'d_main': 128, 'd_hidden': 128, 'n_blocks': 2, 'dropout': 0.1477619274404685, 'lr': 0.00606559205480389, 'weight_decay': 0.08582651929034574, 'batch_size': 64}"
|
Analysis_code/6.optima_models_analysis/extract_result.ipynb
DELETED
|
@@ -1,690 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": null,
|
| 6 |
-
"id": "70effd7a",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"import pandas as pd\n",
|
| 11 |
-
"import numpy as np\n",
|
| 12 |
-
"import joblib\n",
|
| 13 |
-
"import os\n",
|
| 14 |
-
"import re\n",
|
| 15 |
-
"from glob import glob\n",
|
| 16 |
-
"import matplotlib.pyplot as plt\n",
|
| 17 |
-
"import seaborn as sns"
|
| 18 |
-
]
|
| 19 |
-
},
|
| 20 |
-
{
|
| 21 |
-
"cell_type": "code",
|
| 22 |
-
"execution_count": 2,
|
| 23 |
-
"id": "2942ba86",
|
| 24 |
-
"metadata": {},
|
| 25 |
-
"outputs": [],
|
| 26 |
-
"source": [
|
| 27 |
-
"optimization_history_dir = \"../optimization_history/\""
|
| 28 |
-
]
|
| 29 |
-
},
|
| 30 |
-
{
|
| 31 |
-
"cell_type": "code",
|
| 32 |
-
"execution_count": 3,
|
| 33 |
-
"id": "d55af59c",
|
| 34 |
-
"metadata": {},
|
| 35 |
-
"outputs": [],
|
| 36 |
-
"source": [
|
| 37 |
-
"MODELS = ['ft_transformer', 'resnet_like', 'deepgbm', 'lgb', 'xgb']\n",
|
| 38 |
-
"REGIONS = ['seoul', 'busan', 'incheon', 'daegu', 'daejeon', 'gwangju']\n",
|
| 39 |
-
"\n",
|
| 40 |
-
"pkl_files = glob(os.path.join(optimization_history_dir, \"*_trials.pkl\"))\n",
|
| 41 |
-
"\n",
|
| 42 |
-
"def parse_filename(filename):\n",
|
| 43 |
-
" basename = os.path.basename(filename)\n",
|
| 44 |
-
" name_without_ext = basename.replace('_trials.pkl', '')\n",
|
| 45 |
-
" model = None\n",
|
| 46 |
-
" for m in MODELS:\n",
|
| 47 |
-
" if name_without_ext.startswith(m + '_'):\n",
|
| 48 |
-
" model = m\n",
|
| 49 |
-
" break\n",
|
| 50 |
-
" region = None\n",
|
| 51 |
-
" for r in REGIONS:\n",
|
| 52 |
-
" if name_without_ext.endswith('_' + r):\n",
|
| 53 |
-
" region = r\n",
|
| 54 |
-
" data_sample = name_without_ext[len(model) + 1:-(len(region) + 1)]\n",
|
| 55 |
-
" break\n",
|
| 56 |
-
" return model, data_sample, region\n"
|
| 57 |
-
]
|
| 58 |
-
},
|
| 59 |
-
{
|
| 60 |
-
"cell_type": "code",
|
| 61 |
-
"execution_count": 4,
|
| 62 |
-
"id": "832eb50a",
|
| 63 |
-
"metadata": {},
|
| 64 |
-
"outputs": [],
|
| 65 |
-
"source": [
|
| 66 |
-
"def extract_optimization_info(obj):\n",
|
| 67 |
-
" if hasattr(obj, 'best_value') and hasattr(obj, 'best_params') and hasattr(obj, 'trials'):\n",
|
| 68 |
-
" return extract_optuna_info(obj)\n",
|
| 69 |
-
" elif hasattr(obj, 'best_trial') and hasattr(obj, 'trials'):\n",
|
| 70 |
-
" return extract_hyperopt_info(obj)\n",
|
| 71 |
-
" return None\n",
|
| 72 |
-
"\n",
|
| 73 |
-
"def extract_optuna_info(study):\n",
|
| 74 |
-
" best_csi = study.best_value\n",
|
| 75 |
-
" best_params = study.best_params\n",
|
| 76 |
-
" n_trials = len(study.trials)\n",
|
| 77 |
-
" successful_trials = [t for t in study.trials if t.value is not None]\n",
|
| 78 |
-
" n_successful = len(successful_trials)\n",
|
| 79 |
-
" csi_scores = [t.value for t in successful_trials]\n",
|
| 80 |
-
" \n",
|
| 81 |
-
" if len(csi_scores) > 0:\n",
|
| 82 |
-
" stats = {\n",
|
| 83 |
-
" 'first_csi': csi_scores[0],\n",
|
| 84 |
-
" 'last_csi': csi_scores[-1],\n",
|
| 85 |
-
" 'max_csi': max(csi_scores),\n",
|
| 86 |
-
" 'min_csi': min(csi_scores),\n",
|
| 87 |
-
" 'mean_csi': np.mean(csi_scores),\n",
|
| 88 |
-
" 'std_csi': np.std(csi_scores) if len(csi_scores) > 1 else 0.0\n",
|
| 89 |
-
" }\n",
|
| 90 |
-
" else:\n",
|
| 91 |
-
" stats = {\n",
|
| 92 |
-
" 'first_csi': None, 'last_csi': None, 'max_csi': None,\n",
|
| 93 |
-
" 'min_csi': None, 'mean_csi': None, 'std_csi': None\n",
|
| 94 |
-
" }\n",
|
| 95 |
-
" \n",
|
| 96 |
-
" return {\n",
|
| 97 |
-
" 'best_csi': best_csi,\n",
|
| 98 |
-
" 'best_loss': None,\n",
|
| 99 |
-
" 'n_trials': n_trials,\n",
|
| 100 |
-
" 'n_successful': n_successful,\n",
|
| 101 |
-
" 'best_params': best_params,\n",
|
| 102 |
-
" 'optimization_library': 'optuna',\n",
|
| 103 |
-
" **stats\n",
|
| 104 |
-
" }\n",
|
| 105 |
-
"\n",
|
| 106 |
-
"def extract_hyperopt_info(trials):\n",
|
| 107 |
-
" best_trial = trials.best_trial\n",
|
| 108 |
-
" best_loss = best_trial['result']['loss']\n",
|
| 109 |
-
" best_csi = -best_loss\n",
|
| 110 |
-
" n_trials = len(trials.trials)\n",
|
| 111 |
-
" successful_trials = [t for t in trials.trials if t['result']['status'] == 'ok']\n",
|
| 112 |
-
" n_successful = len(successful_trials)\n",
|
| 113 |
-
" losses = [t['result']['loss'] for t in successful_trials]\n",
|
| 114 |
-
" csi_scores = [-loss for loss in losses]\n",
|
| 115 |
-
" \n",
|
| 116 |
-
" if len(csi_scores) > 0:\n",
|
| 117 |
-
" stats = {\n",
|
| 118 |
-
" 'first_csi': csi_scores[0],\n",
|
| 119 |
-
" 'last_csi': csi_scores[-1],\n",
|
| 120 |
-
" 'max_csi': max(csi_scores),\n",
|
| 121 |
-
" 'min_csi': min(csi_scores),\n",
|
| 122 |
-
" 'mean_csi': np.mean(csi_scores),\n",
|
| 123 |
-
" 'std_csi': np.std(csi_scores) if len(csi_scores) > 1 else 0.0\n",
|
| 124 |
-
" }\n",
|
| 125 |
-
" else:\n",
|
| 126 |
-
" stats = {\n",
|
| 127 |
-
" 'first_csi': None, 'last_csi': None, 'max_csi': None,\n",
|
| 128 |
-
" 'min_csi': None, 'mean_csi': None, 'std_csi': None\n",
|
| 129 |
-
" }\n",
|
| 130 |
-
" \n",
|
| 131 |
-
" best_params = {}\n",
|
| 132 |
-
" if 'misc' in best_trial and 'vals' in best_trial['misc']:\n",
|
| 133 |
-
" for key, value_list in best_trial['misc']['vals'].items():\n",
|
| 134 |
-
" if len(value_list) > 0:\n",
|
| 135 |
-
" best_params[key] = value_list[0]\n",
|
| 136 |
-
" \n",
|
| 137 |
-
" return {\n",
|
| 138 |
-
" 'best_csi': best_csi,\n",
|
| 139 |
-
" 'best_loss': best_loss,\n",
|
| 140 |
-
" 'n_trials': n_trials,\n",
|
| 141 |
-
" 'n_successful': n_successful,\n",
|
| 142 |
-
" 'best_params': best_params,\n",
|
| 143 |
-
" 'optimization_library': 'hyperopt',\n",
|
| 144 |
-
" **stats\n",
|
| 145 |
-
" }"
|
| 146 |
-
]
|
| 147 |
-
},
|
| 148 |
-
{
|
| 149 |
-
"cell_type": "code",
|
| 150 |
-
"execution_count": 5,
|
| 151 |
-
"id": "2b22a08b",
|
| 152 |
-
"metadata": {},
|
| 153 |
-
"outputs": [],
|
| 154 |
-
"source": [
|
| 155 |
-
"results = []\n",
|
| 156 |
-
"\n",
|
| 157 |
-
"for pkl_file in pkl_files:\n",
|
| 158 |
-
" model, data_sample, region = parse_filename(pkl_file)\n",
|
| 159 |
-
" if model is None or data_sample is None or region is None:\n",
|
| 160 |
-
" continue\n",
|
| 161 |
-
" \n",
|
| 162 |
-
" obj = joblib.load(pkl_file)\n",
|
| 163 |
-
" info = extract_optimization_info(obj)\n",
|
| 164 |
-
" if info is None:\n",
|
| 165 |
-
" continue\n",
|
| 166 |
-
" \n",
|
| 167 |
-
" result = {\n",
|
| 168 |
-
" 'model': model,\n",
|
| 169 |
-
" 'data_sample': data_sample,\n",
|
| 170 |
-
" 'region': region,\n",
|
| 171 |
-
" 'filename': os.path.basename(pkl_file),\n",
|
| 172 |
-
" **info\n",
|
| 173 |
-
" }\n",
|
| 174 |
-
" results.append(result)"
|
| 175 |
-
]
|
| 176 |
-
},
|
| 177 |
-
{
|
| 178 |
-
"cell_type": "code",
|
| 179 |
-
"execution_count": 6,
|
| 180 |
-
"id": "095f2637",
|
| 181 |
-
"metadata": {},
|
| 182 |
-
"outputs": [],
|
| 183 |
-
"source": [
|
| 184 |
-
"df_optimization = pd.DataFrame(results)\n",
|
| 185 |
-
"column_order = [\n",
|
| 186 |
-
" 'model', 'data_sample', 'region', 'optimization_library',\n",
|
| 187 |
-
" 'best_csi', 'n_trials','best_params'\n",
|
| 188 |
-
"]\n",
|
| 189 |
-
"available_columns = [col for col in column_order if col in df_optimization.columns]\n",
|
| 190 |
-
"df_optimization = df_optimization[available_columns + [col for col in df_optimization.columns if col not in available_columns]]\n",
|
| 191 |
-
"df_optimization = df_optimization.loc[:, column_order]"
|
| 192 |
-
]
|
| 193 |
-
},
|
| 194 |
-
{
|
| 195 |
-
"cell_type": "code",
|
| 196 |
-
"execution_count": 7,
|
| 197 |
-
"id": "ff111ec3",
|
| 198 |
-
"metadata": {},
|
| 199 |
-
"outputs": [
|
| 200 |
-
{
|
| 201 |
-
"data": {
|
| 202 |
-
"text/plain": [
|
| 203 |
-
"ft_transformer 19\n",
|
| 204 |
-
"xgb 19\n",
|
| 205 |
-
"resnet_like 19\n",
|
| 206 |
-
"lgb 19\n",
|
| 207 |
-
"deepgbm 19\n",
|
| 208 |
-
"Name: model, dtype: int64"
|
| 209 |
-
]
|
| 210 |
-
},
|
| 211 |
-
"execution_count": 7,
|
| 212 |
-
"metadata": {},
|
| 213 |
-
"output_type": "execute_result"
|
| 214 |
-
}
|
| 215 |
-
],
|
| 216 |
-
"source": [
|
| 217 |
-
"df_optimization['model'].value_counts()"
|
| 218 |
-
]
|
| 219 |
-
},
|
| 220 |
-
{
|
| 221 |
-
"cell_type": "code",
|
| 222 |
-
"execution_count": 8,
|
| 223 |
-
"id": "753ebaf5",
|
| 224 |
-
"metadata": {},
|
| 225 |
-
"outputs": [
|
| 226 |
-
{
|
| 227 |
-
"data": {
|
| 228 |
-
"text/plain": [
|
| 229 |
-
"busan 20\n",
|
| 230 |
-
"daegu 15\n",
|
| 231 |
-
"seoul 15\n",
|
| 232 |
-
"gwangju 15\n",
|
| 233 |
-
"daejeon 15\n",
|
| 234 |
-
"incheon 15\n",
|
| 235 |
-
"Name: region, dtype: int64"
|
| 236 |
-
]
|
| 237 |
-
},
|
| 238 |
-
"execution_count": 8,
|
| 239 |
-
"metadata": {},
|
| 240 |
-
"output_type": "execute_result"
|
| 241 |
-
}
|
| 242 |
-
],
|
| 243 |
-
"source": [
|
| 244 |
-
"df_optimization['region'].value_counts()"
|
| 245 |
-
]
|
| 246 |
-
},
|
| 247 |
-
{
|
| 248 |
-
"cell_type": "code",
|
| 249 |
-
"execution_count": 16,
|
| 250 |
-
"id": "7472bb4e",
|
| 251 |
-
"metadata": {},
|
| 252 |
-
"outputs": [
|
| 253 |
-
{
|
| 254 |
-
"data": {
|
| 255 |
-
"text/html": [
|
| 256 |
-
"<div>\n",
|
| 257 |
-
"<style scoped>\n",
|
| 258 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
| 259 |
-
" vertical-align: middle;\n",
|
| 260 |
-
" }\n",
|
| 261 |
-
"\n",
|
| 262 |
-
" .dataframe tbody tr th {\n",
|
| 263 |
-
" vertical-align: top;\n",
|
| 264 |
-
" }\n",
|
| 265 |
-
"\n",
|
| 266 |
-
" .dataframe thead th {\n",
|
| 267 |
-
" text-align: right;\n",
|
| 268 |
-
" }\n",
|
| 269 |
-
"</style>\n",
|
| 270 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
| 271 |
-
" <thead>\n",
|
| 272 |
-
" <tr style=\"text-align: right;\">\n",
|
| 273 |
-
" <th></th>\n",
|
| 274 |
-
" <th>model</th>\n",
|
| 275 |
-
" <th>data_sample</th>\n",
|
| 276 |
-
" <th>region</th>\n",
|
| 277 |
-
" <th>optimization_library</th>\n",
|
| 278 |
-
" <th>best_csi</th>\n",
|
| 279 |
-
" <th>n_trials</th>\n",
|
| 280 |
-
" <th>best_params</th>\n",
|
| 281 |
-
" </tr>\n",
|
| 282 |
-
" </thead>\n",
|
| 283 |
-
" <tbody>\n",
|
| 284 |
-
" <tr>\n",
|
| 285 |
-
" <th>0</th>\n",
|
| 286 |
-
" <td>ft_transformer</td>\n",
|
| 287 |
-
" <td>smote</td>\n",
|
| 288 |
-
" <td>busan</td>\n",
|
| 289 |
-
" <td>optuna</td>\n",
|
| 290 |
-
" <td>0.452471</td>\n",
|
| 291 |
-
" <td>100</td>\n",
|
| 292 |
-
" <td>{'d_token': 96, 'n_blocks': 2, 'n_heads': 4, '...</td>\n",
|
| 293 |
-
" </tr>\n",
|
| 294 |
-
" <tr>\n",
|
| 295 |
-
" <th>1</th>\n",
|
| 296 |
-
" <td>ft_transformer</td>\n",
|
| 297 |
-
" <td>pure</td>\n",
|
| 298 |
-
" <td>daegu</td>\n",
|
| 299 |
-
" <td>optuna</td>\n",
|
| 300 |
-
" <td>0.384659</td>\n",
|
| 301 |
-
" <td>100</td>\n",
|
| 302 |
-
" <td>{'d_token': 224, 'n_blocks': 2, 'n_heads': 8, ...</td>\n",
|
| 303 |
-
" </tr>\n",
|
| 304 |
-
" <tr>\n",
|
| 305 |
-
" <th>2</th>\n",
|
| 306 |
-
" <td>xgb</td>\n",
|
| 307 |
-
" <td>smotenc_ctgan20000</td>\n",
|
| 308 |
-
" <td>daegu</td>\n",
|
| 309 |
-
" <td>hyperopt</td>\n",
|
| 310 |
-
" <td>0.427700</td>\n",
|
| 311 |
-
" <td>100</td>\n",
|
| 312 |
-
" <td>{'colsample_bytree': 0.7114033147242765, 'gamm...</td>\n",
|
| 313 |
-
" </tr>\n",
|
| 314 |
-
" <tr>\n",
|
| 315 |
-
" <th>3</th>\n",
|
| 316 |
-
" <td>resnet_like</td>\n",
|
| 317 |
-
" <td>pure</td>\n",
|
| 318 |
-
" <td>seoul</td>\n",
|
| 319 |
-
" <td>optuna</td>\n",
|
| 320 |
-
" <td>0.556676</td>\n",
|
| 321 |
-
" <td>100</td>\n",
|
| 322 |
-
" <td>{'d_main': 96, 'd_hidden': 512, 'n_blocks': 2,...</td>\n",
|
| 323 |
-
" </tr>\n",
|
| 324 |
-
" <tr>\n",
|
| 325 |
-
" <th>4</th>\n",
|
| 326 |
-
" <td>resnet_like</td>\n",
|
| 327 |
-
" <td>smote</td>\n",
|
| 328 |
-
" <td>gwangju</td>\n",
|
| 329 |
-
" <td>optuna</td>\n",
|
| 330 |
-
" <td>0.486711</td>\n",
|
| 331 |
-
" <td>100</td>\n",
|
| 332 |
-
" <td>{'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, ...</td>\n",
|
| 333 |
-
" </tr>\n",
|
| 334 |
-
" </tbody>\n",
|
| 335 |
-
"</table>\n",
|
| 336 |
-
"</div>"
|
| 337 |
-
],
|
| 338 |
-
"text/plain": [
|
| 339 |
-
" model data_sample region optimization_library best_csi \\\n",
|
| 340 |
-
"0 ft_transformer smote busan optuna 0.452471 \n",
|
| 341 |
-
"1 ft_transformer pure daegu optuna 0.384659 \n",
|
| 342 |
-
"2 xgb smotenc_ctgan20000 daegu hyperopt 0.427700 \n",
|
| 343 |
-
"3 resnet_like pure seoul optuna 0.556676 \n",
|
| 344 |
-
"4 resnet_like smote gwangju optuna 0.486711 \n",
|
| 345 |
-
"\n",
|
| 346 |
-
" n_trials best_params \n",
|
| 347 |
-
"0 100 {'d_token': 96, 'n_blocks': 2, 'n_heads': 4, '... \n",
|
| 348 |
-
"1 100 {'d_token': 224, 'n_blocks': 2, 'n_heads': 8, ... \n",
|
| 349 |
-
"2 100 {'colsample_bytree': 0.7114033147242765, 'gamm... \n",
|
| 350 |
-
"3 100 {'d_main': 96, 'd_hidden': 512, 'n_blocks': 2,... \n",
|
| 351 |
-
"4 100 {'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, ... "
|
| 352 |
-
]
|
| 353 |
-
},
|
| 354 |
-
"execution_count": 16,
|
| 355 |
-
"metadata": {},
|
| 356 |
-
"output_type": "execute_result"
|
| 357 |
-
}
|
| 358 |
-
],
|
| 359 |
-
"source": [
|
| 360 |
-
"df_optimization.head()"
|
| 361 |
-
]
|
| 362 |
-
},
|
| 363 |
-
{
|
| 364 |
-
"cell_type": "code",
|
| 365 |
-
"execution_count": 17,
|
| 366 |
-
"id": "b6245ef4",
|
| 367 |
-
"metadata": {},
|
| 368 |
-
"outputs": [
|
| 369 |
-
{
|
| 370 |
-
"data": {
|
| 371 |
-
"text/html": [
|
| 372 |
-
"<div>\n",
|
| 373 |
-
"<style scoped>\n",
|
| 374 |
-
" .dataframe tbody tr th:only-of-type {\n",
|
| 375 |
-
" vertical-align: middle;\n",
|
| 376 |
-
" }\n",
|
| 377 |
-
"\n",
|
| 378 |
-
" .dataframe tbody tr th {\n",
|
| 379 |
-
" vertical-align: top;\n",
|
| 380 |
-
" }\n",
|
| 381 |
-
"\n",
|
| 382 |
-
" .dataframe thead th {\n",
|
| 383 |
-
" text-align: right;\n",
|
| 384 |
-
" }\n",
|
| 385 |
-
"</style>\n",
|
| 386 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
| 387 |
-
" <thead>\n",
|
| 388 |
-
" <tr style=\"text-align: right;\">\n",
|
| 389 |
-
" <th></th>\n",
|
| 390 |
-
" <th>model</th>\n",
|
| 391 |
-
" <th>data_sample</th>\n",
|
| 392 |
-
" <th>region</th>\n",
|
| 393 |
-
" <th>optimization_library</th>\n",
|
| 394 |
-
" <th>best_csi</th>\n",
|
| 395 |
-
" <th>n_trials</th>\n",
|
| 396 |
-
" <th>best_params</th>\n",
|
| 397 |
-
" </tr>\n",
|
| 398 |
-
" </thead>\n",
|
| 399 |
-
" <tbody>\n",
|
| 400 |
-
" <tr>\n",
|
| 401 |
-
" <th>0</th>\n",
|
| 402 |
-
" <td>ft_transformer</td>\n",
|
| 403 |
-
" <td>smote</td>\n",
|
| 404 |
-
" <td>busan</td>\n",
|
| 405 |
-
" <td>optuna</td>\n",
|
| 406 |
-
" <td>0.452471</td>\n",
|
| 407 |
-
" <td>100</td>\n",
|
| 408 |
-
" <td>{'d_token': 96, 'n_blocks': 2, 'n_heads': 4, '...</td>\n",
|
| 409 |
-
" </tr>\n",
|
| 410 |
-
" <tr>\n",
|
| 411 |
-
" <th>1</th>\n",
|
| 412 |
-
" <td>ft_transformer</td>\n",
|
| 413 |
-
" <td>pure</td>\n",
|
| 414 |
-
" <td>daegu</td>\n",
|
| 415 |
-
" <td>optuna</td>\n",
|
| 416 |
-
" <td>0.384659</td>\n",
|
| 417 |
-
" <td>100</td>\n",
|
| 418 |
-
" <td>{'d_token': 224, 'n_blocks': 2, 'n_heads': 8, ...</td>\n",
|
| 419 |
-
" </tr>\n",
|
| 420 |
-
" <tr>\n",
|
| 421 |
-
" <th>2</th>\n",
|
| 422 |
-
" <td>xgb</td>\n",
|
| 423 |
-
" <td>smotenc_ctgan20000</td>\n",
|
| 424 |
-
" <td>daegu</td>\n",
|
| 425 |
-
" <td>hyperopt</td>\n",
|
| 426 |
-
" <td>0.427700</td>\n",
|
| 427 |
-
" <td>100</td>\n",
|
| 428 |
-
" <td>{'colsample_bytree': 0.7114033147242765, 'gamm...</td>\n",
|
| 429 |
-
" </tr>\n",
|
| 430 |
-
" <tr>\n",
|
| 431 |
-
" <th>3</th>\n",
|
| 432 |
-
" <td>resnet_like</td>\n",
|
| 433 |
-
" <td>pure</td>\n",
|
| 434 |
-
" <td>seoul</td>\n",
|
| 435 |
-
" <td>optuna</td>\n",
|
| 436 |
-
" <td>0.556676</td>\n",
|
| 437 |
-
" <td>100</td>\n",
|
| 438 |
-
" <td>{'d_main': 96, 'd_hidden': 512, 'n_blocks': 2,...</td>\n",
|
| 439 |
-
" </tr>\n",
|
| 440 |
-
" <tr>\n",
|
| 441 |
-
" <th>4</th>\n",
|
| 442 |
-
" <td>resnet_like</td>\n",
|
| 443 |
-
" <td>smote</td>\n",
|
| 444 |
-
" <td>gwangju</td>\n",
|
| 445 |
-
" <td>optuna</td>\n",
|
| 446 |
-
" <td>0.486711</td>\n",
|
| 447 |
-
" <td>100</td>\n",
|
| 448 |
-
" <td>{'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, ...</td>\n",
|
| 449 |
-
" </tr>\n",
|
| 450 |
-
" <tr>\n",
|
| 451 |
-
" <th>...</th>\n",
|
| 452 |
-
" <td>...</td>\n",
|
| 453 |
-
" <td>...</td>\n",
|
| 454 |
-
" <td>...</td>\n",
|
| 455 |
-
" <td>...</td>\n",
|
| 456 |
-
" <td>...</td>\n",
|
| 457 |
-
" <td>...</td>\n",
|
| 458 |
-
" <td>...</td>\n",
|
| 459 |
-
" </tr>\n",
|
| 460 |
-
" <tr>\n",
|
| 461 |
-
" <th>90</th>\n",
|
| 462 |
-
" <td>resnet_like</td>\n",
|
| 463 |
-
" <td>smote</td>\n",
|
| 464 |
-
" <td>daegu</td>\n",
|
| 465 |
-
" <td>optuna</td>\n",
|
| 466 |
-
" <td>0.395593</td>\n",
|
| 467 |
-
" <td>100</td>\n",
|
| 468 |
-
" <td>{'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, ...</td>\n",
|
| 469 |
-
" </tr>\n",
|
| 470 |
-
" <tr>\n",
|
| 471 |
-
" <th>91</th>\n",
|
| 472 |
-
" <td>deepgbm</td>\n",
|
| 473 |
-
" <td>smotenc_ctgan20000</td>\n",
|
| 474 |
-
" <td>daejeon</td>\n",
|
| 475 |
-
" <td>optuna</td>\n",
|
| 476 |
-
" <td>0.484893</td>\n",
|
| 477 |
-
" <td>100</td>\n",
|
| 478 |
-
" <td>{'d_main': 96, 'd_hidden': 64, 'n_blocks': 6, ...</td>\n",
|
| 479 |
-
" </tr>\n",
|
| 480 |
-
" <tr>\n",
|
| 481 |
-
" <th>92</th>\n",
|
| 482 |
-
" <td>resnet_like</td>\n",
|
| 483 |
-
" <td>smotenc_ctgan20000</td>\n",
|
| 484 |
-
" <td>daejeon</td>\n",
|
| 485 |
-
" <td>optuna</td>\n",
|
| 486 |
-
" <td>0.482239</td>\n",
|
| 487 |
-
" <td>100</td>\n",
|
| 488 |
-
" <td>{'d_main': 256, 'd_hidden': 128, 'n_blocks': 2...</td>\n",
|
| 489 |
-
" </tr>\n",
|
| 490 |
-
" <tr>\n",
|
| 491 |
-
" <th>93</th>\n",
|
| 492 |
-
" <td>deepgbm</td>\n",
|
| 493 |
-
" <td>pure</td>\n",
|
| 494 |
-
" <td>daegu</td>\n",
|
| 495 |
-
" <td>optuna</td>\n",
|
| 496 |
-
" <td>0.357045</td>\n",
|
| 497 |
-
" <td>100</td>\n",
|
| 498 |
-
" <td>{'d_main': 160, 'd_hidden': 64, 'n_blocks': 4,...</td>\n",
|
| 499 |
-
" </tr>\n",
|
| 500 |
-
" <tr>\n",
|
| 501 |
-
" <th>94</th>\n",
|
| 502 |
-
" <td>resnet_like</td>\n",
|
| 503 |
-
" <td>pure</td>\n",
|
| 504 |
-
" <td>daegu</td>\n",
|
| 505 |
-
" <td>optuna</td>\n",
|
| 506 |
-
" <td>0.407522</td>\n",
|
| 507 |
-
" <td>100</td>\n",
|
| 508 |
-
" <td>{'d_main': 192, 'd_hidden': 64, 'n_blocks': 3,...</td>\n",
|
| 509 |
-
" </tr>\n",
|
| 510 |
-
" </tbody>\n",
|
| 511 |
-
"</table>\n",
|
| 512 |
-
"<p>95 rows ร 7 columns</p>\n",
|
| 513 |
-
"</div>"
|
| 514 |
-
],
|
| 515 |
-
"text/plain": [
|
| 516 |
-
" model data_sample region optimization_library \\\n",
|
| 517 |
-
"0 ft_transformer smote busan optuna \n",
|
| 518 |
-
"1 ft_transformer pure daegu optuna \n",
|
| 519 |
-
"2 xgb smotenc_ctgan20000 daegu hyperopt \n",
|
| 520 |
-
"3 resnet_like pure seoul optuna \n",
|
| 521 |
-
"4 resnet_like smote gwangju optuna \n",
|
| 522 |
-
".. ... ... ... ... \n",
|
| 523 |
-
"90 resnet_like smote daegu optuna \n",
|
| 524 |
-
"91 deepgbm smotenc_ctgan20000 daejeon optuna \n",
|
| 525 |
-
"92 resnet_like smotenc_ctgan20000 daejeon optuna \n",
|
| 526 |
-
"93 deepgbm pure daegu optuna \n",
|
| 527 |
-
"94 resnet_like pure daegu optuna \n",
|
| 528 |
-
"\n",
|
| 529 |
-
" best_csi n_trials best_params \n",
|
| 530 |
-
"0 0.452471 100 {'d_token': 96, 'n_blocks': 2, 'n_heads': 4, '... \n",
|
| 531 |
-
"1 0.384659 100 {'d_token': 224, 'n_blocks': 2, 'n_heads': 8, ... \n",
|
| 532 |
-
"2 0.427700 100 {'colsample_bytree': 0.7114033147242765, 'gamm... \n",
|
| 533 |
-
"3 0.556676 100 {'d_main': 96, 'd_hidden': 512, 'n_blocks': 2,... \n",
|
| 534 |
-
"4 0.486711 100 {'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, ... \n",
|
| 535 |
-
".. ... ... ... \n",
|
| 536 |
-
"90 0.395593 100 {'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, ... \n",
|
| 537 |
-
"91 0.484893 100 {'d_main': 96, 'd_hidden': 64, 'n_blocks': 6, ... \n",
|
| 538 |
-
"92 0.482239 100 {'d_main': 256, 'd_hidden': 128, 'n_blocks': 2... \n",
|
| 539 |
-
"93 0.357045 100 {'d_main': 160, 'd_hidden': 64, 'n_blocks': 4,... \n",
|
| 540 |
-
"94 0.407522 100 {'d_main': 192, 'd_hidden': 64, 'n_blocks': 3,... \n",
|
| 541 |
-
"\n",
|
| 542 |
-
"[95 rows x 7 columns]"
|
| 543 |
-
]
|
| 544 |
-
},
|
| 545 |
-
"execution_count": 17,
|
| 546 |
-
"metadata": {},
|
| 547 |
-
"output_type": "execute_result"
|
| 548 |
-
}
|
| 549 |
-
],
|
| 550 |
-
"source": [
|
| 551 |
-
"df_optimization"
|
| 552 |
-
]
|
| 553 |
-
},
|
| 554 |
-
{
|
| 555 |
-
"cell_type": "code",
|
| 556 |
-
"execution_count": null,
|
| 557 |
-
"id": "580e5ae9",
|
| 558 |
-
"metadata": {},
|
| 559 |
-
"outputs": [],
|
| 560 |
-
"source": [
|
| 561 |
-
"# ๋ชจ๋ธ๋ณ best_csi๋ฅผ region๋ณ๋ก ์๊ฐํ\n",
|
| 562 |
-
"# ์ฐธ๊ณ : analysis_for_oversampling_data.ipynb์ Cell 12 ํจํด\n",
|
| 563 |
-
"\n",
|
| 564 |
-
"# ๋ฐ์ดํฐ ๋ณต์ฌ ๋ฐ ๋ชจ๋ธ๋ช
๋งคํ (ํ์์ฉ)\n",
|
| 565 |
-
"df_plot = df_optimization.copy()\n",
|
| 566 |
-
"\n",
|
| 567 |
-
"# ๋ชจ๋ธ๋ช
๋งคํ: 'lgb' -> 'lightgbm', 'xgb' -> 'xgboost'\n",
|
| 568 |
-
"model_mapping = {\n",
|
| 569 |
-
" 'lgb': 'lightgbm',\n",
|
| 570 |
-
" 'xgb': 'xgboost',\n",
|
| 571 |
-
" 'ft_transformer': 'ft_transformer',\n",
|
| 572 |
-
" 'resnet_like': 'resnet_like',\n",
|
| 573 |
-
" 'deepgbm': 'deepgbm'\n",
|
| 574 |
-
"}\n",
|
| 575 |
-
"df_plot['model_display'] = df_plot['model'].map(model_mapping)\n",
|
| 576 |
-
"\n",
|
| 577 |
-
"# region์ category๋ก ๋ณํํ์ฌ ์ ๋ ฌ\n",
|
| 578 |
-
"df_plot['region'] = df_plot['region'].astype('category')\n",
|
| 579 |
-
"df_plot['region'] = df_plot['region'].cat.reorder_categories(sorted(df_plot['region'].cat.categories))\n",
|
| 580 |
-
"\n",
|
| 581 |
-
"# ๋ชจ๋ธ ๋ชฉ๋ก (ํ์ ์์)\n",
|
| 582 |
-
"models_display = ['xgboost', 'lightgbm', 'resnet_like', 'ft_transformer', 'deepgbm']\n",
|
| 583 |
-
"\n",
|
| 584 |
-
"# 2ํ 3์ด subplot ์์ฑ (5๊ฐ ๋ชจ๋ธ)\n",
|
| 585 |
-
"fig, axes = plt.subplots(2, 3, figsize=(20, 12))\n",
|
| 586 |
-
"fig.suptitle('Best CSI Score by Region (Grouped by Data Sample)', \n",
|
| 587 |
-
" fontsize=16, fontweight='bold', y=0.995)\n",
|
| 588 |
-
"\n",
|
| 589 |
-
"# axes๋ฅผ 1์ฐจ์ ๋ฐฐ์ด๋ก ๋ณํ\n",
|
| 590 |
-
"axes_flat = axes.flatten()\n",
|
| 591 |
-
"\n",
|
| 592 |
-
"# ๊ฐ ๋ชจ๋ธ๋ณ๋ก plot ์์ฑ\n",
|
| 593 |
-
"for model_idx, model_display in enumerate(models_display):\n",
|
| 594 |
-
" ax = axes_flat[model_idx]\n",
|
| 595 |
-
" \n",
|
| 596 |
-
" # ํด๋น ๋ชจ๋ธ์ ๋ฐ์ดํฐ๋ง ํํฐ๋ง\n",
|
| 597 |
-
" model_df = df_plot[df_plot['model_display'] == model_display]\n",
|
| 598 |
-
" \n",
|
| 599 |
-
" # ๋ฐ์ดํฐ๊ฐ ์๋ ๊ฒฝ์ฐ์๋ง plot\n",
|
| 600 |
-
" if len(model_df) > 0:\n",
|
| 601 |
-
" # Seaborn lineplot ์ฌ์ฉ\n",
|
| 602 |
-
" sns.lineplot(\n",
|
| 603 |
-
" data=model_df,\n",
|
| 604 |
-
" x='region',\n",
|
| 605 |
-
" y='best_csi',\n",
|
| 606 |
-
" hue='data_sample',\n",
|
| 607 |
-
" marker='o',\n",
|
| 608 |
-
" markersize=8,\n",
|
| 609 |
-
" linewidth=2.5,\n",
|
| 610 |
-
" palette='tab20', # data_sample๋ณ ์์\n",
|
| 611 |
-
" ax=ax\n",
|
| 612 |
-
" )\n",
|
| 613 |
-
" \n",
|
| 614 |
-
" ax.set_title(f'{model_display}', fontsize=14, fontweight='bold', pad=15)\n",
|
| 615 |
-
" ax.set_xlabel('Region', fontsize=12)\n",
|
| 616 |
-
" ax.set_ylabel('Best CSI Score', fontsize=12)\n",
|
| 617 |
-
" ax.tick_params(axis='x', rotation=45)\n",
|
| 618 |
-
" ax.grid(True, alpha=0.3, linestyle='--')\n",
|
| 619 |
-
" ax.legend(bbox_to_anchor=(1.05, 1), loc='upper left', fontsize=9, framealpha=0.9)\n",
|
| 620 |
-
"\n",
|
| 621 |
-
"# ๋ง์ง๋ง subplot (6๋ฒ์งธ)๋ ์ฌ์ฉํ์ง ์์ผ๋ฏ๋ก ์จ๊น\n",
|
| 622 |
-
"axes_flat[5].axis('off')\n",
|
| 623 |
-
"\n",
|
| 624 |
-
"plt.tight_layout()\n",
|
| 625 |
-
"plt.show()\n"
|
| 626 |
-
]
|
| 627 |
-
},
|
| 628 |
-
{
|
| 629 |
-
"cell_type": "code",
|
| 630 |
-
"execution_count": null,
|
| 631 |
-
"id": "19a5df01",
|
| 632 |
-
"metadata": {},
|
| 633 |
-
"outputs": [],
|
| 634 |
-
"source": []
|
| 635 |
-
},
|
| 636 |
-
{
|
| 637 |
-
"cell_type": "code",
|
| 638 |
-
"execution_count": null,
|
| 639 |
-
"id": "b3e304d4",
|
| 640 |
-
"metadata": {},
|
| 641 |
-
"outputs": [],
|
| 642 |
-
"source": []
|
| 643 |
-
},
|
| 644 |
-
{
|
| 645 |
-
"cell_type": "code",
|
| 646 |
-
"execution_count": null,
|
| 647 |
-
"id": "e3212d50",
|
| 648 |
-
"metadata": {},
|
| 649 |
-
"outputs": [],
|
| 650 |
-
"source": []
|
| 651 |
-
},
|
| 652 |
-
{
|
| 653 |
-
"cell_type": "code",
|
| 654 |
-
"execution_count": null,
|
| 655 |
-
"id": "c7bb66c6",
|
| 656 |
-
"metadata": {},
|
| 657 |
-
"outputs": [],
|
| 658 |
-
"source": []
|
| 659 |
-
},
|
| 660 |
-
{
|
| 661 |
-
"cell_type": "code",
|
| 662 |
-
"execution_count": null,
|
| 663 |
-
"id": "d55581c3",
|
| 664 |
-
"metadata": {},
|
| 665 |
-
"outputs": [],
|
| 666 |
-
"source": []
|
| 667 |
-
}
|
| 668 |
-
],
|
| 669 |
-
"metadata": {
|
| 670 |
-
"kernelspec": {
|
| 671 |
-
"display_name": "py39",
|
| 672 |
-
"language": "python",
|
| 673 |
-
"name": "python3"
|
| 674 |
-
},
|
| 675 |
-
"language_info": {
|
| 676 |
-
"codemirror_mode": {
|
| 677 |
-
"name": "ipython",
|
| 678 |
-
"version": 3
|
| 679 |
-
},
|
| 680 |
-
"file_extension": ".py",
|
| 681 |
-
"mimetype": "text/x-python",
|
| 682 |
-
"name": "python",
|
| 683 |
-
"nbconvert_exporter": "python",
|
| 684 |
-
"pygments_lexer": "ipython3",
|
| 685 |
-
"version": "3.9.18"
|
| 686 |
-
}
|
| 687 |
-
},
|
| 688 |
-
"nbformat": 4,
|
| 689 |
-
"nbformat_minor": 5
|
| 690 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Analysis_code/6.optima_models_analysis/extract_result_from_omptimized_models.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Analysis_code/6.optima_models_analysis/optimization_result.csv
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model,data_sample,region,optimization_library,best_csi,n_trials,best_params
|
| 2 |
+
ft_transformer,smote,busan,optuna,0.4524714686603366,100,"{'d_token': 96, 'n_blocks': 2, 'n_heads': 4, 'attention_dropout': 0.39058519125437824, 'ffn_dropout': 0.35781462874340314, 'lr': 0.0006705029713893173, 'weight_decay': 0.0001426209011329072, 'batch_size': 32}"
|
| 3 |
+
ft_transformer,pure,daegu,optuna,0.3846594392002736,100,"{'d_token': 224, 'n_blocks': 2, 'n_heads': 8, 'attention_dropout': 0.2747124536980523, 'ffn_dropout': 0.1909754518903343, 'lr': 0.00016739997447268043, 'weight_decay': 0.027811856175591093, 'batch_size': 32}"
|
| 4 |
+
xgb,smotenc_ctgan20000,daegu,hyperopt,0.4277,100,"{'colsample_bytree': 0.7114033147242765, 'gamma': 0.9625212091684073, 'learning_rate': 0.029642239831837253, 'max_depth': 12.0, 'min_child_weight': 10.0, 'reg_alpha': 0.1587708255877442, 'reg_lambda': 0.4648399906011745, 'subsample': 0.90006374997474}"
|
| 5 |
+
resnet_like,pure,seoul,optuna,0.5566756722322981,100,"{'d_main': 96, 'd_hidden': 512, 'n_blocks': 2, 'dropout_first': 0.3834324386470386, 'dropout_second': 0.029813309707734794, 'lr': 0.0005002634113960448, 'weight_decay': 0.05408195750724482, 'batch_size': 32}"
|
| 6 |
+
resnet_like,smote,gwangju,optuna,0.48671080174496345,100,"{'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, 'dropout_first': 0.2808602138036661, 'dropout_second': 0.14619910058769206, 'lr': 0.0055368090707776305, 'weight_decay': 0.001341561695377514, 'batch_size': 256}"
|
| 7 |
+
resnet_like,smotenc_ctgan20000,busan,optuna,0.45568873098715307,100,"{'d_main': 256, 'd_hidden': 512, 'n_blocks': 3, 'dropout_first': 0.1045169105881141, 'dropout_second': 0.05372596450552944, 'lr': 0.00943776593390798, 'weight_decay': 0.0010575459741554466, 'batch_size': 128}"
|
| 8 |
+
ft_transformer,smote,daegu,optuna,0.40272068323222654,100,"{'d_token': 96, 'n_blocks': 3, 'n_heads': 8, 'attention_dropout': 0.2530528162951749, 'ffn_dropout': 0.1899328578250674, 'lr': 0.0013866055842525612, 'weight_decay': 0.00020752948982868583, 'batch_size': 64}"
|
| 9 |
+
xgb,ctgan10000,daejeon,hyperopt,0.5029,100,"{'colsample_bytree': 0.7816067762051363, 'gamma': 0.5799629095615334, 'learning_rate': 0.06287412401679013, 'max_depth': 3.0, 'min_child_weight': 5.0, 'reg_alpha': 0.36731169488772253, 'reg_lambda': 0.03192020366519255, 'subsample': 0.6004605601176048}"
|
| 10 |
+
resnet_like,smotenc_ctgan20000,gwangju,optuna,0.4937343167803819,100,"{'d_main': 64, 'd_hidden': 256, 'n_blocks': 3, 'dropout_first': 0.3792559101674334, 'dropout_second': 0.19251437428644594, 'lr': 0.00405325576056642, 'weight_decay': 0.0005628495861261046, 'batch_size': 128}"
|
| 11 |
+
lgb,smote,seoul,hyperopt,0.5895,100,"{'colsample_bytree': 0.7712993813350446, 'learning_rate': 0.014764448164722338, 'max_depth': 13.0, 'min_child_weight': 2.0, 'num_leaves': 144.0, 'reg_alpha': 0.9375760221934153, 'reg_lambda': 0.6881109653195318, 'subsample': 0.6932106255794361}"
|
| 12 |
+
ft_transformer,pure,busan,optuna,0.44685896765010097,100,"{'d_token': 192, 'n_blocks': 3, 'n_heads': 8, 'attention_dropout': 0.11973480060658612, 'ffn_dropout': 0.15614454735278546, 'lr': 0.00016413327466283583, 'weight_decay': 0.002548468041818763, 'batch_size': 64}"
|
| 13 |
+
ft_transformer,ctgan10000,gwangju,optuna,0.5052817328725289,100,"{'d_token': 160, 'n_blocks': 3, 'n_heads': 4, 'attention_dropout': 0.21128609103276186, 'ffn_dropout': 0.18610731195171396, 'lr': 0.0019139767886005993, 'weight_decay': 0.03127877612669642, 'batch_size': 128}"
|
| 14 |
+
xgb,ctgan10000,gwangju,hyperopt,0.4999,100,"{'colsample_bytree': 0.9825715751506052, 'gamma': 0.029399796024525915, 'learning_rate': 0.08575762330828458, 'max_depth': 11.0, 'min_child_weight': 8.0, 'reg_alpha': 0.8534545581720909, 'reg_lambda': 0.43478744549007325, 'subsample': 0.7629247503643918}"
|
| 15 |
+
resnet_like,smote,daejeon,optuna,0.48175460460533026,100,"{'d_main': 192, 'd_hidden': 64, 'n_blocks': 4, 'dropout_first': 0.3137027413848088, 'dropout_second': 0.18760941198412298, 'lr': 0.00565595693998524, 'weight_decay': 0.04866049178978196, 'batch_size': 128}"
|
| 16 |
+
ft_transformer,smotenc_ctgan20000,busan,optuna,0.4767443843216419,100,"{'d_token': 128, 'n_blocks': 2, 'n_heads': 8, 'attention_dropout': 0.1711218539171086, 'ffn_dropout': 0.2636519595986711, 'lr': 0.004358575253869887, 'weight_decay': 0.00046754184762985804, 'batch_size': 256}"
|
| 17 |
+
xgb,ctgan10000,daegu,hyperopt,0.4392,100,"{'colsample_bytree': 0.8557253370653987, 'gamma': 1.1563957561197729, 'learning_rate': 0.19232018363683898, 'max_depth': 10.0, 'min_child_weight': 8.0, 'reg_alpha': 0.21149066093980878, 'reg_lambda': 0.2690618200166374, 'subsample': 0.714526167464626}"
|
| 18 |
+
deepgbm,smote,gwangju,optuna,0.45804386918458945,100,"{'d_main': 160, 'd_hidden': 64, 'n_blocks': 2, 'dropout': 0.1698480826585593, 'lr': 0.0003762961039889282, 'weight_decay': 0.0014343061148430866, 'batch_size': 64}"
|
| 19 |
+
ft_transformer,ctgan10000,seoul,optuna,0.5936576575682742,100,"{'d_token': 224, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.15689079322421481, 'ffn_dropout': 0.27970845546044715, 'lr': 0.00011858823893766563, 'weight_decay': 0.02942637540327823, 'batch_size': 64}"
|
| 20 |
+
lgb,smote,daejeon,hyperopt,0.5317,100,"{'colsample_bytree': 0.7585295616897205, 'learning_rate': 0.012807299958074884, 'max_depth': 8.0, 'min_child_weight': 2.0, 'num_leaves': 149.0, 'reg_alpha': 0.8175154308532824, 'reg_lambda': 0.7481509687757377, 'subsample': 0.8155067304500027}"
|
| 21 |
+
resnet_like,pure,incheon,optuna,0.5717111423727251,100,"{'d_main': 224, 'd_hidden': 256, 'n_blocks': 4, 'dropout_first': 0.3502671083503836, 'dropout_second': 0.15938013319711236, 'lr': 0.0006801289543741389, 'weight_decay': 0.005292744372677132, 'batch_size': 128}"
|
| 22 |
+
lgb,ctgan10000,daejeon,hyperopt,0.4908,100,"{'colsample_bytree': 0.7077604272501928, 'learning_rate': 0.10351387699107398, 'max_depth': 6.0, 'min_child_weight': 4.0, 'num_leaves': 51.0, 'reg_alpha': 0.06973941883143871, 'reg_lambda': 0.8477821589656351, 'subsample': 0.8664583588640111}"
|
| 23 |
+
lgb,smotenc_ctgan20000,daegu,hyperopt,0.4455,100,"{'colsample_bytree': 0.9935566129264934, 'learning_rate': 0.011803766157843702, 'max_depth': 10.0, 'min_child_weight': 18.0, 'num_leaves': 78.0, 'reg_alpha': 0.5555179443217245, 'reg_lambda': 0.23478947295729824, 'subsample': 0.7059612447576378}"
|
| 24 |
+
deepgbm,smotenc_ctgan20000,busan,optuna,0.40671898361820197,100,"{'d_main': 64, 'd_hidden': 256, 'n_blocks': 3, 'dropout': 0.2843714965028271, 'lr': 0.009315324608427497, 'weight_decay': 0.022174119634941862, 'batch_size': 128}"
|
| 25 |
+
ft_transformer,smotenc_ctgan20000,daejeon,optuna,0.4794390839030278,100,"{'d_token': 64, 'n_blocks': 3, 'n_heads': 4, 'attention_dropout': 0.13096961306141697, 'ffn_dropout': 0.10368225384926379, 'lr': 0.0008212785631177437, 'weight_decay': 0.0007599672775598784, 'batch_size': 32}"
|
| 26 |
+
lgb,ctgan10000,busan,hyperopt,0.4836,100,"{'colsample_bytree': 0.7243835590014314, 'learning_rate': 0.052472053724070156, 'max_depth': 15.0, 'min_child_weight': 9.0, 'num_leaves': 120.0, 'reg_alpha': 0.566895668532905, 'reg_lambda': 0.9659771198744264, 'subsample': 0.8425484904296862}"
|
| 27 |
+
ft_transformer,pure,daejeon,optuna,0.4655886251588111,100,"{'d_token': 64, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.24759508454949322, 'ffn_dropout': 0.2013907953941948, 'lr': 0.0003711331440914647, 'weight_decay': 0.06954769328501528, 'batch_size': 32}"
|
| 28 |
+
xgb,pure,gwangju,hyperopt,0.5016,100,"{'colsample_bytree': 0.9713207386536029, 'gamma': 2.2482753887012703, 'learning_rate': 0.16732973947259167, 'max_depth': 8.0, 'min_child_weight': 3.0, 'reg_alpha': 0.2664406256084806, 'reg_lambda': 0.7263114796775476, 'subsample': 0.6483131273031051}"
|
| 29 |
+
ft_transformer,pure,seoul,optuna,0.562070126103511,100,"{'d_token': 256, 'n_blocks': 2, 'n_heads': 4, 'attention_dropout': 0.2855445640312001, 'ffn_dropout': 0.20563167448836292, 'lr': 7.430025637172839e-05, 'weight_decay': 0.012136192435211931, 'batch_size': 32}"
|
| 30 |
+
resnet_like,smote,busan,optuna,0.4473603019416436,100,"{'d_main': 128, 'd_hidden': 256, 'n_blocks': 5, 'dropout_first': 0.37677375956516684, 'dropout_second': 0.18705700465884292, 'lr': 0.005004477317296484, 'weight_decay': 0.00012190453086381686, 'batch_size': 64}"
|
| 31 |
+
deepgbm,pure,incheon,optuna,0.5622375492647842,100,"{'d_main': 64, 'd_hidden': 256, 'n_blocks': 2, 'dropout': 0.3553750103803738, 'lr': 0.0017038392317957017, 'weight_decay': 0.04010324241876258, 'batch_size': 32}"
|
| 32 |
+
ft_transformer,smote,gwangju,optuna,0.48424711598330084,100,"{'d_token': 96, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.19167241349972552, 'ffn_dropout': 0.10372384139481815, 'lr': 0.0003028578585093515, 'weight_decay': 0.021302792376896054, 'batch_size': 32}"
|
| 33 |
+
lgb,pure,busan,hyperopt,0.4849,100,"{'colsample_bytree': 0.9406061312055983, 'learning_rate': 0.17468151642796886, 'max_depth': 6.0, 'min_child_weight': 17.0, 'num_leaves': 138.0, 'reg_alpha': 0.4593420461637059, 'reg_lambda': 0.5948987302333338, 'subsample': 0.6557839186758097}"
|
| 34 |
+
xgb,ctgan10000,seoul,hyperopt,0.5824,100,"{'colsample_bytree': 0.8837225390968168, 'gamma': 0.1115044781500254, 'learning_rate': 0.10805110293567466, 'max_depth': 12.0, 'min_child_weight': 4.0, 'reg_alpha': 0.02183712172236562, 'reg_lambda': 0.6932207560084631, 'subsample': 0.6767341133785678}"
|
| 35 |
+
resnet_like,ctgan10000,gwangju,optuna,0.510302842874457,100,"{'d_main': 64, 'd_hidden': 320, 'n_blocks': 3, 'dropout_first': 0.29522157561687634, 'dropout_second': 0.15684305218104422, 'lr': 0.008180657303015811, 'weight_decay': 0.01303718192830624, 'batch_size': 128}"
|
| 36 |
+
deepgbm,pure,busan,optuna,0.4429286988285861,100,"{'d_main': 192, 'd_hidden': 64, 'n_blocks': 3, 'dropout': 0.2275228702990485, 'lr': 0.002636923316902024, 'weight_decay': 0.05132270066782015, 'batch_size': 32}"
|
| 37 |
+
ft_transformer,ctgan10000,busan,optuna,0.4960458104166546,100,"{'d_token': 224, 'n_blocks': 2, 'n_heads': 8, 'attention_dropout': 0.3873943566967484, 'ffn_dropout': 0.14296280926606936, 'lr': 0.0007665967810279031, 'weight_decay': 0.00878158688959246, 'batch_size': 32}"
|
| 38 |
+
resnet_like,ctgan10000,daejeon,optuna,0.5101768615009369,100,"{'d_main': 128, 'd_hidden': 256, 'n_blocks': 5, 'dropout_first': 0.1381181811099212, 'dropout_second': 0.11702484025760711, 'lr': 0.0064016726045039805, 'weight_decay': 0.004366638608686326, 'batch_size': 256}"
|
| 39 |
+
resnet_like,smotenc_ctgan20000,incheon,optuna,0.5707798446437679,100,"{'d_main': 224, 'd_hidden': 256, 'n_blocks': 4, 'dropout_first': 0.3626907864360457, 'dropout_second': 0.08738106548329602, 'lr': 0.005205322934309404, 'weight_decay': 0.0002577881849067971, 'batch_size': 256}"
|
| 40 |
+
xgb,pure,daegu,hyperopt,0.4409,100,"{'colsample_bytree': 0.8800494992202731, 'gamma': 0.28651615767316957, 'learning_rate': 0.025526450870185433, 'max_depth': 3.0, 'min_child_weight': 5.0, 'reg_alpha': 0.6787273055071508, 'reg_lambda': 0.6641153401816423, 'subsample': 0.7222783789369407}"
|
| 41 |
+
ft_transformer,smotenc_ctgan20000,daegu,optuna,0.4488825045464337,100,"{'d_token': 64, 'n_blocks': 3, 'n_heads': 4, 'attention_dropout': 0.270864990314075, 'ffn_dropout': 0.3735925199999471, 'lr': 0.0016588396308948813, 'weight_decay': 0.00014669112268617685, 'batch_size': 128}"
|
| 42 |
+
resnet_like,ctgan10000,daegu,optuna,0.46086300130604796,100,"{'d_main': 96, 'd_hidden': 256, 'n_blocks': 3, 'dropout_first': 0.27926914874893893, 'dropout_second': 0.13114004557533837, 'lr': 0.004133395383387492, 'weight_decay': 0.05462768451276688, 'batch_size': 32}"
|
| 43 |
+
deepgbm,smote,daegu,optuna,0.3991148650568916,100,"{'d_main': 64, 'd_hidden': 192, 'n_blocks': 5, 'dropout': 0.15327234825163508, 'lr': 0.0021257323880618864, 'weight_decay': 0.06824750948093047, 'batch_size': 32}"
|
| 44 |
+
deepgbm,smote,seoul,optuna,0.5551122990255606,100,"{'d_main': 64, 'd_hidden': 64, 'n_blocks': 2, 'dropout': 0.2869842021080176, 'lr': 0.002077449117732186, 'weight_decay': 0.00019614736051849963, 'batch_size': 32}"
|
| 45 |
+
lgb,smote,incheon,hyperopt,0.5986,100,"{'colsample_bytree': 0.7149911519913482, 'learning_rate': 0.14061649313221522, 'max_depth': 4.0, 'min_child_weight': 4.0, 'num_leaves': 46.0, 'reg_alpha': 0.3323739596170201, 'reg_lambda': 0.3615804769440283, 'subsample': 0.7361106038020775}"
|
| 46 |
+
deepgbm,ctgan10000,daejeon,optuna,0.5101248146449113,100,"{'d_main': 64, 'd_hidden': 256, 'n_blocks': 2, 'dropout': 0.2845653149911174, 'lr': 0.0030479748817488737, 'weight_decay': 0.08478209494184558, 'batch_size': 32}"
|
| 47 |
+
resnet_like,smote,seoul,optuna,0.5589425055467122,100,"{'d_main': 128, 'd_hidden': 512, 'n_blocks': 3, 'dropout_first': 0.3304233130420639, 'dropout_second': 0.14346618645388706, 'lr': 0.006514721583103225, 'weight_decay': 0.0719094067694046, 'batch_size': 64}"
|
| 48 |
+
deepgbm,smote,incheon,optuna,0.5640599235240535,100,"{'d_main': 128, 'd_hidden': 192, 'n_blocks': 4, 'dropout': 0.3785345227219112, 'lr': 0.0018955834640803318, 'weight_decay': 0.02389399379756967, 'batch_size': 32}"
|
| 49 |
+
xgb,smote,gwangju,hyperopt,0.53,100,"{'colsample_bytree': 0.7658195937298418, 'gamma': 1.040884657831581, 'learning_rate': 0.04553328563585195, 'max_depth': 7.0, 'min_child_weight': 12.0, 'reg_alpha': 0.8031012977426317, 'reg_lambda': 0.6205464163959697, 'subsample': 0.6524796151581305}"
|
| 50 |
+
xgb,smotenc_ctgan20000,incheon,hyperopt,0.5653,100,"{'colsample_bytree': 0.780674346441659, 'gamma': 1.066921965325722, 'learning_rate': 0.09975688732352224, 'max_depth': 11.0, 'min_child_weight': 8.0, 'reg_alpha': 0.8401568358231439, 'reg_lambda': 0.6475753573884905, 'subsample': 0.6026764334015118}"
|
| 51 |
+
lgb,pure,gwangju,hyperopt,0.4976,100,"{'colsample_bytree': 0.944925569294789, 'learning_rate': 0.014333972349102263, 'max_depth': 13.0, 'min_child_weight': 13.0, 'num_leaves': 70.0, 'reg_alpha': 0.31059473707139207, 'reg_lambda': 0.19125854192836045, 'subsample': 0.6106523377701687}"
|
| 52 |
+
lgb,pure,incheon,hyperopt,0.5617,100,"{'colsample_bytree': 0.7451758674748375, 'learning_rate': 0.012136256520039064, 'max_depth': 10.0, 'min_child_weight': 9.0, 'num_leaves': 89.0, 'reg_alpha': 0.41323940989949803, 'reg_lambda': 0.9961125910856155, 'subsample': 0.7322009271446389}"
|
| 53 |
+
deepgbm,pure,daejeon,optuna,0.45092661677493817,100,"{'d_main': 256, 'd_hidden': 64, 'n_blocks': 2, 'dropout': 0.16512768923755844, 'lr': 0.00013316728360925615, 'weight_decay': 0.0001651587899552549, 'batch_size': 32}"
|
| 54 |
+
xgb,smote,daegu,hyperopt,0.4672,100,"{'colsample_bytree': 0.8132816721507904, 'gamma': 0.9002659162503241, 'learning_rate': 0.04046864452016672, 'max_depth': 4.0, 'min_child_weight': 17.0, 'reg_alpha': 0.4681545450085154, 'reg_lambda': 0.531313515098387, 'subsample': 0.827198506312037}"
|
| 55 |
+
ft_transformer,ctgan10000,daegu,optuna,0.44918319157422554,100,"{'d_token': 128, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.1615322006432558, 'ffn_dropout': 0.14353691142809796, 'lr': 0.00025225999310114116, 'weight_decay': 0.002948085679186959, 'batch_size': 32}"
|
| 56 |
+
ft_transformer,smote,incheon,optuna,0.5674050423289939,100,"{'d_token': 96, 'n_blocks': 3, 'n_heads': 8, 'attention_dropout': 0.3637871224837107, 'ffn_dropout': 0.11479322703553738, 'lr': 0.0003009840584939789, 'weight_decay': 0.0003336039035587163, 'batch_size': 32}"
|
| 57 |
+
deepgbm,ctgan10000,busan,optuna,0.475435864212341,100,"{'d_main': 128, 'd_hidden': 128, 'n_blocks': 2, 'dropout': 0.1477619274404685, 'lr': 0.00606559205480389, 'weight_decay': 0.08582651929034574, 'batch_size': 64}"
|
| 58 |
+
resnet_like,ctgan10000,seoul,optuna,0.5889744558864985,100,"{'d_main': 160, 'd_hidden': 128, 'n_blocks': 4, 'dropout_first': 0.24169683403631037, 'dropout_second': 0.018646743579449815, 'lr': 0.003891520111503718, 'weight_decay': 0.09736563298725749, 'batch_size': 128}"
|
| 59 |
+
ft_transformer,smotenc_ctgan20000,seoul,optuna,0.5675273679868712,100,"{'d_token': 192, 'n_blocks': 4, 'n_heads': 8, 'attention_dropout': 0.10255871141670557, 'ffn_dropout': 0.3735851591876593, 'lr': 0.00038893486056538687, 'weight_decay': 0.0020864133600508325, 'batch_size': 128}"
|
| 60 |
+
lgb,smotenc_ctgan20000,incheon,hyperopt,0.5827,100,"{'colsample_bytree': 0.8256738533611337, 'learning_rate': 0.03224794137518454, 'max_depth': 12.0, 'min_child_weight': 6.0, 'num_leaves': 128.0, 'reg_alpha': 0.1310437036184594, 'reg_lambda': 0.6161059673451368, 'subsample': 0.8412610992284884}"
|
| 61 |
+
deepgbm,smotenc_ctgan20000,incheon,optuna,0.5515777046032605,100,"{'d_main': 64, 'd_hidden': 256, 'n_blocks': 6, 'dropout': 0.10014845072807586, 'lr': 0.008578508208533469, 'weight_decay': 0.07361767414227417, 'batch_size': 256}"
|
| 62 |
+
lgb,smote,busan,hyperopt,0.4798,100,"{'colsample_bytree': 0.8798108126736107, 'learning_rate': 0.018973645502331604, 'max_depth': 15.0, 'min_child_weight': 12.0, 'num_leaves': 147.0, 'reg_alpha': 0.03444822116314217, 'reg_lambda': 0.19407225134838502, 'subsample': 0.7009485341014761}"
|
| 63 |
+
lgb,ctgan10000,daegu,hyperopt,0.4339,100,"{'colsample_bytree': 0.885595994008888, 'learning_rate': 0.010106842270671093, 'max_depth': 14.0, 'min_child_weight': 1.0, 'num_leaves': 122.0, 'reg_alpha': 0.12648188723964116, 'reg_lambda': 0.873682924904797, 'subsample': 0.7806598236159817}"
|
| 64 |
+
lgb,ctgan10000,gwangju,hyperopt,0.4994,100,"{'colsample_bytree': 0.9974290644555891, 'learning_rate': 0.03488079849604818, 'max_depth': 15.0, 'min_child_weight': 13.0, 'num_leaves': 47.0, 'reg_alpha': 0.22968749134640387, 'reg_lambda': 0.42745540115072206, 'subsample': 0.9875948361694687}"
|
| 65 |
+
deepgbm,smotenc_ctgan20000,daegu,optuna,0.43407422794617584,100,"{'d_main': 160, 'd_hidden': 192, 'n_blocks': 2, 'dropout': 0.2100809214334562, 'lr': 0.0045042768238180075, 'weight_decay': 0.09966580216480231, 'batch_size': 32}"
|
| 66 |
+
deepgbm,pure,gwangju,optuna,0.4507852210916714,100,"{'d_main': 96, 'd_hidden': 256, 'n_blocks': 4, 'dropout': 0.22201246225002172, 'lr': 0.0018802322915298384, 'weight_decay': 0.04341402361540322, 'batch_size': 64}"
|
| 67 |
+
lgb,smote,daegu,hyperopt,0.4671,100,"{'colsample_bytree': 0.999946333457191, 'learning_rate': 0.07031680296643952, 'max_depth': 4.0, 'min_child_weight': 17.0, 'num_leaves': 32.0, 'reg_alpha': 0.055815317687804816, 'reg_lambda': 0.2293760134119255, 'subsample': 0.6363907923464539}"
|
| 68 |
+
lgb,smotenc_ctgan20000,daejeon,hyperopt,0.5056,100,"{'colsample_bytree': 0.7827606965781482, 'learning_rate': 0.013695421561409111, 'max_depth': 13.0, 'min_child_weight': 6.0, 'num_leaves': 147.0, 'reg_alpha': 0.11677800966310199, 'reg_lambda': 0.7741495746536297, 'subsample': 0.7509016581783318}"
|
| 69 |
+
xgb,pure,incheon,hyperopt,0.566,100,"{'colsample_bytree': 0.7546508432340249, 'gamma': 1.043370422174196, 'learning_rate': 0.015864658027101238, 'max_depth': 11.0, 'min_child_weight': 6.0, 'reg_alpha': 0.7662203770275335, 'reg_lambda': 0.5754328276715727, 'subsample': 0.6332898543620008}"
|
| 70 |
+
deepgbm,smotenc_ctgan20000,gwangju,optuna,0.4832850681063274,100,"{'d_main': 192, 'd_hidden': 128, 'n_blocks': 5, 'dropout': 0.3184031589315668, 'lr': 0.00908394353608693, 'weight_decay': 0.005195807637314873, 'batch_size': 64}"
|
| 71 |
+
lgb,smotenc_ctgan20000,gwangju,hyperopt,0.5098,100,"{'colsample_bytree': 0.9823131365674758, 'learning_rate': 0.09913135171477433, 'max_depth': 12.0, 'min_child_weight': 9.0, 'num_leaves': 123.0, 'reg_alpha': 0.7300219334294252, 'reg_lambda': 0.1069375287034794, 'subsample': 0.6733134215038767}"
|
| 72 |
+
deepgbm,ctgan10000,incheon,optuna,0.5644485264432356,100,"{'d_main': 64, 'd_hidden': 192, 'n_blocks': 5, 'dropout': 0.16846849111235224, 'lr': 0.007871644587352598, 'weight_decay': 0.0005399258093557023, 'batch_size': 128}"
|
| 73 |
+
ft_transformer,pure,gwangju,optuna,0.46517686569307726,100,"{'d_token': 64, 'n_blocks': 3, 'n_heads': 4, 'attention_dropout': 0.22191677554696004, 'ffn_dropout': 0.3593673195268826, 'lr': 0.001039914773988631, 'weight_decay': 0.002578609852830777, 'batch_size': 64}"
|
| 74 |
+
xgb,smotenc_ctgan20000,seoul,hyperopt,0.5595,100,"{'colsample_bytree': 0.8639896996820762, 'gamma': 1.3315807011964704, 'learning_rate': 0.15781883407025307, 'max_depth': 4.0, 'min_child_weight': 8.0, 'reg_alpha': 0.4792043224918665, 'reg_lambda': 0.2705699063386674, 'subsample': 0.6068794375013623}"
|
| 75 |
+
lgb,smotenc_ctgan20000,busan,hyperopt,0.4447,100,"{'colsample_bytree': 0.6317882901026403, 'learning_rate': 0.16009804087232835, 'max_depth': 12.0, 'min_child_weight': 7.0, 'num_leaves': 79.0, 'reg_alpha': 0.7559497285087418, 'reg_lambda': 0.36818298791457293, 'subsample': 0.6759358549390172}"
|
| 76 |
+
ft_transformer,ctgan10000,daejeon,optuna,0.5026041056392309,100,"{'d_token': 64, 'n_blocks': 5, 'n_heads': 8, 'attention_dropout': 0.39639878146052787, 'ffn_dropout': 0.16243660840447227, 'lr': 0.0005258652715359098, 'weight_decay': 0.06319928258911829, 'batch_size': 128}"
|
| 77 |
+
lgb,pure,seoul,hyperopt,0.5561,100,"{'colsample_bytree': 0.9656226027993231, 'learning_rate': 0.19802455575535455, 'max_depth': 9.0, 'min_child_weight': 20.0, 'num_leaves': 40.0, 'reg_alpha': 0.9688960116885452, 'reg_lambda': 0.8497573873429717, 'subsample': 0.9553638492982583}"
|
| 78 |
+
ft_transformer,pure,incheon,optuna,0.5673234518633549,100,"{'d_token': 96, 'n_blocks': 4, 'n_heads': 4, 'attention_dropout': 0.12006219567079585, 'ffn_dropout': 0.19152888035195653, 'lr': 0.0011919865831209798, 'weight_decay': 0.00010616617862067153, 'batch_size': 128}"
|
| 79 |
+
xgb,smote,daejeon,hyperopt,0.5371,100,"{'colsample_bytree': 0.733236256331133, 'gamma': 0.7990977235867733, 'learning_rate': 0.17558281930946487, 'max_depth': 9.0, 'min_child_weight': 11.0, 'reg_alpha': 0.1596833778659402, 'reg_lambda': 0.9170555745286906, 'subsample': 0.6403574066792026}"
|
| 80 |
+
xgb,pure,seoul,hyperopt,0.5722,100,"{'colsample_bytree': 0.9998832589057977, 'gamma': 1.1284338309478381, 'learning_rate': 0.07547053757720854, 'max_depth': 11.0, 'min_child_weight': 3.0, 'reg_alpha': 0.005163550196038334, 'reg_lambda': 0.7838372117209551, 'subsample': 0.6965117137201219}"
|
| 81 |
+
deepgbm,smote,daejeon,optuna,0.4669846754411795,100,"{'d_main': 128, 'd_hidden': 192, 'n_blocks': 2, 'dropout': 0.17471030464369763, 'lr': 0.0034006630423833845, 'weight_decay': 0.008657423885357477, 'batch_size': 32}"
|
| 82 |
+
lgb,ctgan10000,seoul,hyperopt,0.5671,100,"{'colsample_bytree': 0.661683034534645, 'learning_rate': 0.02117850018558707, 'max_depth': 15.0, 'min_child_weight': 16.0, 'num_leaves': 83.0, 'reg_alpha': 0.6438462886327296, 'reg_lambda': 0.8929153518940249, 'subsample': 0.9547922722157274}"
|
| 83 |
+
resnet_like,smotenc_ctgan20000,daegu,optuna,0.43482923124906,100,"{'d_main': 192, 'd_hidden': 128, 'n_blocks': 3, 'dropout_first': 0.38064877864842067, 'dropout_second': 0.011258432283909839, 'lr': 0.003421315789279206, 'weight_decay': 0.0004979175699002674, 'batch_size': 64}"
|
| 84 |
+
ft_transformer,smote,seoul,optuna,0.5788930444782093,100,"{'d_token': 96, 'n_blocks': 5, 'n_heads': 8, 'attention_dropout': 0.3074211243640513, 'ffn_dropout': 0.27614330827417055, 'lr': 0.0008013502604362781, 'weight_decay': 0.07731586815781724, 'batch_size': 32}"
|
| 85 |
+
xgb,smote,incheon,hyperopt,0.6,100,"{'colsample_bytree': 0.8863531635625073, 'gamma': 1.4432252696586687, 'learning_rate': 0.14431831840673584, 'max_depth': 4.0, 'min_child_weight': 4.0, 'reg_alpha': 0.7656890601027424, 'reg_lambda': 0.5796745106013773, 'subsample': 0.8862819830666011}"
|
| 86 |
+
ft_transformer,smotenc_ctgan20000,gwangju,optuna,0.49840606228991896,100,"{'d_token': 160, 'n_blocks': 3, 'n_heads': 8, 'attention_dropout': 0.13369638195384545, 'ffn_dropout': 0.25693944180246137, 'lr': 0.00046073450640759476, 'weight_decay': 0.0005511169366746759, 'batch_size': 32}"
|
| 87 |
+
lgb,ctgan10000,incheon,hyperopt,0.5592,100,"{'colsample_bytree': 0.7615743363801121, 'learning_rate': 0.032013705340192794, 'max_depth': 12.0, 'min_child_weight': 4.0, 'num_leaves': 135.0, 'reg_alpha': 0.07355917150019742, 'reg_lambda': 0.7693270890686972, 'subsample': 0.8491133431153928}"
|
| 88 |
+
xgb,ctgan10000,incheon,hyperopt,0.5752,100,"{'colsample_bytree': 0.9876604099689714, 'gamma': 2.7259563165720655, 'learning_rate': 0.014353110732979967, 'max_depth': 5.0, 'min_child_weight': 8.0, 'reg_alpha': 0.43412935826888077, 'reg_lambda': 0.45790677460553664, 'subsample': 0.6390967315026312}"
|
| 89 |
+
lgb,smote,gwangju,hyperopt,0.5297,100,"{'colsample_bytree': 0.9919060649789312, 'learning_rate': 0.054631157314326724, 'max_depth': 15.0, 'min_child_weight': 3.0, 'num_leaves': 47.0, 'reg_alpha': 0.9190252546800255, 'reg_lambda': 0.8800706832709921, 'subsample': 0.7859941375783913}"
|
| 90 |
+
deepgbm,smote,busan,optuna,0.44276076380851953,100,"{'d_main': 64, 'd_hidden': 192, 'n_blocks': 3, 'dropout': 0.3745726718399158, 'lr': 0.005338808759265471, 'weight_decay': 0.06558728678415406, 'batch_size': 32}"
|
| 91 |
+
xgb,smotenc_ctgan20000,gwangju,hyperopt,0.5012,100,"{'colsample_bytree': 0.9791354222802998, 'gamma': 1.1338312824344885, 'learning_rate': 0.06507978835501058, 'max_depth': 7.0, 'min_child_weight': 20.0, 'reg_alpha': 0.4224203070076331, 'reg_lambda': 0.548023995725087, 'subsample': 0.6318874518405971}"
|
| 92 |
+
resnet_like,pure,daejeon,optuna,0.4661049144479625,100,"{'d_main': 128, 'd_hidden': 128, 'n_blocks': 5, 'dropout_first': 0.17640987113900017, 'dropout_second': 0.07455114486955416, 'lr': 0.0014433413138854976, 'weight_decay': 0.002550708908998169, 'batch_size': 32}"
|
| 93 |
+
deepgbm,pure,seoul,optuna,0.5441091848294762,100,"{'d_main': 96, 'd_hidden': 256, 'n_blocks': 2, 'dropout': 0.38755576686685356, 'lr': 0.001481020211477321, 'weight_decay': 0.0036076992783665223, 'batch_size': 32}"
|
| 94 |
+
deepgbm,ctgan10000,daegu,optuna,0.4390250453058284,100,"{'d_main': 64, 'd_hidden': 192, 'n_blocks': 2, 'dropout': 0.29112938728448373, 'lr': 0.002745246324742509, 'weight_decay': 0.07823286969698617, 'batch_size': 32}"
|
| 95 |
+
ft_transformer,smotenc_ctgan20000,incheon,optuna,0.5658689261675397,100,"{'d_token': 64, 'n_blocks': 6, 'n_heads': 4, 'attention_dropout': 0.3014135618352386, 'ffn_dropout': 0.2377846194971104, 'lr': 0.0023493513093616647, 'weight_decay': 0.0983836135411264, 'batch_size': 256}"
|
| 96 |
+
xgb,smotenc_ctgan20000,busan,hyperopt,0.4764,100,"{'colsample_bytree': 0.6617270669071449, 'gamma': 1.8648711247698304, 'learning_rate': 0.116012512145597, 'max_depth': 5.0, 'min_child_weight': 8.0, 'reg_alpha': 0.0033591561849573015, 'reg_lambda': 0.6137037380779208, 'subsample': 0.6181654880316922}"
|
| 97 |
+
ft_transformer,smote,daejeon,optuna,0.482035457043179,100,"{'d_token': 64, 'n_blocks': 3, 'n_heads': 8, 'attention_dropout': 0.3951058265943127, 'ffn_dropout': 0.15816355519966163, 'lr': 0.0011481409855838528, 'weight_decay': 0.00011134016766733501, 'batch_size': 64}"
|
| 98 |
+
resnet_like,smote,incheon,optuna,0.5677136089270878,100,"{'d_main': 192, 'd_hidden': 256, 'n_blocks': 3, 'dropout_first': 0.29114464826990016, 'dropout_second': 0.1740467381980997, 'lr': 0.0013843537735809836, 'weight_decay': 0.032020003146016864, 'batch_size': 128}"
|
| 99 |
+
xgb,smote,busan,hyperopt,0.4773,100,"{'colsample_bytree': 0.7955102167770075, 'gamma': 0.16947237102826285, 'learning_rate': 0.04201247161970075, 'max_depth': 11.0, 'min_child_weight': 4.0, 'reg_alpha': 0.9136392250501164, 'reg_lambda': 0.4323511178052387, 'subsample': 0.6554957061124282}"
|
| 100 |
+
xgb,pure,busan,hyperopt,0.4949,100,"{'colsample_bytree': 0.8651175745135303, 'gamma': 2.0220518303820976, 'learning_rate': 0.04196437449161767, 'max_depth': 7.0, 'min_child_weight': 17.0, 'reg_alpha': 0.9213159636887744, 'reg_lambda': 0.9407811453878014, 'subsample': 0.7200034080497129}"
|
| 101 |
+
resnet_like,smotenc_ctgan20000,seoul,optuna,0.5571199836340152,100,"{'d_main': 192, 'd_hidden': 64, 'n_blocks': 5, 'dropout_first': 0.2550924108208247, 'dropout_second': 0.1294554884955162, 'lr': 0.0046329086177801316, 'weight_decay': 0.012820236692231602, 'batch_size': 64}"
|
| 102 |
+
deepgbm,ctgan10000,seoul,optuna,0.5652632820174084,100,"{'d_main': 160, 'd_hidden': 64, 'n_blocks': 3, 'dropout': 0.2113225708109025, 'lr': 0.0038029027900849553, 'weight_decay': 0.0005824342055366228, 'batch_size': 32}"
|
| 103 |
+
xgb,smote,seoul,hyperopt,0.5914,100,"{'colsample_bytree': 0.9204650350059359, 'gamma': 0.006794691671452219, 'learning_rate': 0.08811009219503893, 'max_depth': 12.0, 'min_child_weight': 3.0, 'reg_alpha': 0.6690476963880017, 'reg_lambda': 0.5388102924254845, 'subsample': 0.8320339664880525}"
|
| 104 |
+
resnet_like,ctgan10000,busan,optuna,0.49363300915248276,100,"{'d_main': 128, 'd_hidden': 512, 'n_blocks': 2, 'dropout_first': 0.3784300740258752, 'dropout_second': 0.026029354045211155, 'lr': 0.008483242466300268, 'weight_decay': 0.00016367394584020504, 'batch_size': 128}"
|
| 105 |
+
resnet_like,pure,gwangju,optuna,0.48295928519708414,100,"{'d_main': 224, 'd_hidden': 448, 'n_blocks': 5, 'dropout_first': 0.19145077532270985, 'dropout_second': 0.17709489175426982, 'lr': 0.0013336041583887023, 'weight_decay': 0.012922488005108791, 'batch_size': 32}"
|
| 106 |
+
lgb,pure,daegu,hyperopt,0.405,100,"{'colsample_bytree': 0.7032353545561223, 'learning_rate': 0.027019407889171166, 'max_depth': 3.0, 'min_child_weight': 4.0, 'num_leaves': 134.0, 'reg_alpha': 0.3506952189889989, 'reg_lambda': 0.46506999012541095, 'subsample': 0.9411873767438697}"
|
| 107 |
+
deepgbm,smotenc_ctgan20000,seoul,optuna,0.5657974901513136,100,"{'d_main': 128, 'd_hidden': 64, 'n_blocks': 5, 'dropout': 0.1024240157205574, 'lr': 0.009019177625524915, 'weight_decay': 0.08874117499066106, 'batch_size': 256}"
|
| 108 |
+
resnet_like,ctgan10000,incheon,optuna,0.5876200434398301,100,"{'d_main': 160, 'd_hidden': 192, 'n_blocks': 3, 'dropout_first': 0.213366405042877, 'dropout_second': 0.0616930432275245, 'lr': 0.005092968501532562, 'weight_decay': 0.06153947659623341, 'batch_size': 256}"
|
| 109 |
+
xgb,smotenc_ctgan20000,daejeon,hyperopt,0.4957,100,"{'colsample_bytree': 0.839455487096683, 'gamma': 0.6837674570637463, 'learning_rate': 0.059254118154918205, 'max_depth': 12.0, 'min_child_weight': 16.0, 'reg_alpha': 0.741156478605324, 'reg_lambda': 0.21565422560180894, 'subsample': 0.6536276314951073}"
|
| 110 |
+
xgb,pure,daejeon,hyperopt,0.5098,100,"{'colsample_bytree': 0.7188993723348515, 'gamma': 0.8312229248711611, 'learning_rate': 0.13636264607406778, 'max_depth': 4.0, 'min_child_weight': 4.0, 'reg_alpha': 0.8193564485724522, 'reg_lambda': 0.796595038878536, 'subsample': 0.6408013744463261}"
|
| 111 |
+
xgb,ctgan10000,busan,hyperopt,0.4881,100,"{'colsample_bytree': 0.6875780545091519, 'gamma': 2.658982028747467, 'learning_rate': 0.11595019019771602, 'max_depth': 12.0, 'min_child_weight': 18.0, 'reg_alpha': 0.9071038284958559, 'reg_lambda': 0.2880553949579837, 'subsample': 0.7100915343806586}"
|
| 112 |
+
lgb,smotenc_ctgan20000,seoul,hyperopt,0.5622,100,"{'colsample_bytree': 0.6345219883667235, 'learning_rate': 0.010708867004743688, 'max_depth': 14.0, 'min_child_weight': 14.0, 'num_leaves': 111.0, 'reg_alpha': 0.12632598375404414, 'reg_lambda': 0.632120993668035, 'subsample': 0.6705295797223814}"
|
| 113 |
+
lgb,pure,daejeon,hyperopt,0.4963,100,"{'colsample_bytree': 0.8561310986458904, 'learning_rate': 0.04190098150317689, 'max_depth': 13.0, 'min_child_weight': 10.0, 'num_leaves': 20.0, 'reg_alpha': 0.8699443310189154, 'reg_lambda': 0.6437824460768218, 'subsample': 0.7878286207681128}"
|
| 114 |
+
resnet_like,pure,busan,optuna,0.4542970487265281,100,"{'d_main': 160, 'd_hidden': 128, 'n_blocks': 3, 'dropout_first': 0.3972607776862854, 'dropout_second': 0.13044016240028491, 'lr': 0.009478600883696408, 'weight_decay': 0.009976371611112884, 'batch_size': 64}"
|
| 115 |
+
resnet_like,smote,daegu,optuna,0.39559298655454533,100,"{'d_main': 96, 'd_hidden': 64, 'n_blocks': 4, 'dropout_first': 0.3420738859809193, 'dropout_second': 0.1494827111234321, 'lr': 0.008042182880401372, 'weight_decay': 0.00036799147801704795, 'batch_size': 32}"
|
| 116 |
+
deepgbm,smotenc_ctgan20000,daejeon,optuna,0.4848928597361463,100,"{'d_main': 96, 'd_hidden': 64, 'n_blocks': 6, 'dropout': 0.2751230389403302, 'lr': 0.007765569142416956, 'weight_decay': 0.019237770834817113, 'batch_size': 128}"
|
| 117 |
+
resnet_like,smotenc_ctgan20000,daejeon,optuna,0.48223852799636385,100,"{'d_main': 256, 'd_hidden': 128, 'n_blocks': 2, 'dropout_first': 0.1346841434587851, 'dropout_second': 0.09633438692418629, 'lr': 0.008312402405575084, 'weight_decay': 0.00017010818801516423, 'batch_size': 256}"
|
| 118 |
+
deepgbm,pure,daegu,optuna,0.3570454117885781,100,"{'d_main': 160, 'd_hidden': 64, 'n_blocks': 4, 'dropout': 0.39867335991930597, 'lr': 0.002428396450034936, 'weight_decay': 0.05750366129158036, 'batch_size': 32}"
|
| 119 |
+
resnet_like,pure,daegu,optuna,0.4075222542316909,100,"{'d_main': 192, 'd_hidden': 64, 'n_blocks': 3, 'dropout_first': 0.10590946492415504, 'dropout_second': 0.10708545709499212, 'lr': 0.0012544175963123808, 'weight_decay': 0.08314171375285831, 'batch_size': 32}"
|
| 120 |
+
deepgbm,ctgan10000,gwangju,optuna,0.5204031176113428,100,"{'d_main': 128, 'd_hidden': 192, 'n_blocks': 6, 'dropout': 0.3938212564993552, 'lr': 0.007164979269975063, 'weight_decay': 0.0923681134285374, 'batch_size': 64}"
|
| 121 |
+
ft_transformer,ctgan10000,incheon,optuna,0.5643832267965512,100,"{'d_token': 128, 'n_blocks': 6, 'n_heads': 4, 'attention_dropout': 0.1369145590780379, 'ffn_dropout': 0.16996780951611673, 'lr': 0.0003662598943307626, 'weight_decay': 0.000729119254134465, 'batch_size': 256}"
|
Analysis_code/6.optima_models_analysis/utils.py
ADDED
|
@@ -0,0 +1,1077 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from joblib import load
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
import os
|
| 6 |
+
import sys
|
| 7 |
+
from contextlib import contextmanager
|
| 8 |
+
from io import StringIO
|
| 9 |
+
from typing import Optional, Tuple, List, Dict, Any
|
| 10 |
+
from sklearn.metrics import confusion_matrix
|
| 11 |
+
from sklearn.preprocessing import LabelEncoder
|
| 12 |
+
import shap
|
| 13 |
+
import torch
|
| 14 |
+
import warnings
|
| 15 |
+
# ๋ชจ๋ ๊ฒฝ๊ณ ๋ฌด์
|
| 16 |
+
warnings.filterwarnings('ignore')
|
| 17 |
+
# SHAP ๊ด๋ จ ๊ฒฝ๊ณ ๋ฌด์ (LayerNorm ๋ฑ unrecognized nn.Module ๊ฒฝ๊ณ )
|
| 18 |
+
warnings.filterwarnings('ignore', category=UserWarning, message='.*unrecognized nn.Module.*')
|
| 19 |
+
warnings.filterwarnings('ignore', category=UserWarning, message='.*LayerNorm.*')
|
| 20 |
+
warnings.filterwarnings('ignore', category=UserWarning, message='.*unrecognized.*')
|
| 21 |
+
# SHAP ๋ชจ๋์์ ๋ฐ์ํ๋ ๋ชจ๋ ๊ฒฝ๊ณ ๋ฌด์
|
| 22 |
+
warnings.filterwarnings('ignore', module='shap.*')
|
| 23 |
+
|
| 24 |
+
# ๋ชจ๋ธ ํด๋์ค import๋ฅผ ์ํ ๊ฒฝ๋ก ์ค์ (PyTorch ๋ชจ๋ธ ๋ก๋๋ฅผ ์ํด ํ์)
|
| 25 |
+
# ๋
ธํธ๋ถ ํ๊ฒฝ์์๋ ์๋ํ๋๋ก ์ฌ๋ฌ ๋ฐฉ๋ฒ ์๋
|
| 26 |
+
try:
|
| 27 |
+
# ๋ฐฉ๋ฒ 1: __file__ ์ฌ์ฉ (์ผ๋ฐ Python ์คํฌ๋ฆฝํธ)
|
| 28 |
+
current_file_dir = os.path.dirname(os.path.abspath(__file__))
|
| 29 |
+
models_path = os.path.abspath(os.path.join(current_file_dir, '../models'))
|
| 30 |
+
except NameError:
|
| 31 |
+
# ๋ฐฉ๋ฒ 2: __file__์ด ์๋ ๊ฒฝ์ฐ (๋
ธํธ๋ถ ํ๊ฒฝ) - ํ์ฌ ์์
๋๋ ํ ๋ฆฌ ๊ธฐ์ค
|
| 32 |
+
cwd = os.getcwd()
|
| 33 |
+
# Analysis_code ๋๋ ํ ๋ฆฌ๋ฅผ ์ฐพ๊ธฐ
|
| 34 |
+
if 'Analysis_code' in cwd:
|
| 35 |
+
analysis_code_dir = cwd[:cwd.index('Analysis_code') + len('Analysis_code')]
|
| 36 |
+
models_path = os.path.join(analysis_code_dir, 'models')
|
| 37 |
+
else:
|
| 38 |
+
# ๋ฐฉ๋ฒ 3: ์ ๋ ๊ฒฝ๋ก ์ฌ์ฉ
|
| 39 |
+
models_path = '/workspace/visibility_prediction/Analysis_code/models'
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
if models_path not in sys.path:
|
| 43 |
+
sys.path.insert(0, models_path)
|
| 44 |
+
|
| 45 |
+
from ft_transformer import FTTransformer
|
| 46 |
+
from resnet_like import ResNetLike
|
| 47 |
+
from deepgbm import DeepGBM
|
| 48 |
+
|
| 49 |
+
# ==========================================
|
| 50 |
+
# ์์ ์ ์
|
| 51 |
+
# ==========================================
|
| 52 |
+
FOLD_YEARS = [[2018, 2019], [2018, 2019], [2019, 2020]]
|
| 53 |
+
TEST_YEAR = 2021
|
| 54 |
+
DROP_COLUMNS = ['multi_class', 'year']
|
| 55 |
+
FEATURE_COLUMNS = [
|
| 56 |
+
'temp_C', 'precip_mm', 'wind_speed', 'wind_dir', 'hm',
|
| 57 |
+
'vap_pressure', 'dewpoint_C', 'loc_pressure', 'sea_pressure',
|
| 58 |
+
'solarRad', 'snow_cm', 'cloudcover', 'lm_cloudcover', 'low_cloudbase',
|
| 59 |
+
'groundtemp', 'O3', 'NO2', 'PM10', 'PM25', 'year',
|
| 60 |
+
'month', 'hour', 'ground_temp - temp_C', 'hour_sin', 'hour_cos',
|
| 61 |
+
'month_sin', 'month_cos', 'multi_class'
|
| 62 |
+
]
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
# ==========================================
|
| 66 |
+
# ์ ํธ๋ฆฌํฐ ํจ์
|
| 67 |
+
# ==========================================
|
| 68 |
+
def calculate_csi(y_true: np.ndarray, y_pred: np.ndarray) -> float:
|
| 69 |
+
"""CSI(Critical Success Index) ์ ์๋ฅผ ๊ณ์ฐํฉ๋๋ค.
|
| 70 |
+
|
| 71 |
+
Args:
|
| 72 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 73 |
+
y_pred: ์์ธก ๋ ์ด๋ธ
|
| 74 |
+
|
| 75 |
+
Returns:
|
| 76 |
+
CSI ์ ์ (0~1 ์ฌ์ด์ ๊ฐ)
|
| 77 |
+
"""
|
| 78 |
+
cm = confusion_matrix(y_true, y_pred)
|
| 79 |
+
|
| 80 |
+
# ํผ๋ ํ๋ ฌ์์ H(Hit), F(False alarm), M(Miss) ์ถ์ถ
|
| 81 |
+
H = cm[0, 0] + cm[1, 1]
|
| 82 |
+
F = cm[1, 0] + cm[2, 0] + cm[0, 1] + cm[2, 1]
|
| 83 |
+
M = cm[0, 2] + cm[1, 2]
|
| 84 |
+
|
| 85 |
+
# CSI ๊ณ์ฐ
|
| 86 |
+
csi = H / (H + F + M + 1e-10)
|
| 87 |
+
return csi
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
def csi_metric(y_true: np.ndarray, pred_prob: np.ndarray) -> Tuple[str, float, bool]:
|
| 91 |
+
"""LightGBM์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 92 |
+
|
| 93 |
+
Args:
|
| 94 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 95 |
+
pred_prob: ์์ธก ํ๋ฅ (shape: [n_samples, n_classes])
|
| 96 |
+
|
| 97 |
+
Returns:
|
| 98 |
+
('CSI', score, higher_better) ํํ
|
| 99 |
+
"""
|
| 100 |
+
y_pred_binary = np.argmax(pred_prob, axis=1)
|
| 101 |
+
score = calculate_csi(y_true, y_pred_binary)
|
| 102 |
+
return 'CSI', score, True
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def eval_metric_csi(y_true: np.ndarray, pred_prob: np.ndarray) -> float:
|
| 106 |
+
"""XGBoost์ฉ CSI ๋ฉํธ๋ฆญ ํจ์.
|
| 107 |
+
|
| 108 |
+
Args:
|
| 109 |
+
y_true: ์ค์ ๋ ์ด๋ธ
|
| 110 |
+
pred_prob: ์์ธก ํ๋ฅ
|
| 111 |
+
|
| 112 |
+
Returns:
|
| 113 |
+
CSI ์ ์์ ์์๊ฐ
|
| 114 |
+
"""
|
| 115 |
+
pred = np.argmax(pred_prob, axis=1)
|
| 116 |
+
csi = calculate_csi(y_true, pred)
|
| 117 |
+
return -1*csi
|
| 118 |
+
|
| 119 |
+
def add_derived_features(df: pd.DataFrame) -> pd.DataFrame:
|
| 120 |
+
"""
|
| 121 |
+
์ ๊ฑฐํ๋ ํ์ ๋ณ์๋ค์ ๋ณต๊ตฌ
|
| 122 |
+
|
| 123 |
+
Args:
|
| 124 |
+
df: ๋ฐ์ดํฐํ๋ ์
|
| 125 |
+
|
| 126 |
+
Returns:
|
| 127 |
+
ํ์ ๋ณ์๊ฐ ์ถ๊ฐ๋ ๋ฐ์ดํฐํ๋ ์
|
| 128 |
+
"""
|
| 129 |
+
df = df.copy()
|
| 130 |
+
df['hour_sin'] = np.sin(2 * np.pi * df['hour'] / 24)
|
| 131 |
+
df['hour_cos'] = np.cos(2 * np.pi * df['hour'] / 24)
|
| 132 |
+
df['month_sin'] = np.sin(2 * np.pi * df['month'] / 12)
|
| 133 |
+
df['month_cos'] = np.cos(2 * np.pi * df['month'] / 12)
|
| 134 |
+
df['ground_temp - temp_C'] = df['groundtemp'] - df['temp_C']
|
| 135 |
+
return df
|
| 136 |
+
|
| 137 |
+
def preprocessing(df: pd.DataFrame) -> pd.DataFrame:
|
| 138 |
+
"""๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ํจ์.
|
| 139 |
+
|
| 140 |
+
Args:
|
| 141 |
+
df: ์๋ณธ ๋ฐ์ดํฐํ๋ ์
|
| 142 |
+
|
| 143 |
+
Returns:
|
| 144 |
+
์ ์ฒ๋ฆฌ๋ ๋ฐ์ดํฐํ๋ ์
|
| 145 |
+
"""
|
| 146 |
+
df = df[df.columns].copy()
|
| 147 |
+
df['year'] = df['year'].astype('int')
|
| 148 |
+
df['month'] = df['month'].astype('int')
|
| 149 |
+
df['hour'] = df['hour'].astype('int')
|
| 150 |
+
df = add_derived_features(df).copy()
|
| 151 |
+
df['multi_class'] = df['multi_class'].astype('int')
|
| 152 |
+
df.loc[df['wind_dir']=='์ ์จ', 'wind_dir'] = "0"
|
| 153 |
+
df['wind_dir'] = df['wind_dir'].astype('int')
|
| 154 |
+
df = df[FEATURE_COLUMNS].copy()
|
| 155 |
+
return df
|
| 156 |
+
|
| 157 |
+
def make_dataset_for_boosting_models(
|
| 158 |
+
region: str,
|
| 159 |
+
data_sample: str,
|
| 160 |
+
fold_num: int
|
| 161 |
+
) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
|
| 162 |
+
train_data = pd.read_csv(f"../../data/data_oversampled/{data_sample}/{data_sample}_{fold_num+1}_{region}.csv")
|
| 163 |
+
val_data = pd.read_csv(f"../../data/data_for_modeling/{region}_train.csv")
|
| 164 |
+
test_data = pd.read_csv(f"../../data/data_for_modeling/{region}_test.csv")
|
| 165 |
+
|
| 166 |
+
train_data = preprocessing(train_data).copy()
|
| 167 |
+
val_data = preprocessing(val_data).copy()
|
| 168 |
+
test_data = preprocessing(test_data).copy()
|
| 169 |
+
|
| 170 |
+
train_data = train_data.loc[train_data['year'].isin(FOLD_YEARS[fold_num]), :]
|
| 171 |
+
val_data = val_data.loc[~val_data['year'].isin(FOLD_YEARS[fold_num]), :]
|
| 172 |
+
test_data = test_data.loc[test_data['year'].isin([TEST_YEAR]), :]
|
| 173 |
+
|
| 174 |
+
return train_data, val_data, test_data
|
| 175 |
+
|
| 176 |
+
def load_model(model_name: str, region: str, data_sample: str) -> List[Any]:
|
| 177 |
+
model_path = f"../save_model/{model_name}_optima/{model_name}_{data_sample}_{region}.pkl"
|
| 178 |
+
models = load(model_path)
|
| 179 |
+
return models
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
# ==========================================
|
| 183 |
+
# Tree-based ๋ชจ๋ธ SHAP ๋ถ์ ํจ์
|
| 184 |
+
# ==========================================
|
| 185 |
+
def analyze_shap_values_across_folds(
|
| 186 |
+
model_name: str,
|
| 187 |
+
region: str,
|
| 188 |
+
data_sample: str,
|
| 189 |
+
target_class: int = 0,
|
| 190 |
+
n_folds: int = 3,
|
| 191 |
+
figsize: Tuple[int, int] = (20, 10),
|
| 192 |
+
show_plot: bool = True,
|
| 193 |
+
show_train_plot: bool = True,
|
| 194 |
+
show_test_plot: bool = True,
|
| 195 |
+
suppress_warnings: bool = True,
|
| 196 |
+
top_n: int = 3
|
| 197 |
+
) -> Dict[str, Any]:
|
| 198 |
+
"""
|
| 199 |
+
์ฌ๋ฌ Fold ๋ชจ๋ธ์ ๋ํด SHAP ๊ฐ์ ๊ณ์ฐํ๊ณ ์๊ฐํํ๋ฉฐ, ์์ 3๊ฐ ๋ณ์์ ๊ธฐ์ฌ๋๋ฅผ ๋ถ์ํ๋ ํจ์.
|
| 200 |
+
"""
|
| 201 |
+
|
| 202 |
+
# ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ ๋ฆฌ์คํธ
|
| 203 |
+
oof_shap_values = []
|
| 204 |
+
oof_X_data = []
|
| 205 |
+
test_shap_values = []
|
| 206 |
+
|
| 207 |
+
# ๋ชจ๋ธ ๋ก๋
|
| 208 |
+
models = load_model(model_name, region, data_sample)
|
| 209 |
+
|
| 210 |
+
if len(models) != n_folds:
|
| 211 |
+
raise ValueError(f"๋ก๋๋ ๋ชจ๋ธ ๊ฐ์({len(models)})๊ฐ n_folds({n_folds})์ ์ผ์นํ์ง ์์ต๋๋ค.")
|
| 212 |
+
|
| 213 |
+
# ๊ฐ Fold์ ๋ํด SHAP ๊ฐ ๊ณ์ฐ
|
| 214 |
+
for fold_idx in range(n_folds):
|
| 215 |
+
# ๊ฐ Fold์ ํด๋นํ๋ ๋ฐ์ดํฐ ๋ก๋
|
| 216 |
+
_, val_data, test_data = make_dataset_for_boosting_models(
|
| 217 |
+
region, data_sample, fold_idx
|
| 218 |
+
)
|
| 219 |
+
|
| 220 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ ์ค๋น
|
| 221 |
+
X_val = val_data.drop(columns=DROP_COLUMNS)
|
| 222 |
+
|
| 223 |
+
# ํ
์คํธ ๋ฐ์ดํฐ ์ค๋น (์ฒซ ๋ฒ์งธ fold์์๋ง ์ ์ฅ, ๋๋จธ์ง๋ ๋์ผ)
|
| 224 |
+
if fold_idx == 0:
|
| 225 |
+
X_test = test_data.drop(columns=DROP_COLUMNS)
|
| 226 |
+
|
| 227 |
+
# SHAP Explainer ์์ฑ
|
| 228 |
+
if suppress_warnings:
|
| 229 |
+
with warnings.catch_warnings():
|
| 230 |
+
warnings.filterwarnings('ignore', category=UserWarning, message='.*deprecated binary model format.*')
|
| 231 |
+
explainer = shap.TreeExplainer(models[fold_idx].get_booster())
|
| 232 |
+
else:
|
| 233 |
+
explainer = shap.TreeExplainer(models[fold_idx].get_booster())
|
| 234 |
+
|
| 235 |
+
# ๊ฒ์ฆ ๋ฐ์ดํฐ์ ๋ํ SHAP ๊ฐ ๊ณ์ฐ
|
| 236 |
+
shap_val = explainer.shap_values(X_val)
|
| 237 |
+
|
| 238 |
+
# ํ๊ฒ ํด๋์ค์ ๋ํ SHAP ๊ฐ๋ง ์ถ์ถ
|
| 239 |
+
if isinstance(shap_val, list):
|
| 240 |
+
oof_shap_values.append(shap_val[target_class])
|
| 241 |
+
else:
|
| 242 |
+
oof_shap_values.append(shap_val)
|
| 243 |
+
|
| 244 |
+
oof_X_data.append(X_val)
|
| 245 |
+
|
| 246 |
+
# ํ
์คํธ ๋ฐ์ดํฐ์ ๋ํ SHAP ๊ฐ ๊ณ์ฐ
|
| 247 |
+
shap_test = explainer.shap_values(X_test)
|
| 248 |
+
|
| 249 |
+
# ํ๊ฒ ํด๋์ค์ ๋ํ SHAP ๊ฐ๋ง ์ถ์ถ
|
| 250 |
+
if isinstance(shap_test, list):
|
| 251 |
+
test_shap_values.append(shap_test[target_class])
|
| 252 |
+
else:
|
| 253 |
+
test_shap_values.append(shap_test)
|
| 254 |
+
|
| 255 |
+
# ==========================================
|
| 256 |
+
# ๋ฐ์ดํฐ ํตํฉ
|
| 257 |
+
# ==========================================
|
| 258 |
+
# ํ๋ จ ๊ธฐ๊ฐ(Train) ํตํฉ
|
| 259 |
+
all_shap_train = np.concatenate(oof_shap_values, axis=0)
|
| 260 |
+
all_X_train = pd.concat(oof_X_data, axis=0)
|
| 261 |
+
|
| 262 |
+
# ํ
์คํธ ๊ธฐ๊ฐ(Test, 2021) ํตํฉ: ํ๊ท ์ฌ์ฉ
|
| 263 |
+
all_shap_test = np.mean(test_shap_values, axis=0)
|
| 264 |
+
|
| 265 |
+
# ==========================================
|
| 266 |
+
# ์์ N๊ฐ ๋ณ์ ๊ธฐ์ฌ๋(Cumulative Share) ๊ณ์ฐ
|
| 267 |
+
# ==========================================
|
| 268 |
+
feature_names = all_X_train.columns
|
| 269 |
+
|
| 270 |
+
# Train ๋ฐ์ดํฐ ์ค์๋ ๊ณ์ฐ
|
| 271 |
+
importance_df_train, top_n_features_train, top_n_share_train = _calculate_cumulative_share(
|
| 272 |
+
all_shap_train, feature_names, top_n, period_name='Train Period'
|
| 273 |
+
)
|
| 274 |
+
|
| 275 |
+
# Test ๋ฐ์ดํฐ ์ค์๋ ๊ณ์ฐ
|
| 276 |
+
if all_shap_test is not None:
|
| 277 |
+
importance_df_test, top_n_features_test, top_n_share_test = _calculate_cumulative_share(
|
| 278 |
+
all_shap_test, feature_names, top_n, period_name='Test Period'
|
| 279 |
+
)
|
| 280 |
+
print() # ๋ง์ง๋ง์ ๋น ์ค ์ถ๊ฐ
|
| 281 |
+
else:
|
| 282 |
+
importance_df_test = None
|
| 283 |
+
top_n_share_test = None
|
| 284 |
+
top_n_features_test = None
|
| 285 |
+
|
| 286 |
+
# ==========================================
|
| 287 |
+
# ํตํฉ Feature Importance DataFrame ์์ฑ
|
| 288 |
+
# ==========================================
|
| 289 |
+
importance_df_combined = _create_combined_importance_df(
|
| 290 |
+
importance_df_train, importance_df_test, feature_names
|
| 291 |
+
)
|
| 292 |
+
|
| 293 |
+
# ==========================================
|
| 294 |
+
# ์๊ฐํ
|
| 295 |
+
# ==========================================
|
| 296 |
+
if show_plot:
|
| 297 |
+
_plot_shap_summary(
|
| 298 |
+
all_shap_train, all_X_train, all_shap_test, X_test,
|
| 299 |
+
list(all_X_train.columns), target_class, top_n,
|
| 300 |
+
top_n_share_train=top_n_share_train, top_n_share_test=top_n_share_test,
|
| 301 |
+
show_train_plot=show_train_plot, show_test_plot=show_test_plot, figsize=figsize,
|
| 302 |
+
model_name=model_name, data_sample=data_sample, region=region
|
| 303 |
+
)
|
| 304 |
+
|
| 305 |
+
# ๊ฒฐ๊ณผ ๋ฐํ
|
| 306 |
+
return {
|
| 307 |
+
'shap_train': all_shap_train,
|
| 308 |
+
'X_train': all_X_train,
|
| 309 |
+
'shap_test': all_shap_test,
|
| 310 |
+
'X_test': X_test,
|
| 311 |
+
'top_n_features_train': top_n_features_train, # Train ์์ N๊ฐ ๋ณ์ ๋ฆฌ์คํธ
|
| 312 |
+
'top_n_share_train': top_n_share_train, # Train ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋(%)
|
| 313 |
+
'importance_df_train': importance_df_train, # Train ์ ์ฒด ์ค์๋ ์์ํ
|
| 314 |
+
'top_n_features_test': top_n_features_test, # Test ์์ N๊ฐ ๋ณ์ ๋ฆฌ์คํธ
|
| 315 |
+
'top_n_share_test': top_n_share_test, # Test ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋(%)
|
| 316 |
+
'importance_df_test': importance_df_test, # Test ์ ์ฒด ์ค์๋ ์์ํ
|
| 317 |
+
'importance_df_combined': importance_df_combined # Train/Test ํตํฉ ์ค์๋ DataFrame
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
# ==========================================
|
| 322 |
+
# ๋ฅ๋ฌ๋ ๋ชจ๋ธ SHAP ๋ถ์ ํฌํผ ํด๋์ค ๋ฐ ํจ์
|
| 323 |
+
# ==========================================
|
| 324 |
+
|
| 325 |
+
@contextmanager
|
| 326 |
+
def suppress_shap_output():
|
| 327 |
+
"""SHAP DeepExplainer์ ์ถ๋ ฅ์ ์ต์ ํ๋ ์ปจํ
์คํธ ๋งค๋์ ."""
|
| 328 |
+
old_stdout = sys.stdout
|
| 329 |
+
sys.stdout = StringIO()
|
| 330 |
+
try:
|
| 331 |
+
with warnings.catch_warnings():
|
| 332 |
+
warnings.simplefilter('ignore')
|
| 333 |
+
yield
|
| 334 |
+
finally:
|
| 335 |
+
sys.stdout = old_stdout
|
| 336 |
+
|
| 337 |
+
|
| 338 |
+
class ModelWrapper(torch.nn.Module):
|
| 339 |
+
"""PyTorch ๋ชจ๋ธ์ SHAP DeepExplainer์ ๋ง๊ฒ ๋ํํ๋ ํด๋์ค."""
|
| 340 |
+
|
| 341 |
+
def __init__(self, base_model, numerical_cols):
|
| 342 |
+
super().__init__()
|
| 343 |
+
self.base_model = base_model
|
| 344 |
+
self.num_features = len(numerical_cols)
|
| 345 |
+
|
| 346 |
+
def forward(self, *inputs):
|
| 347 |
+
"""SHAP์ด ๋ฆฌ์คํธ๋ก ์ ๋ฌํ๋ ๊ฒฝ์ฐ ์ฒ๋ฆฌ"""
|
| 348 |
+
if len(inputs) == 1 and isinstance(inputs[0], (list, tuple)):
|
| 349 |
+
x_num, x_cat = inputs[0]
|
| 350 |
+
elif len(inputs) == 2:
|
| 351 |
+
x_num, x_cat = inputs
|
| 352 |
+
else:
|
| 353 |
+
# ๋จ์ผ ์
๋ ฅ (ResNet-like์ ๊ฒฝ์ฐ)
|
| 354 |
+
x = inputs[0]
|
| 355 |
+
x_num = x[:, :self.num_features]
|
| 356 |
+
x_cat = x[:, self.num_features:].long()
|
| 357 |
+
return self.base_model(x_num, x_cat)
|
| 358 |
+
|
| 359 |
+
# categorical์ float๋ก ๋ฐ์์ long์ผ๋ก ๋ณํ (SHAP gradient ๊ณ์ฐ์ ์ํด)
|
| 360 |
+
if x_cat.dtype != torch.long:
|
| 361 |
+
x_cat = x_cat.long()
|
| 362 |
+
|
| 363 |
+
return self.base_model(x_num, x_cat)
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
def _create_shap_explainer(
|
| 367 |
+
model_name: str,
|
| 368 |
+
wrapped_model: torch.nn.Module,
|
| 369 |
+
X_bg_num: torch.Tensor,
|
| 370 |
+
X_bg_cat: torch.Tensor,
|
| 371 |
+
device: str
|
| 372 |
+
) -> shap.DeepExplainer:
|
| 373 |
+
"""SHAP DeepExplainer๋ฅผ ์์ฑํ๋ ํฌํผ ํจ์.
|
| 374 |
+
|
| 375 |
+
Args:
|
| 376 |
+
model_name: ๋ชจ๋ธ ์ด๋ฆ ('ft_transformer', 'resnet_like', 'deepgbm')
|
| 377 |
+
wrapped_model: ๋ํ๋ PyTorch ๋ชจ๋ธ
|
| 378 |
+
X_bg_num: ๋ฐฐ๊ฒฝ ๋ฐ์ดํฐ (numerical)
|
| 379 |
+
X_bg_cat: ๋ฐฐ๊ฒฝ ๋ฐ์ดํฐ (categorical)
|
| 380 |
+
device: ์ฐ์ฐ ์ฅ์น
|
| 381 |
+
|
| 382 |
+
Returns:
|
| 383 |
+
shap.DeepExplainer: ์์ฑ๋ Explainer
|
| 384 |
+
"""
|
| 385 |
+
with suppress_shap_output():
|
| 386 |
+
if model_name in ('ft_transformer', 'deepgbm'):
|
| 387 |
+
X_bg_cat_float = X_bg_cat.float()
|
| 388 |
+
explainer = shap.DeepExplainer(wrapped_model, [X_bg_num, X_bg_cat_float])
|
| 389 |
+
elif model_name == 'resnet_like':
|
| 390 |
+
X_bg_combined = torch.cat([X_bg_num, X_bg_cat.float()], dim=1)
|
| 391 |
+
explainer = shap.DeepExplainer(wrapped_model, X_bg_combined)
|
| 392 |
+
else:
|
| 393 |
+
raise ValueError(f"Unknown model_name: {model_name}")
|
| 394 |
+
|
| 395 |
+
return explainer
|
| 396 |
+
|
| 397 |
+
|
| 398 |
+
def _calculate_shap_values(
|
| 399 |
+
explainer: shap.DeepExplainer,
|
| 400 |
+
model_name: str,
|
| 401 |
+
X_sample_num: torch.Tensor,
|
| 402 |
+
X_sample_cat: torch.Tensor,
|
| 403 |
+
device: str
|
| 404 |
+
) -> Any:
|
| 405 |
+
"""SHAP ๊ฐ์ ๊ณ์ฐํ๋ ํฌํผ ํจ์.
|
| 406 |
+
|
| 407 |
+
Args:
|
| 408 |
+
explainer: SHAP DeepExplainer
|
| 409 |
+
model_name: ๋ชจ๋ธ ์ด๋ฆ ('ft_transformer', 'resnet_like', 'deepgbm')
|
| 410 |
+
X_sample_num: ์ํ ๋ฐ์ดํฐ (numerical)
|
| 411 |
+
X_sample_cat: ์ํ ๋ฐ์ดํฐ (categorical)
|
| 412 |
+
device: ์ฐ์ฐ ์ฅ์น
|
| 413 |
+
|
| 414 |
+
Returns:
|
| 415 |
+
SHAP ๊ฐ (๋ค์ํ ํํ ๊ฐ๋ฅ)
|
| 416 |
+
"""
|
| 417 |
+
with suppress_shap_output():
|
| 418 |
+
if model_name in ('ft_transformer', 'deepgbm'):
|
| 419 |
+
X_sample_cat_float = X_sample_cat.float()
|
| 420 |
+
shap_values = explainer.shap_values([X_sample_num, X_sample_cat_float])
|
| 421 |
+
elif model_name == 'resnet_like':
|
| 422 |
+
X_sample_combined = torch.cat([X_sample_num, X_sample_cat.float()], dim=1)
|
| 423 |
+
shap_values = explainer.shap_values(X_sample_combined)
|
| 424 |
+
else:
|
| 425 |
+
raise ValueError(f"Unknown model_name: {model_name}")
|
| 426 |
+
|
| 427 |
+
return shap_values
|
| 428 |
+
|
| 429 |
+
|
| 430 |
+
def _calculate_cumulative_share(
|
| 431 |
+
shap_values: np.ndarray,
|
| 432 |
+
feature_names: List[str],
|
| 433 |
+
top_n: int,
|
| 434 |
+
period_name: str = ''
|
| 435 |
+
) -> Tuple[pd.DataFrame, List[str], float]:
|
| 436 |
+
"""๋์ ์ค๋ช
๋ ฅ(Cumulative Share)์ ๊ณ์ฐํ๋ ํฌํผ ํจ์.
|
| 437 |
+
|
| 438 |
+
Args:
|
| 439 |
+
shap_values: SHAP ๊ฐ ๋ฐฐ์ด
|
| 440 |
+
feature_names: ํผ์ฒ ์ด๋ฆ ๋ฆฌ์คํธ
|
| 441 |
+
top_n: ์์ N๊ฐ ๋ณ์
|
| 442 |
+
period_name: ๊ธฐ๊ฐ ์ด๋ฆ (์ฝ์ ์ถ๋ ฅ์ฉ, ๊ธฐ๋ณธ๊ฐ: '')
|
| 443 |
+
|
| 444 |
+
Returns:
|
| 445 |
+
tuple: (importance_df, top_n_features, top_n_share)
|
| 446 |
+
"""
|
| 447 |
+
# 1. Global Importance ๊ณ์ฐ (์ ๋๊ฐ์ ํ๊ท )
|
| 448 |
+
global_importances = np.abs(shap_values).mean(axis=0)
|
| 449 |
+
|
| 450 |
+
# 2. DataFrame ์์ฑ ๋ฐ ์ ๋ ฌ
|
| 451 |
+
importance_df = pd.DataFrame({
|
| 452 |
+
'feature': feature_names,
|
| 453 |
+
'importance': global_importances
|
| 454 |
+
}).sort_values('importance', ascending=False)
|
| 455 |
+
|
| 456 |
+
# 3. ์ ์ฒด ์ค์๋ ํฉ๊ณ
|
| 457 |
+
total_importance = importance_df['importance'].sum()
|
| 458 |
+
|
| 459 |
+
# 4. ์์ N๊ฐ ๋ณ์ ์ถ์ถ ๋ฐ ๊ธฐ์ฌ๋ ๊ณ์ฐ
|
| 460 |
+
top_n_df = importance_df.head(top_n)
|
| 461 |
+
top_n_importance = top_n_df['importance'].sum()
|
| 462 |
+
top_n_share = (top_n_importance / total_importance) * 100
|
| 463 |
+
top_n_features = top_n_df['feature'].tolist()
|
| 464 |
+
|
| 465 |
+
# 5. ์ฝ์ ์ถ๋ ฅ
|
| 466 |
+
if period_name:
|
| 467 |
+
print(f"{period_name} - Top {top_n} Dominant Features: {top_n_features}")
|
| 468 |
+
print(f"{period_name} - Cumulative Importance Share (Top {top_n}): {top_n_share:.2f}%")
|
| 469 |
+
else:
|
| 470 |
+
print(f"Top {top_n} Dominant Features: {top_n_features}")
|
| 471 |
+
print(f"Cumulative Importance Share (Top {top_n}): {top_n_share:.2f}%")
|
| 472 |
+
print(f"{'-'*40}")
|
| 473 |
+
|
| 474 |
+
return importance_df, top_n_features, top_n_share
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
def _create_combined_importance_df(
|
| 478 |
+
importance_df_train: Optional[pd.DataFrame],
|
| 479 |
+
importance_df_test: Optional[pd.DataFrame],
|
| 480 |
+
feature_names: List[str]
|
| 481 |
+
) -> Optional[pd.DataFrame]:
|
| 482 |
+
"""Train๊ณผ Test ์ค์๋ DataFrame์ ํตํฉํ๋ ํฌํผ ํจ์.
|
| 483 |
+
|
| 484 |
+
Args:
|
| 485 |
+
importance_df_train: Train ๋ฐ์ดํฐ ์ค์๋ DataFrame
|
| 486 |
+
importance_df_test: Test ๋ฐ์ดํฐ ์ค์๋ DataFrame
|
| 487 |
+
feature_names: ํผ์ฒ ์ด๋ฆ ๋ฆฌ์คํธ
|
| 488 |
+
|
| 489 |
+
Returns:
|
| 490 |
+
ํตํฉ๋ ์ค์๋ DataFrame ๋๋ None
|
| 491 |
+
"""
|
| 492 |
+
if importance_df_train is None and importance_df_test is None:
|
| 493 |
+
return None
|
| 494 |
+
|
| 495 |
+
# Train ๋ฐ์ดํฐ ์ค๋น
|
| 496 |
+
if importance_df_train is not None:
|
| 497 |
+
train_df = importance_df_train[['feature', 'importance']].copy()
|
| 498 |
+
train_df.columns = ['feature', 'importance_train']
|
| 499 |
+
total_importance_train = train_df['importance_train'].sum()
|
| 500 |
+
train_df['share_train'] = (train_df['importance_train'] / total_importance_train) * 100
|
| 501 |
+
else:
|
| 502 |
+
train_df = pd.DataFrame({'feature': feature_names})
|
| 503 |
+
train_df['importance_train'] = np.nan
|
| 504 |
+
train_df['share_train'] = np.nan
|
| 505 |
+
|
| 506 |
+
# Test ๋ฐ์ดํฐ ์ค๋น
|
| 507 |
+
if importance_df_test is not None:
|
| 508 |
+
test_df = importance_df_test[['feature', 'importance']].copy()
|
| 509 |
+
test_df.columns = ['feature', 'importance_test']
|
| 510 |
+
total_importance_test = test_df['importance_test'].sum()
|
| 511 |
+
test_df['share_test'] = (test_df['importance_test'] / total_importance_test) * 100
|
| 512 |
+
else:
|
| 513 |
+
test_df = pd.DataFrame({'feature': feature_names})
|
| 514 |
+
test_df['importance_test'] = np.nan
|
| 515 |
+
test_df['share_test'] = np.nan
|
| 516 |
+
|
| 517 |
+
# Mergeํ์ฌ ํตํฉ DataFrame ์์ฑ
|
| 518 |
+
importance_df_combined = pd.merge(train_df, test_df, on='feature', how='outer')
|
| 519 |
+
|
| 520 |
+
# ์ ๋ ฌ
|
| 521 |
+
if importance_df_train is not None:
|
| 522 |
+
importance_df_combined = importance_df_combined.sort_values(
|
| 523 |
+
'importance_train', ascending=False
|
| 524 |
+
).reset_index(drop=True)
|
| 525 |
+
elif importance_df_test is not None:
|
| 526 |
+
importance_df_combined = importance_df_combined.sort_values(
|
| 527 |
+
'importance_test', ascending=False
|
| 528 |
+
).reset_index(drop=True)
|
| 529 |
+
else:
|
| 530 |
+
importance_df_combined = importance_df_combined.sort_values('feature').reset_index(drop=True)
|
| 531 |
+
|
| 532 |
+
return importance_df_combined
|
| 533 |
+
|
| 534 |
+
|
| 535 |
+
def _plot_shap_summary(
|
| 536 |
+
shap_train: Optional[np.ndarray],
|
| 537 |
+
X_train: Optional[pd.DataFrame],
|
| 538 |
+
shap_test: Optional[np.ndarray],
|
| 539 |
+
X_test: Optional[pd.DataFrame],
|
| 540 |
+
feature_names: List[str],
|
| 541 |
+
target_class: int,
|
| 542 |
+
top_n: int,
|
| 543 |
+
top_n_share_train: Optional[float] = None,
|
| 544 |
+
top_n_share_test: Optional[float] = None,
|
| 545 |
+
show_train_plot: bool = True,
|
| 546 |
+
show_test_plot: bool = True,
|
| 547 |
+
figsize: Tuple[int, int] = (12, 8),
|
| 548 |
+
model_name: Optional[str] = None,
|
| 549 |
+
data_sample: Optional[str] = None,
|
| 550 |
+
region: Optional[str] = None
|
| 551 |
+
) -> None:
|
| 552 |
+
"""SHAP summary plot์ ์์ฑํ๋ ํฌํผ ํจ์.
|
| 553 |
+
|
| 554 |
+
Args:
|
| 555 |
+
shap_train: Train ๋ฐ์ดํฐ SHAP ๊ฐ
|
| 556 |
+
X_train: Train ๋ฐ์ดํฐ
|
| 557 |
+
shap_test: Test ๋ฐ์ดํฐ SHAP ๊ฐ
|
| 558 |
+
X_test: Test ๋ฐ์ดํฐ
|
| 559 |
+
feature_names: ํผ์ฒ ์ด๋ฆ ๋ฆฌ์คํธ
|
| 560 |
+
target_class: ํ๊ฒ ํด๋์ค
|
| 561 |
+
top_n: ์์ N๊ฐ ๋ณ์
|
| 562 |
+
top_n_share_train: Train ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋ (๊ธฐ๋ณธ๊ฐ: None)
|
| 563 |
+
top_n_share_test: Test ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋ (๊ธฐ๋ณธ๊ฐ: None)
|
| 564 |
+
show_train_plot: Train plot ํ์ ์ฌ๋ถ
|
| 565 |
+
show_test_plot: Test plot ํ์ ์ฌ๋ถ
|
| 566 |
+
figsize: ๊ทธ๋ฆผ ํฌ๊ธฐ
|
| 567 |
+
model_name: ๋ชจ๋ธ ์ด๋ฆ (๊ธฐ๋ณธ๊ฐ: None)
|
| 568 |
+
data_sample: ๋ฐ์ดํฐ ์ํ ํ์
(๊ธฐ๋ณธ๊ฐ: None)
|
| 569 |
+
region: ์ง์ญ๋ช
(๊ธฐ๋ณธ๊ฐ: None)
|
| 570 |
+
"""
|
| 571 |
+
num_plots = int(show_train_plot and shap_train is not None) + int(show_test_plot and shap_test is not None)
|
| 572 |
+
if num_plots == 0:
|
| 573 |
+
return
|
| 574 |
+
|
| 575 |
+
# Title prefix ์์ฑ (๋ชจ๋ธ๋ช
, ๋ฐ์ดํฐ ์ํ, ์ง์ญ ์ ๋ณด)
|
| 576 |
+
title_parts = []
|
| 577 |
+
if model_name is not None:
|
| 578 |
+
title_parts.append(model_name.upper())
|
| 579 |
+
if data_sample is not None:
|
| 580 |
+
title_parts.append(data_sample)
|
| 581 |
+
if region is not None:
|
| 582 |
+
title_parts.append(region.upper())
|
| 583 |
+
|
| 584 |
+
if title_parts:
|
| 585 |
+
title_prefix = " - ".join(title_parts) + "\n"
|
| 586 |
+
else:
|
| 587 |
+
title_prefix = ""
|
| 588 |
+
|
| 589 |
+
if num_plots == 2:
|
| 590 |
+
plt.subplots(1, 2, figsize=figsize)
|
| 591 |
+
|
| 592 |
+
if show_train_plot and shap_train is not None:
|
| 593 |
+
plt.subplot(1, 2, 1)
|
| 594 |
+
shap.summary_plot(shap_train, X_train[feature_names] if isinstance(X_train, pd.DataFrame) else X_train,
|
| 595 |
+
show=False, plot_size=None)
|
| 596 |
+
share_text = f"\nTop {top_n} Share: {top_n_share_train:.1f}%" if top_n_share_train is not None else ""
|
| 597 |
+
plt.title(f"{title_prefix}Train Period (2018-20): Class {target_class}{share_text}")
|
| 598 |
+
|
| 599 |
+
if show_test_plot and shap_test is not None:
|
| 600 |
+
plt.subplot(1, 2, 2)
|
| 601 |
+
shap.summary_plot(shap_test, X_test[feature_names] if isinstance(X_test, pd.DataFrame) else X_test,
|
| 602 |
+
show=False, plot_size=None)
|
| 603 |
+
share_text = f"\nTop {top_n} Share: {top_n_share_test:.1f}%" if top_n_share_test is not None else ""
|
| 604 |
+
plt.title(f"{title_prefix}Test Period (2021): Class {target_class}{share_text}")
|
| 605 |
+
else:
|
| 606 |
+
plt.figure(figsize=(figsize[0]//2, figsize[1]))
|
| 607 |
+
if show_train_plot and shap_train is not None:
|
| 608 |
+
data = X_train[feature_names] if isinstance(X_train, pd.DataFrame) else X_train
|
| 609 |
+
shap_v = shap_train
|
| 610 |
+
share_text = f"\nTop {top_n} Share: {top_n_share_train:.1f}%" if top_n_share_train is not None else ""
|
| 611 |
+
title = f"{title_prefix}Train Period (2018-20): Class {target_class}{share_text}"
|
| 612 |
+
elif show_test_plot and shap_test is not None:
|
| 613 |
+
data = X_test[feature_names] if isinstance(X_test, pd.DataFrame) else X_test
|
| 614 |
+
shap_v = shap_test
|
| 615 |
+
share_text = f"\nTop {top_n} Share: {top_n_share_test:.1f}%" if top_n_share_test is not None else ""
|
| 616 |
+
title = f"{title_prefix}Test Period (2021): Class {target_class}{share_text}"
|
| 617 |
+
else:
|
| 618 |
+
return
|
| 619 |
+
|
| 620 |
+
shap.summary_plot(shap_v, data, show=False)
|
| 621 |
+
plt.title(title)
|
| 622 |
+
|
| 623 |
+
plt.tight_layout()
|
| 624 |
+
plt.show()
|
| 625 |
+
|
| 626 |
+
|
| 627 |
+
def _to_numpy(value: Any) -> np.ndarray:
|
| 628 |
+
"""๋ค์ํ ํ์
์ numpy array๋ก ๋ณํํ๋ ํฌํผ ํจ์."""
|
| 629 |
+
if isinstance(value, torch.Tensor):
|
| 630 |
+
return value.cpu().numpy()
|
| 631 |
+
elif isinstance(value, list):
|
| 632 |
+
return np.array(value)
|
| 633 |
+
elif isinstance(value, np.ndarray):
|
| 634 |
+
return value
|
| 635 |
+
else:
|
| 636 |
+
return np.array(value)
|
| 637 |
+
|
| 638 |
+
|
| 639 |
+
def _combine_num_cat_shap(shap_num: Any, shap_cat: Any) -> np.ndarray:
|
| 640 |
+
"""Numerical๊ณผ categorical SHAP ๊ฐ์ ๊ฒฐํฉํ๋ ํฌํผ ํจ์."""
|
| 641 |
+
shap_num = _to_numpy(shap_num)
|
| 642 |
+
shap_cat = _to_numpy(shap_cat)
|
| 643 |
+
return np.concatenate([shap_num, shap_cat], axis=-1)
|
| 644 |
+
|
| 645 |
+
|
| 646 |
+
def _extract_from_list_of_tuples(shap_list: List[Tuple]) -> np.ndarray:
|
| 647 |
+
"""ํํ ๋ฆฌ์คํธ์์ SHAP ๊ฐ์ ์ถ์ถํ๋ ํฌํผ ํจ์."""
|
| 648 |
+
combined = []
|
| 649 |
+
for shap_item in shap_list:
|
| 650 |
+
if isinstance(shap_item, tuple):
|
| 651 |
+
combined.append(_combine_num_cat_shap(shap_item[0], shap_item[1]))
|
| 652 |
+
else:
|
| 653 |
+
combined.append(_to_numpy(shap_item))
|
| 654 |
+
return np.array(combined)
|
| 655 |
+
|
| 656 |
+
|
| 657 |
+
def _extract_from_list(shap_list: List[Any]) -> np.ndarray:
|
| 658 |
+
"""๋ฆฌ์คํธ์์ SHAP ๊ฐ์ ์ถ์ถํ๋ ํฌํผ ํจ์."""
|
| 659 |
+
if len(shap_list) == 0:
|
| 660 |
+
return np.array([])
|
| 661 |
+
|
| 662 |
+
# ํํ ๋ฆฌ์คํธ์ธ ๊ฒฝ์ฐ
|
| 663 |
+
if isinstance(shap_list[0], tuple):
|
| 664 |
+
return _extract_from_list_of_tuples(shap_list)
|
| 665 |
+
|
| 666 |
+
# ๊ธธ์ด๊ฐ 2์ด๊ณ ๊ฐ๊ฐ์ด numerical/categorical์ธ ๊ฒฝ์ฐ
|
| 667 |
+
if len(shap_list) == 2:
|
| 668 |
+
return _combine_num_cat_shap(shap_list[0], shap_list[1])
|
| 669 |
+
|
| 670 |
+
# ์ผ๋ฐ ๋ฆฌ์ค๏ฟฝ๏ฟฝ๏ฟฝ์ธ ๊ฒฝ์ฐ
|
| 671 |
+
try:
|
| 672 |
+
return np.array([_to_numpy(item) for item in shap_list])
|
| 673 |
+
except (ValueError, TypeError):
|
| 674 |
+
# ํํ๊ฐ ์ผ์นํ์ง ์๋ ๊ฒฝ์ฐ, concatenate ์๋
|
| 675 |
+
converted = [_to_numpy(item) for item in shap_list]
|
| 676 |
+
if len(converted) == 2:
|
| 677 |
+
return np.concatenate(converted, axis=-1)
|
| 678 |
+
else:
|
| 679 |
+
return np.array(converted)
|
| 680 |
+
|
| 681 |
+
|
| 682 |
+
def extract_shap_values(shap_values: Any, target_class: int = 0) -> np.ndarray:
|
| 683 |
+
"""SHAP ๊ฐ์ ์ถ์ถํ์ฌ numpy array๋ก ๋ณํํ๋ ํฌํผ ํจ์.
|
| 684 |
+
|
| 685 |
+
Args:
|
| 686 |
+
shap_values: SHAP ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ๋ฐํ๋ SHAP ๊ฐ (๋ค์ํ ํํ ๊ฐ๋ฅ)
|
| 687 |
+
target_class: ๋ถ์ํ ํด๋์ค ์ธ๋ฑ์ค (๊ธฐ๋ณธ๊ฐ: 0)
|
| 688 |
+
|
| 689 |
+
Returns:
|
| 690 |
+
numpy.ndarray: ๋ณํ๋ SHAP ๊ฐ
|
| 691 |
+
"""
|
| 692 |
+
# ํํ์ธ ๊ฒฝ์ฐ (numerical, categorical ๋ถ๋ฆฌ)
|
| 693 |
+
if isinstance(shap_values, tuple):
|
| 694 |
+
return _combine_num_cat_shap(shap_values[0], shap_values[1])
|
| 695 |
+
|
| 696 |
+
# ๋ฆฌ์คํธ์ธ ๊ฒฝ์ฐ (ํด๋์ค๋ณ SHAP ๊ฐ)
|
| 697 |
+
if isinstance(shap_values, list):
|
| 698 |
+
target_shap = shap_values[target_class]
|
| 699 |
+
|
| 700 |
+
# ํํ์ธ ๊ฒฝ์ฐ
|
| 701 |
+
if isinstance(target_shap, tuple):
|
| 702 |
+
return _combine_num_cat_shap(target_shap[0], target_shap[1])
|
| 703 |
+
|
| 704 |
+
# ๋ฆฌ์คํธ์ธ ๊ฒฝ์ฐ
|
| 705 |
+
if isinstance(target_shap, list):
|
| 706 |
+
return _extract_from_list(target_shap)
|
| 707 |
+
|
| 708 |
+
# Tensor ๋๋ ๊ธฐํ ํ์
|
| 709 |
+
return _to_numpy(target_shap)
|
| 710 |
+
|
| 711 |
+
# numpy array์ธ ๊ฒฝ์ฐ
|
| 712 |
+
if isinstance(shap_values, np.ndarray):
|
| 713 |
+
if len(shap_values.shape) == 3:
|
| 714 |
+
return shap_values[:, target_class, :]
|
| 715 |
+
return shap_values
|
| 716 |
+
|
| 717 |
+
# ๊ธฐํ ํ์
|
| 718 |
+
return _to_numpy(shap_values)
|
| 719 |
+
|
| 720 |
+
# ==========================================
|
| 721 |
+
# ๋ฅ๋ฌ๋ ๋ชจ๋ธ ๋ฐ์ดํฐ ๋ก๋ ๋ฐ ์ ์ฒ๋ฆฌ ํจ์
|
| 722 |
+
# ==========================================
|
| 723 |
+
|
| 724 |
+
def load_scaler(model_name: str, region: str, data_sample: str) -> List[Any]:
|
| 725 |
+
"""
|
| 726 |
+
๊ฐ fold์ scaler๋ฅผ ๋ก๋ํ๋ ํจ์.
|
| 727 |
+
|
| 728 |
+
Args:
|
| 729 |
+
model_name: ๋ชจ๋ธ ์ด๋ฆ (์: "ft_transformer", "resnet_like", "deepgbm")
|
| 730 |
+
region: ์ง์ญ๋ช
(์: "seoul", "busan")
|
| 731 |
+
data_sample: ๋ฐ์ดํฐ ์ํ ํ์
(์: "smote", "ctgan10000")
|
| 732 |
+
|
| 733 |
+
Returns:
|
| 734 |
+
list: ๊ฐ fold์ scaler ๋ฆฌ์คํธ (3๊ฐ)
|
| 735 |
+
"""
|
| 736 |
+
# ํ์ผ๋ช
์์ฑ
|
| 737 |
+
if data_sample == 'pure':
|
| 738 |
+
scaler_filename = f'{model_name}_pure_{region}_scaler.pkl'
|
| 739 |
+
else:
|
| 740 |
+
scaler_filename = f'{model_name}_{data_sample}_{region}_scaler.pkl'
|
| 741 |
+
|
| 742 |
+
scaler_path = f'../save_model/{model_name}_optima/scaler/{scaler_filename}'
|
| 743 |
+
scalers = load(scaler_path)
|
| 744 |
+
return scalers
|
| 745 |
+
|
| 746 |
+
|
| 747 |
+
def prepare_dl_data_for_shap(
|
| 748 |
+
region: str,
|
| 749 |
+
data_sample: str,
|
| 750 |
+
fold_idx: int,
|
| 751 |
+
scaler: Any
|
| 752 |
+
) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame, pd.Index, pd.Index,
|
| 753 |
+
torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 754 |
+
"""
|
| 755 |
+
๋ฅ๋ฌ๋ ๋ชจ๋ธ์ฉ ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ (scaler ์ ์ฉ, ํ
์ ๋ณํ).
|
| 756 |
+
|
| 757 |
+
Args:
|
| 758 |
+
region: ์ง์ญ๋ช
|
| 759 |
+
data_sample: ๋ฐ์ดํฐ ์ํ ํ์
|
| 760 |
+
fold_idx: Fold ์ธ๋ฑ์ค (0, 1, 2)
|
| 761 |
+
scaler: ํด๋น fold์ scaler (QuantileTransformer)
|
| 762 |
+
|
| 763 |
+
Returns:
|
| 764 |
+
tuple: (X_train, X_val, X_test, categorical_cols, numerical_cols,
|
| 765 |
+
X_train_num, X_train_cat, X_val_num, X_val_cat, X_test_num, X_test_cat)
|
| 766 |
+
"""
|
| 767 |
+
# ํ์ผ ๊ฒฝ๋ก ์ค์
|
| 768 |
+
if data_sample == 'pure':
|
| 769 |
+
dat_path = f"../../data/data_for_modeling/{region}_train.csv"
|
| 770 |
+
train_data = preprocessing(pd.read_csv(dat_path, index_col=0))
|
| 771 |
+
train_data = train_data.loc[~train_data['year'].isin([TEST_YEAR - (fold_idx + 1)]), :]
|
| 772 |
+
else:
|
| 773 |
+
train_data = pd.read_csv(f"../../data/data_oversampled/{data_sample}/{data_sample}_{fold_idx+1}_{region}.csv")
|
| 774 |
+
train_data = preprocessing(train_data)
|
| 775 |
+
|
| 776 |
+
val_data = pd.read_csv(f"../../data/data_for_modeling/{region}_train.csv")
|
| 777 |
+
val_data = preprocessing(val_data)
|
| 778 |
+
val_data = val_data.loc[val_data['year'].isin([TEST_YEAR - (fold_idx + 1)]), :]
|
| 779 |
+
|
| 780 |
+
test_data = pd.read_csv(f"../../data/data_for_modeling/{region}_test.csv")
|
| 781 |
+
test_data = preprocessing(test_data)
|
| 782 |
+
test_data = test_data.loc[test_data['year'].isin([TEST_YEAR]), :]
|
| 783 |
+
|
| 784 |
+
# ์ปฌ๋ผ ์ ๋ ฌ (์ผ๊ด์ฑ ์ ์ง)
|
| 785 |
+
common_columns = train_data.columns.to_list()
|
| 786 |
+
train_data = train_data[common_columns]
|
| 787 |
+
val_data = val_data[common_columns]
|
| 788 |
+
test_data = test_data[common_columns]
|
| 789 |
+
|
| 790 |
+
# ์ค๋ช
๋ณ์ & ํ๊ฒ ๋ถ๋ฆฌ
|
| 791 |
+
|
| 792 |
+
X_train = train_data.drop(columns=DROP_COLUMNS)
|
| 793 |
+
X_val = val_data.drop(columns=DROP_COLUMNS)
|
| 794 |
+
X_test = test_data.drop(columns=DROP_COLUMNS)
|
| 795 |
+
|
| 796 |
+
# ๋ฒ์ฃผํ & ์ฐ์ํ ๋ณ์ ๋ถ๋ฆฌ
|
| 797 |
+
categorical_cols = X_train.select_dtypes(include=['object', 'category', 'int64']).columns
|
| 798 |
+
numerical_cols = X_train.select_dtypes(include=['float64']).columns
|
| 799 |
+
|
| 800 |
+
# ๋ฒ์ฃผํ ๋ณ์ Label Encoding (train ๋ฐ์ดํฐ ๊ธฐ์ค์ผ๋ก ํ์ต)
|
| 801 |
+
label_encoders = {}
|
| 802 |
+
for col in categorical_cols:
|
| 803 |
+
le = LabelEncoder()
|
| 804 |
+
le.fit(X_train[col])
|
| 805 |
+
label_encoders[col] = le
|
| 806 |
+
|
| 807 |
+
# ๋ณํ ์ ์ฉ
|
| 808 |
+
for col in categorical_cols:
|
| 809 |
+
X_train[col] = label_encoders[col].transform(X_train[col])
|
| 810 |
+
X_val[col] = label_encoders[col].transform(X_val[col])
|
| 811 |
+
X_test[col] = label_encoders[col].transform(X_test[col])
|
| 812 |
+
|
| 813 |
+
# ์ฐ์ํ ๋ณ์ Scaler ๋ณํ (์ ์ฅ๋ scaler ์ฌ์ฉ)
|
| 814 |
+
X_train[numerical_cols] = scaler.transform(X_train[numerical_cols])
|
| 815 |
+
X_val[numerical_cols] = scaler.transform(X_val[numerical_cols])
|
| 816 |
+
X_test[numerical_cols] = scaler.transform(X_test[numerical_cols])
|
| 817 |
+
|
| 818 |
+
# ํ
์ ๋ณํ
|
| 819 |
+
X_train_num = torch.tensor(X_train[numerical_cols].values, dtype=torch.float32)
|
| 820 |
+
X_train_cat = torch.tensor(X_train[categorical_cols].values, dtype=torch.long)
|
| 821 |
+
|
| 822 |
+
X_val_num = torch.tensor(X_val[numerical_cols].values, dtype=torch.float32)
|
| 823 |
+
X_val_cat = torch.tensor(X_val[categorical_cols].values, dtype=torch.long)
|
| 824 |
+
|
| 825 |
+
X_test_num = torch.tensor(X_test[numerical_cols].values, dtype=torch.float32)
|
| 826 |
+
X_test_cat = torch.tensor(X_test[categorical_cols].values, dtype=torch.long)
|
| 827 |
+
|
| 828 |
+
return (X_train, X_val, X_test, categorical_cols, numerical_cols,
|
| 829 |
+
X_train_num, X_train_cat, X_val_num, X_val_cat, X_test_num, X_test_cat)
|
| 830 |
+
|
| 831 |
+
|
| 832 |
+
# ==========================================
|
| 833 |
+
# ๋ฅ๋ฌ๋ ๋ชจ๋ธ SHAP ๋ถ์ ๋ฉ์ธ ํจ์
|
| 834 |
+
# ==========================================
|
| 835 |
+
|
| 836 |
+
def analyze_dl_model_shap(
|
| 837 |
+
model_name: str,
|
| 838 |
+
region: str,
|
| 839 |
+
data_sample: str,
|
| 840 |
+
target_class: int = 0,
|
| 841 |
+
n_folds: int = 3,
|
| 842 |
+
n_background_samples: int = 200,
|
| 843 |
+
n_test_samples: int = 500,
|
| 844 |
+
device: str = 'cpu',
|
| 845 |
+
figsize: Tuple[int, int] = (12, 8),
|
| 846 |
+
show_plot: bool = True,
|
| 847 |
+
show_train_plot: bool = True,
|
| 848 |
+
show_test_plot: bool = True,
|
| 849 |
+
top_n: int = 3
|
| 850 |
+
) -> Optional[Dict[str, Any]]:
|
| 851 |
+
"""
|
| 852 |
+
๋ฅ๋ฌ๋ ๋ชจ๋ธ์ SHAP ๊ฐ์ ๊ณ์ฐํ๊ณ ์๊ฐํํ๋ ํจ์.
|
| 853 |
+
|
| 854 |
+
Args:
|
| 855 |
+
model_name: ๋ชจ๋ธ ์ด๋ฆ ('ft_transformer', 'resnet_like', 'deepgbm')
|
| 856 |
+
region: ์ง์ญ๋ช
|
| 857 |
+
data_sample: ๋ฐ์ดํฐ ์ํ ํ์
|
| 858 |
+
target_class: ๋ถ์ํ ํด๋์ค ์ธ๋ฑ์ค (๊ธฐ๋ณธ๊ฐ: 0)
|
| 859 |
+
n_folds: Fold ๊ฐ์ (๊ธฐ๋ณธ๊ฐ: 3)
|
| 860 |
+
n_background_samples: ๋ฐฐ๊ฒฝ ๋ฐ์ดํฐ ์ํ ์ (๊ธฐ๋ณธ๊ฐ: 200)
|
| 861 |
+
n_test_samples: ํ
์คํธ ๋ฐ์ดํฐ ์ํ ์ (๊ธฐ๋ณธ๊ฐ: 500)
|
| 862 |
+
device: ์ฐ์ฐ ์ฅ์น ('cpu' ๋๋ 'cuda', ๊ธฐ๋ณธ๊ฐ: 'cpu')
|
| 863 |
+
figsize: ๊ทธ๋ฆผ ํฌ๊ธฐ (๊ธฐ๋ณธ๊ฐ: (12, 8))
|
| 864 |
+
show_plot: ์๊ฐํ ํ์ ์ฌ๋ถ (๊ธฐ๋ณธ๊ฐ: True)
|
| 865 |
+
show_train_plot: Train(validation) ๋ฐ์ดํฐ ์๊ฐํ ํ์ ์ฌ๋ถ (๊ธฐ๋ณธ๊ฐ: True)
|
| 866 |
+
show_test_plot: Test ๋ฐ์ดํฐ ์๊ฐํ ํ์ ์ฌ๋ถ (๊ธฐ๋ณธ๊ฐ: True)
|
| 867 |
+
top_n: ์์ N๊ฐ ๋ณ์ ๊ธฐ์ฌ๋ ๊ณ์ฐ (๊ธฐ๋ณธ๊ฐ: 3)
|
| 868 |
+
|
| 869 |
+
Returns:
|
| 870 |
+
dict: SHAP ๊ฐ ๋ฐ ๊ด๋ จ ์ ๋ณด
|
| 871 |
+
- shap_train: Train ๋ฐ์ดํฐ SHAP ๊ฐ
|
| 872 |
+
- X_train: Train ๋ฐ์ดํฐ
|
| 873 |
+
- shap_test: Test ๋ฐ์ดํฐ SHAP ๊ฐ
|
| 874 |
+
- X_test: Test ๋ฐ์ดํฐ
|
| 875 |
+
- feature_names: ํผ์ฒ ์ด๋ฆ ๋ฆฌ์คํธ
|
| 876 |
+
- model_name: ๋ชจ๋ธ ์ด๋ฆ
|
| 877 |
+
- region: ์ง์ญ๋ช
|
| 878 |
+
- data_sample: ๋ฐ์ดํฐ ์ํ ํ์
|
| 879 |
+
- top_n_features_train: Train ์์ N๊ฐ ๋ณ์ ๋ฆฌ์คํธ
|
| 880 |
+
- top_n_share_train: Train ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋(%)
|
| 881 |
+
- importance_df_train: Train ์ ์ฒด ์ค์๋ ์์ํ
|
| 882 |
+
- top_n_features_test: Test ์์ N๊ฐ ๋ณ์ ๋ฆฌ์คํธ
|
| 883 |
+
- top_n_share_test: Test ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋(%)
|
| 884 |
+
- importance_df_test: Test ์ ์ฒด ์ค์๋ ์์ํ
|
| 885 |
+
- importance_df_combined: Train/Test ํตํฉ ์ค์๋ DataFrame
|
| 886 |
+
"""
|
| 887 |
+
print(f"[{model_name.upper()}] {region} - {data_sample} SHAP Analysis Start...")
|
| 888 |
+
|
| 889 |
+
# ๋ชจ๋ธ ๋ฐ scaler ๋ก๋
|
| 890 |
+
try:
|
| 891 |
+
models = load_model(model_name, region, data_sample)
|
| 892 |
+
scalers = load_scaler(model_name, region, data_sample)
|
| 893 |
+
except Exception as e:
|
| 894 |
+
print(f"๋ชจ๋ธ ๋๋ scaler ๋ก๋ ์คํจ: {e}")
|
| 895 |
+
return None
|
| 896 |
+
|
| 897 |
+
if len(models) != n_folds or len(scalers) != n_folds:
|
| 898 |
+
raise ValueError(f"๋ชจ๋ธ ๊ฐ์({len(models)}) ๋๋ scaler ๊ฐ์({len(scalers)})๊ฐ n_folds({n_folds})์ ์ผ์นํ์ง ์์ต๋๋ค.")
|
| 899 |
+
|
| 900 |
+
# ๊ฐ fold์ SHAP ๊ฐ ์ ์ฅ (train๊ณผ test ๋ถ๋ฆฌ)
|
| 901 |
+
all_shap_train = []
|
| 902 |
+
all_shap_test = []
|
| 903 |
+
all_train_data = []
|
| 904 |
+
all_test_data = []
|
| 905 |
+
feature_names = None
|
| 906 |
+
|
| 907 |
+
for fold_idx in range(n_folds):
|
| 908 |
+
print(f" Processing Fold {fold_idx + 1}...")
|
| 909 |
+
|
| 910 |
+
try:
|
| 911 |
+
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
|
| 912 |
+
(X_train, X_val, X_test, categorical_cols, numerical_cols,
|
| 913 |
+
X_train_num, X_train_cat, X_val_num, X_val_cat, X_test_num, X_test_cat) = \
|
| 914 |
+
prepare_dl_data_for_shap(region, data_sample, fold_idx, scalers[fold_idx])
|
| 915 |
+
|
| 916 |
+
# Feature names ์ ์ฅ (์ฒซ ๋ฒ์งธ fold์์๋ง)
|
| 917 |
+
if feature_names is None:
|
| 918 |
+
feature_names = list(numerical_cols) + list(categorical_cols)
|
| 919 |
+
|
| 920 |
+
# ๋ชจ๋ธ ์ค๋น
|
| 921 |
+
model = models[fold_idx]
|
| 922 |
+
model.to(device)
|
| 923 |
+
model.eval()
|
| 924 |
+
|
| 925 |
+
# ๋ฐฐ๊ฒฝ ๋ฐ์ดํฐ ์ํ๋ง (validation ๋ฐ์ดํฐ ์ฌ์ฉ)
|
| 926 |
+
n_bg = min(n_background_samples, len(X_val_num))
|
| 927 |
+
bg_indices = np.random.choice(len(X_val_num), n_bg, replace=False)
|
| 928 |
+
X_bg_num = X_val_num[bg_indices].to(device)
|
| 929 |
+
X_bg_cat = X_val_cat[bg_indices].to(device)
|
| 930 |
+
|
| 931 |
+
# Validation ๋ฐ์ดํฐ ์ํ๋ง (train plot์ฉ)
|
| 932 |
+
n_train = min(n_test_samples, len(X_val_num))
|
| 933 |
+
# ๋ฐฐ๊ฒฝ ๋ฐ์ดํฐ์ ๊ฒน์น์ง ์๋๋ก ์ํ๋ง
|
| 934 |
+
available_indices = np.setdiff1d(np.arange(len(X_val_num)), bg_indices)
|
| 935 |
+
if len(available_indices) < n_train:
|
| 936 |
+
train_indices = available_indices
|
| 937 |
+
else:
|
| 938 |
+
train_indices = np.random.choice(available_indices, n_train, replace=False)
|
| 939 |
+
X_train_sample_num = X_val_num[train_indices].to(device)
|
| 940 |
+
X_train_sample_cat = X_val_cat[train_indices].to(device)
|
| 941 |
+
|
| 942 |
+
# ํ
์คํธ ๋ฐ์ดํฐ ์ํ๋ง
|
| 943 |
+
n_test = min(n_test_samples, len(X_test_num))
|
| 944 |
+
test_indices = np.random.choice(len(X_test_num), n_test, replace=False)
|
| 945 |
+
X_test_sample_num = X_test_num[test_indices].to(device)
|
| 946 |
+
X_test_sample_cat = X_test_cat[test_indices].to(device)
|
| 947 |
+
|
| 948 |
+
# SHAP Explainer ์์ฑ ๋ฐ ๊ณ์ฐ
|
| 949 |
+
try:
|
| 950 |
+
# ๋ชจ๋ธ ๋ํ
|
| 951 |
+
wrapped_model = ModelWrapper(model, numerical_cols)
|
| 952 |
+
wrapped_model.to(device)
|
| 953 |
+
wrapped_model.eval()
|
| 954 |
+
|
| 955 |
+
# Explainer ์์ฑ
|
| 956 |
+
explainer = _create_shap_explainer(model_name, wrapped_model, X_bg_num, X_bg_cat, device)
|
| 957 |
+
|
| 958 |
+
# Validation ๋ฐ์ดํฐ์ ๋ํ SHAP ๊ฐ ๊ณ์ฐ
|
| 959 |
+
shap_values_train = _calculate_shap_values(
|
| 960 |
+
explainer, model_name, X_train_sample_num, X_train_sample_cat, device
|
| 961 |
+
)
|
| 962 |
+
shap_val_train = extract_shap_values(shap_values_train, target_class)
|
| 963 |
+
all_shap_train.append(shap_val_train)
|
| 964 |
+
X_train_original = X_val.iloc[train_indices].copy()
|
| 965 |
+
all_train_data.append(X_train_original)
|
| 966 |
+
|
| 967 |
+
# Test ๋ฐ์ดํฐ์ ๋ํ SHAP ๊ฐ ๊ณ์ฐ
|
| 968 |
+
shap_values_test = _calculate_shap_values(
|
| 969 |
+
explainer, model_name, X_test_sample_num, X_test_sample_cat, device
|
| 970 |
+
)
|
| 971 |
+
shap_val_test = extract_shap_values(shap_values_test, target_class)
|
| 972 |
+
all_shap_test.append(shap_val_test)
|
| 973 |
+
X_test_original = X_test.iloc[test_indices].copy()
|
| 974 |
+
all_test_data.append(X_test_original)
|
| 975 |
+
|
| 976 |
+
except Exception as e:
|
| 977 |
+
print(f" Warning: Fold {fold_idx + 1} SHAP ๊ณ์ฐ ์คํจ: {e}")
|
| 978 |
+
continue
|
| 979 |
+
except Exception as e:
|
| 980 |
+
print(f" Warning: Fold {fold_idx + 1} ์ฒ๋ฆฌ ์คํจ: {e}")
|
| 981 |
+
continue
|
| 982 |
+
|
| 983 |
+
if len(all_shap_train) == 0 and len(all_shap_test) == 0:
|
| 984 |
+
print(" ๋ชจ๋ fold์์ SHAP ๊ณ์ฐ ์คํจ")
|
| 985 |
+
return None
|
| 986 |
+
|
| 987 |
+
# ==========================================
|
| 988 |
+
# ๋ฐ์ดํฐ ํตํฉ
|
| 989 |
+
# ==========================================
|
| 990 |
+
# Train(validation) ๋ฐ์ดํฐ ํตํฉ
|
| 991 |
+
all_shap_train_combined = np.concatenate(all_shap_train, axis=0) if len(all_shap_train) > 0 else None
|
| 992 |
+
all_train_data_combined = pd.concat(all_train_data, axis=0).reset_index(drop=True) if len(all_train_data) > 0 else None
|
| 993 |
+
|
| 994 |
+
# Test ๋ฐ์ดํฐ ํตํฉ: ํ๊ท ์ฌ์ฉ
|
| 995 |
+
if len(all_shap_test) > 0:
|
| 996 |
+
all_shap_test_combined = np.mean(all_shap_test, axis=0)
|
| 997 |
+
# Test ๋ฐ์ดํฐ๋ ์ฒซ ๋ฒ์งธ fold๋ง ์ฌ์ฉ
|
| 998 |
+
all_test_data_combined = all_test_data[0] if len(all_test_data) > 0 else None
|
| 999 |
+
else:
|
| 1000 |
+
all_shap_test_combined = None
|
| 1001 |
+
all_test_data_combined = None
|
| 1002 |
+
|
| 1003 |
+
# ==========================================
|
| 1004 |
+
# Train ๋ฐ์ดํฐ ์์ N๊ฐ ๋ณ์ ๊ธฐ์ฌ๋(Cumulative Share) ๊ณ์ฐ
|
| 1005 |
+
# ==========================================
|
| 1006 |
+
if all_shap_train_combined is not None:
|
| 1007 |
+
importance_df_train, top_n_features_train, top_n_share_train = _calculate_cumulative_share(
|
| 1008 |
+
all_shap_train_combined, feature_names, top_n, period_name='Train Period'
|
| 1009 |
+
)
|
| 1010 |
+
else:
|
| 1011 |
+
importance_df_train = None
|
| 1012 |
+
top_n_share_train = None
|
| 1013 |
+
top_n_features_train = None
|
| 1014 |
+
|
| 1015 |
+
# ==========================================
|
| 1016 |
+
# Test ๋ฐ์ดํฐ ์์ N๊ฐ ๋ณ์ ๊ธฐ์ฌ๋(Cumulative Share) ๊ณ์ฐ
|
| 1017 |
+
# ==========================================
|
| 1018 |
+
if all_shap_test_combined is not None:
|
| 1019 |
+
importance_df_test, top_n_features_test, top_n_share_test = _calculate_cumulative_share(
|
| 1020 |
+
all_shap_test_combined, feature_names, top_n, period_name='Test Period'
|
| 1021 |
+
)
|
| 1022 |
+
print() # ๋ง์ง๋ง์ ๋น ์ค ์ถ๊ฐ
|
| 1023 |
+
else:
|
| 1024 |
+
importance_df_test = None
|
| 1025 |
+
top_n_share_test = None
|
| 1026 |
+
top_n_features_test = None
|
| 1027 |
+
|
| 1028 |
+
# ==========================================
|
| 1029 |
+
# ํตํฉ Feature Importance DataFrame ์์ฑ
|
| 1030 |
+
# ==========================================
|
| 1031 |
+
importance_df_combined = _create_combined_importance_df(
|
| 1032 |
+
importance_df_train, importance_df_test, feature_names
|
| 1033 |
+
)
|
| 1034 |
+
|
| 1035 |
+
# ==========================================
|
| 1036 |
+
# ์๊ฐํ
|
| 1037 |
+
# ==========================================
|
| 1038 |
+
if show_plot:
|
| 1039 |
+
_plot_shap_summary(
|
| 1040 |
+
all_shap_train_combined, all_train_data_combined, all_shap_test_combined, all_test_data_combined,
|
| 1041 |
+
feature_names, target_class, top_n,
|
| 1042 |
+
top_n_share_train=top_n_share_train, top_n_share_test=top_n_share_test,
|
| 1043 |
+
show_train_plot=show_train_plot, show_test_plot=show_test_plot, figsize=figsize,
|
| 1044 |
+
model_name=model_name, data_sample=data_sample, region=region
|
| 1045 |
+
)
|
| 1046 |
+
|
| 1047 |
+
print(f" [{model_name.upper()}] SHAP Analysis Complete!\n")
|
| 1048 |
+
|
| 1049 |
+
return {
|
| 1050 |
+
'shap_train': all_shap_train_combined,
|
| 1051 |
+
'X_train': all_train_data_combined[feature_names] if all_train_data_combined is not None else None,
|
| 1052 |
+
'shap_test': all_shap_test_combined,
|
| 1053 |
+
'X_test': all_test_data_combined[feature_names] if all_test_data_combined is not None else None,
|
| 1054 |
+
'feature_names': feature_names,
|
| 1055 |
+
'model_name': model_name,
|
| 1056 |
+
'region': region,
|
| 1057 |
+
'data_sample': data_sample,
|
| 1058 |
+
'top_n_features_train': top_n_features_train, # Train ์์ N๊ฐ ๋ณ์ ๋ฆฌ์คํธ
|
| 1059 |
+
'top_n_share_train': top_n_share_train, # Train ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋(%)
|
| 1060 |
+
'importance_df_train': importance_df_train, # Train ์ ์ฒด ์ค์๋ ์์ํ
|
| 1061 |
+
'top_n_features_test': top_n_features_test, # Test ์์ N๊ฐ ๋ณ์ ๋ฆฌ์คํธ
|
| 1062 |
+
'top_n_share_test': top_n_share_test, # Test ์์ N๊ฐ ๋์ ๊ธฐ์ฌ๋(%)
|
| 1063 |
+
'importance_df_test': importance_df_test, # Test ์ ์ฒด ์ค์๋ ์์ํ
|
| 1064 |
+
'importance_df_combined': importance_df_combined # Train/Test ํตํฉ ์ค์๋ DataFrame
|
| 1065 |
+
}
|
| 1066 |
+
|
| 1067 |
+
def elbow_plot(result: Dict[str, Any]) -> None:
|
| 1068 |
+
elbow = result['importance_df_combined'].loc[:,['feature','importance_train','share_train']]
|
| 1069 |
+
elbow = elbow.sort_values('importance_train', ascending=False)
|
| 1070 |
+
plt.figure(figsize=(8, 5))
|
| 1071 |
+
plt.plot(range(1, len(elbow) + 1), elbow['share_train'].values, marker='o')
|
| 1072 |
+
plt.xlabel('Feature Rank')
|
| 1073 |
+
plt.ylabel('Share Train (%)')
|
| 1074 |
+
plt.title('Elbow Plot for Feature Importance (share_train)')
|
| 1075 |
+
plt.xticks(range(1, len(elbow) + 1))
|
| 1076 |
+
plt.grid(True, linestyle='--', alpha=0.5)
|
| 1077 |
+
plt.show()
|
Analysis_code/find_reason/wasserstein_distance.ipynb
CHANGED
|
@@ -2,9 +2,20 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"metadata": {},
|
| 7 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
"source": [
|
| 9 |
"# ๋ถ์์ ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ํฌํธ\n",
|
| 10 |
"import warnings\n",
|
|
@@ -33,7 +44,7 @@
|
|
| 33 |
},
|
| 34 |
{
|
| 35 |
"cell_type": "code",
|
| 36 |
-
"execution_count":
|
| 37 |
"metadata": {},
|
| 38 |
"outputs": [],
|
| 39 |
"source": [
|
|
@@ -58,7 +69,7 @@
|
|
| 58 |
},
|
| 59 |
{
|
| 60 |
"cell_type": "code",
|
| 61 |
-
"execution_count":
|
| 62 |
"metadata": {},
|
| 63 |
"outputs": [
|
| 64 |
{
|
|
@@ -133,7 +144,7 @@
|
|
| 133 |
},
|
| 134 |
{
|
| 135 |
"cell_type": "code",
|
| 136 |
-
"execution_count":
|
| 137 |
"metadata": {},
|
| 138 |
"outputs": [],
|
| 139 |
"source": [
|
|
@@ -184,7 +195,7 @@
|
|
| 184 |
},
|
| 185 |
{
|
| 186 |
"cell_type": "code",
|
| 187 |
-
"execution_count":
|
| 188 |
"metadata": {},
|
| 189 |
"outputs": [
|
| 190 |
{
|
|
@@ -192,10 +203,10 @@
|
|
| 192 |
"output_type": "stream",
|
| 193 |
"text": [
|
| 194 |
" 2018 2019 2020 2021\n",
|
| 195 |
-
"2018 0.0 0.
|
| 196 |
-
"2019 0.
|
| 197 |
-
"2020 0.
|
| 198 |
-
"2021 1.
|
| 199 |
]
|
| 200 |
}
|
| 201 |
],
|
|
@@ -235,7 +246,7 @@
|
|
| 235 |
},
|
| 236 |
{
|
| 237 |
"cell_type": "code",
|
| 238 |
-
"execution_count":
|
| 239 |
"metadata": {},
|
| 240 |
"outputs": [
|
| 241 |
{
|
|
@@ -243,10 +254,10 @@
|
|
| 243 |
"output_type": "stream",
|
| 244 |
"text": [
|
| 245 |
" 2018 2019 2020 2021\n",
|
| 246 |
-
"2018 0.0 0.
|
| 247 |
-
"2019 0.
|
| 248 |
-
"2020
|
| 249 |
-
"2021 1.
|
| 250 |
]
|
| 251 |
}
|
| 252 |
],
|
|
@@ -286,7 +297,7 @@
|
|
| 286 |
},
|
| 287 |
{
|
| 288 |
"cell_type": "code",
|
| 289 |
-
"execution_count":
|
| 290 |
"metadata": {},
|
| 291 |
"outputs": [
|
| 292 |
{
|
|
@@ -294,10 +305,10 @@
|
|
| 294 |
"output_type": "stream",
|
| 295 |
"text": [
|
| 296 |
" 2018 2019 2020 2021\n",
|
| 297 |
-
"2018 0.0
|
| 298 |
-
"2019
|
| 299 |
-
"2020 0.
|
| 300 |
-
"2021 0.
|
| 301 |
]
|
| 302 |
}
|
| 303 |
],
|
|
@@ -337,7 +348,7 @@
|
|
| 337 |
},
|
| 338 |
{
|
| 339 |
"cell_type": "code",
|
| 340 |
-
"execution_count":
|
| 341 |
"metadata": {},
|
| 342 |
"outputs": [
|
| 343 |
{
|
|
@@ -345,10 +356,10 @@
|
|
| 345 |
"output_type": "stream",
|
| 346 |
"text": [
|
| 347 |
" 2018 2019 2020 2021\n",
|
| 348 |
-
"2018 0.0 0.
|
| 349 |
-
"2019 0.
|
| 350 |
-
"2020 0.
|
| 351 |
-
"2021
|
| 352 |
]
|
| 353 |
}
|
| 354 |
],
|
|
@@ -388,7 +399,7 @@
|
|
| 388 |
},
|
| 389 |
{
|
| 390 |
"cell_type": "code",
|
| 391 |
-
"execution_count":
|
| 392 |
"metadata": {},
|
| 393 |
"outputs": [
|
| 394 |
{
|
|
@@ -396,10 +407,10 @@
|
|
| 396 |
"output_type": "stream",
|
| 397 |
"text": [
|
| 398 |
" 2018 2019 2020 2021\n",
|
| 399 |
-
"2018 0.0
|
| 400 |
-
"2019
|
| 401 |
-
"2020 0.
|
| 402 |
-
"2021 0.
|
| 403 |
]
|
| 404 |
}
|
| 405 |
],
|
|
@@ -439,7 +450,7 @@
|
|
| 439 |
},
|
| 440 |
{
|
| 441 |
"cell_type": "code",
|
| 442 |
-
"execution_count":
|
| 443 |
"metadata": {},
|
| 444 |
"outputs": [
|
| 445 |
{
|
|
@@ -447,10 +458,10 @@
|
|
| 447 |
"output_type": "stream",
|
| 448 |
"text": [
|
| 449 |
" 2018 2019 2020 2021\n",
|
| 450 |
-
"2018 0.0 0.
|
| 451 |
-
"2019 0.
|
| 452 |
-
"2020
|
| 453 |
-
"2021
|
| 454 |
]
|
| 455 |
}
|
| 456 |
],
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
"metadata": {},
|
| 7 |
+
"outputs": [
|
| 8 |
+
{
|
| 9 |
+
"name": "stderr",
|
| 10 |
+
"output_type": "stream",
|
| 11 |
+
"text": [
|
| 12 |
+
"2025-12-29 07:26:00.319461: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
|
| 13 |
+
"2025-12-29 07:26:00.343609: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
|
| 14 |
+
"To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
|
| 15 |
+
"2025-12-29 07:26:00.726272: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n"
|
| 16 |
+
]
|
| 17 |
+
}
|
| 18 |
+
],
|
| 19 |
"source": [
|
| 20 |
"# ๋ถ์์ ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ํฌํธ\n",
|
| 21 |
"import warnings\n",
|
|
|
|
| 44 |
},
|
| 45 |
{
|
| 46 |
"cell_type": "code",
|
| 47 |
+
"execution_count": 2,
|
| 48 |
"metadata": {},
|
| 49 |
"outputs": [],
|
| 50 |
"source": [
|
|
|
|
| 69 |
},
|
| 70 |
{
|
| 71 |
"cell_type": "code",
|
| 72 |
+
"execution_count": 3,
|
| 73 |
"metadata": {},
|
| 74 |
"outputs": [
|
| 75 |
{
|
|
|
|
| 144 |
},
|
| 145 |
{
|
| 146 |
"cell_type": "code",
|
| 147 |
+
"execution_count": 4,
|
| 148 |
"metadata": {},
|
| 149 |
"outputs": [],
|
| 150 |
"source": [
|
|
|
|
| 195 |
},
|
| 196 |
{
|
| 197 |
"cell_type": "code",
|
| 198 |
+
"execution_count": 5,
|
| 199 |
"metadata": {},
|
| 200 |
"outputs": [
|
| 201 |
{
|
|
|
|
| 203 |
"output_type": "stream",
|
| 204 |
"text": [
|
| 205 |
" 2018 2019 2020 2021\n",
|
| 206 |
+
"2018 0.0 0.123805 0.065046 1.077025\n",
|
| 207 |
+
"2019 0.123805 0.0 0.0622 0.822734\n",
|
| 208 |
+
"2020 0.065046 0.0622 0.0 0.038563\n",
|
| 209 |
+
"2021 1.077025 0.822734 0.038563 0.0\n"
|
| 210 |
]
|
| 211 |
}
|
| 212 |
],
|
|
|
|
| 246 |
},
|
| 247 |
{
|
| 248 |
"cell_type": "code",
|
| 249 |
+
"execution_count": 6,
|
| 250 |
"metadata": {},
|
| 251 |
"outputs": [
|
| 252 |
{
|
|
|
|
| 254 |
"output_type": "stream",
|
| 255 |
"text": [
|
| 256 |
" 2018 2019 2020 2021\n",
|
| 257 |
+
"2018 0.0 0.121609 0.102711 1.413564\n",
|
| 258 |
+
"2019 0.121609 0.0 0.095984 1.169424\n",
|
| 259 |
+
"2020 0.102711 0.095984 0.0 0.968261\n",
|
| 260 |
+
"2021 1.413564 1.169424 0.968261 0.0\n"
|
| 261 |
]
|
| 262 |
}
|
| 263 |
],
|
|
|
|
| 297 |
},
|
| 298 |
{
|
| 299 |
"cell_type": "code",
|
| 300 |
+
"execution_count": 7,
|
| 301 |
"metadata": {},
|
| 302 |
"outputs": [
|
| 303 |
{
|
|
|
|
| 305 |
"output_type": "stream",
|
| 306 |
"text": [
|
| 307 |
" 2018 2019 2020 2021\n",
|
| 308 |
+
"2018 0.0 0.07773 0.075873 0.452003\n",
|
| 309 |
+
"2019 0.07773 0.0 0.057967 0.388116\n",
|
| 310 |
+
"2020 0.075873 0.057967 0.0 0.038406\n",
|
| 311 |
+
"2021 0.452003 0.388116 0.038406 0.0\n"
|
| 312 |
]
|
| 313 |
}
|
| 314 |
],
|
|
|
|
| 348 |
},
|
| 349 |
{
|
| 350 |
"cell_type": "code",
|
| 351 |
+
"execution_count": 8,
|
| 352 |
"metadata": {},
|
| 353 |
"outputs": [
|
| 354 |
{
|
|
|
|
| 356 |
"output_type": "stream",
|
| 357 |
"text": [
|
| 358 |
" 2018 2019 2020 2021\n",
|
| 359 |
+
"2018 0.0 0.120673 0.119091 0.73603\n",
|
| 360 |
+
"2019 0.120673 0.0 0.094418 0.642491\n",
|
| 361 |
+
"2020 0.119091 0.094418 0.0 0.060314\n",
|
| 362 |
+
"2021 0.73603 0.642491 0.060314 0.0\n"
|
| 363 |
]
|
| 364 |
}
|
| 365 |
],
|
|
|
|
| 399 |
},
|
| 400 |
{
|
| 401 |
"cell_type": "code",
|
| 402 |
+
"execution_count": 9,
|
| 403 |
"metadata": {},
|
| 404 |
"outputs": [
|
| 405 |
{
|
|
|
|
| 407 |
"output_type": "stream",
|
| 408 |
"text": [
|
| 409 |
" 2018 2019 2020 2021\n",
|
| 410 |
+
"2018 0.0 0.28175 0.055327 0.881159\n",
|
| 411 |
+
"2019 0.28175 0.0 0.119729 0.782018\n",
|
| 412 |
+
"2020 0.055327 0.119729 0.0 0.042649\n",
|
| 413 |
+
"2021 0.881159 0.782018 0.042649 0.0\n"
|
| 414 |
]
|
| 415 |
}
|
| 416 |
],
|
|
|
|
| 450 |
},
|
| 451 |
{
|
| 452 |
"cell_type": "code",
|
| 453 |
+
"execution_count": 10,
|
| 454 |
"metadata": {},
|
| 455 |
"outputs": [
|
| 456 |
{
|
|
|
|
| 458 |
"output_type": "stream",
|
| 459 |
"text": [
|
| 460 |
" 2018 2019 2020 2021\n",
|
| 461 |
+
"2018 0.0 0.104899 0.081615 1.013308\n",
|
| 462 |
+
"2019 0.104899 0.0 0.070288 0.89982\n",
|
| 463 |
+
"2020 0.081615 0.070288 0.0 0.840959\n",
|
| 464 |
+
"2021 1.013308 0.89982 0.840959 0.0\n"
|
| 465 |
]
|
| 466 |
}
|
| 467 |
],
|