소스 정보
- 저장소
- cxcscmu/SkillLearnBench
- 최근 소스 활동
- 2026년 4월 24일 05:14
- 감지된 SKILL.md 언어
- 영어
- 스타
- 77
- 포크
- 4
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill model-calibration명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | model-calibration |
| description | Calculating RMSE metrics and parameter calibration for lake model validation |
Model calibration involves adjusting parameters to minimize differences between simulations and observations. RMSE (Root Mean Squared Error) is a standard metric for measuring model performance.
RMSE = sqrt(mean((simulated - observed)^2))
import numpy as np
import pandas as pd
def calculate_rmse(simulated, observed):
"""Calculate RMSE between matched pairs"""
if len(simulated) == 0:
return np.nan
residuals = simulated - observed
rmse = np.sqrt(np.mean(residuals**2))
return rmse
def calculate_metrics(sim_temps, obs_temps, depths=None, dates=None):
"""
Calculate multiple RMSE metrics
Parameters:
- sim_temps: matched simulated temperatures
- obs_temps: matched observed temperatures
- depths: depth of each match (for deep water filtering)
- dates: datetime of each match (for seasonal filtering)
Returns:
- overall_rmse: RMSE of all matched pairs
- annual_deep_rmse: RMSE of pairs at depths >= 13m
- summer_deep_rmse: RMSE of summer (Jun-Sep) pairs at depths >= 13m
"""
overall_rmse = calculate_rmse(sim_temps, obs_temps)
# Annual deep water (depths >= 13m)
if depths is not None:
deep_mask = np.array(depths) >= 13
annual_deep_rmse = calculate_rmse(
sim_temps[deep_mask],
obs_temps[deep_mask]
)
else:
annual_deep_rmse = np.nan
# Summer deep water (Jun-Sep, depths >= 13m)
if dates is not None and depths is not None:
summer_mask = (np.array([d.month for d in dates]) >= 6) & \
(np.array([d.month for d in dates]) <= 9)
deep_mask = np.array(depths) >= 13
combined_mask = summer_mask & deep_mask
summer_deep_rmse = calculate_rmse(
sim_temps[combined_mask],
obs_temps[combined_mask]
)
else:
summer_deep_rmse = np.nan
return {
'overall_rmse': overall_rmse,
'annual_deep_rmse': annual_deep_rmse,
'summer_deep_rmse': summer_deep_rmse
}
Critical: Use exact datetime + rounded-depth matching (no interpolation)
def match_obs_to_sim(obs_df, sim_temps, sim_z, sim_dates, round_depth=1):
"""
Match observations to simulation output
obs_df: DataFrame with columns [datetime, depth, temp]
sim_temps: [time, depth] array
sim_z: depth values
sim_dates: datetime for each time step
round_depth: rounding for depth matching
Returns: matched simulation temps, observed temps, and metadata
"""
import pandas as pd
obs_df['depth_rounded'] = (obs_df['depth'] / round_depth).round() * round_depth
matched_sim = []
matched_obs = []
matched_depths = []
matched_dates = []
for idx, row in obs_df.iterrows():
obs_datetime = pd.Timestamp(row['datetime'])
obs_depth = row['depth_rounded']
obs_temp = row['temp']
# Find exact datetime match
time_matches = [i for i, d in enumerate(sim_dates)
if d == obs_datetime]
# Find exact depth match
depth_matches = [i for i, z in enumerate(sim_z)
if z == obs_depth]
# Need both to match
if time_matches and depth_matches:
t_idx = time_matches[0]
z_idx = depth_matches[0]
sim_temp = sim_temps[t_idx, z_idx]
matched_sim.append(sim_temp)
matched_obs.append(obs_temp)
matched_depths.append(obs_depth)
matched_dates.append(obs_datetime)
return (np.array(matched_sim), np.array(matched_obs),
matched_depths, matched_dates)
Run model with one parameter varied at a time to identify most influential parameters.
For 5 parameters with small ranges, can do grid search:
Always verify final parameters are within published ranges:
def validate_parameters(params):
ranges = {
'Kw': (0.1, 0.5),
'coef_mix_hyp': (0.3, 0.7),
'wind_factor': (0.7, 1.3),
'lw_factor': (0.7, 1.3),
'ch': (0.0005, 0.002)
}
for param, (min_val, max_val) in ranges.items():
if not (min_val <= params[param] <= max_val):
raise ValueError(f"{param} out of range: {params[param]}")
return True
For Lake Mendota:
Model is successful when ALL three thresholds are met.