# ============================================================================= # PA3 experiment: ML/DL bias correction + year-blocked stacking ensemble # ============================================================================= # Paths data_dir: /home/tanpv/Progs/562_VNU/Data/For_BC mask_file: /home/tanpv/Data/AWC/Mask_VN_0.25_Corrected.nc output_dir: outputs file_pattern: "lead{lead}_{source_model}_01_BL_Test_VN.nc" # Data conventions year_start: 1982 year_end: 2021 missing_value: -99.0 valid_regions: [1, 2, 3, 4, 5, 6, 7] # Main experiment dimensions source_models: [RegCM, clWRF] leads: [1, 2, 3, 4, 5, 6] targets: [pr_o, t2_o] spatial_modes: [regional, national] predictor_sets: [P2, P4] # Individual base-correction methods. Ridge is the benchmark. methods: - raw - ridge - xgb_d2 - xgb_d3 - xgb_d4 - xgb_slow - xgb_regularized - mlp_small - mlp_medium - mlp_deep - ann_tanh - ann_lbfgs # Split by target year. Metrics are computed only on the independent test period. train_years: [1982, 2013] test_years: [2014, 2021] # Bias-correction formulation modeling_style: monthly_anomaly include_lat_lon: true include_region_feature: true clip_precipitation_to_zero: true # Runtime n_jobs: 20 overwrite: false save_predictions: true random_seed: 42 # ============================================================================= # Metrics rule # ============================================================================= # pr_o: RMAE_percent is the primary absolute-error metric; CORR is secondary. # t2_o: MAE (deg C) is the primary absolute-error metric; RMSE/CORR are secondary. rmae_percent: true primary_metrics: pr_o: [RMAE_percent, CORR] t2_o: [MAE, RMSE, CORR] # ============================================================================= # Individual model hyperparameters # ============================================================================= ridge_alpha: 1.0 xgboost_base_params: objective: reg:squarederror n_jobs: 1 tree_method: hist verbosity: 0 xgboost_variants: xgb_d2: n_estimators: 500 max_depth: 2 learning_rate: 0.03 subsample: 0.90 colsample_bytree: 0.90 reg_lambda: 5.0 reg_alpha: 0.0 min_child_weight: 3.0 xgb_d3: n_estimators: 500 max_depth: 3 learning_rate: 0.03 subsample: 0.90 colsample_bytree: 0.90 reg_lambda: 5.0 reg_alpha: 0.0 min_child_weight: 3.0 xgb_d4: n_estimators: 500 max_depth: 4 learning_rate: 0.03 subsample: 0.85 colsample_bytree: 0.85 reg_lambda: 8.0 reg_alpha: 0.0 min_child_weight: 4.0 xgb_slow: n_estimators: 900 max_depth: 3 learning_rate: 0.015 subsample: 0.90 colsample_bytree: 0.90 reg_lambda: 8.0 reg_alpha: 0.0 min_child_weight: 3.0 xgb_regularized: n_estimators: 700 max_depth: 2 learning_rate: 0.02 subsample: 0.75 colsample_bytree: 0.75 reg_lambda: 15.0 reg_alpha: 0.5 min_child_weight: 5.0 mlp_base_params: max_iter: 700 early_stopping: true validation_fraction: 0.15 n_iter_no_change: 40 learning_rate_init: 0.001 alpha: 0.001 solver: adam activation: relu mlp_variants: mlp_small: hidden_layer_sizes: [32] alpha: 0.001 mlp_medium: hidden_layer_sizes: [64, 32] alpha: 0.001 mlp_deep: hidden_layer_sizes: [128, 64, 32] alpha: 0.003 ann_tanh: hidden_layer_sizes: [64, 32] activation: tanh alpha: 0.001 ann_lbfgs: hidden_layer_sizes: [32] activation: tanh solver: lbfgs alpha: 0.01 max_iter: 700 # ============================================================================= # Stacking ensemble options # ============================================================================= stacking: enabled: true # Use year-blocked CV inside training years to generate out-of-fold base predictions. # This avoids training the meta-model on predictions from models that already saw those samples. cv_type: year_kfold n_splits: 8 shuffle_years: false # Build three products: # within_RegCM: stack only RegCM base models # within_clWRF: stack only clWRF base models # multi_source: stack RegCM + clWRF base models together scopes: [within_RegCM, within_clWRF, multi_source] # Base models used by stacking. Keep this list shorter than the full methods list to limit cost. base_methods: [ridge, xgb_d2, xgb_regularized, mlp_small, ann_tanh] base_predictor_sets: [P2, P4] # Meta-models to test. stack_mean has no fitted parameters; stack_nnls uses non-negative linear weights. meta_methods: [stack_mean, stack_ridge, stack_elasticnet, stack_nnls] stack_ridge_alpha: 1.0 stack_elasticnet_alpha: 0.001 stack_elasticnet_l1_ratio: 0.25 # Optional geographical features at meta level. include_meta_geo_features: false # Minimum number of samples required to train a meta-model for a region/month. min_meta_samples: 30