Spaces:
Runtime error
Runtime error
| def evaluate_model(rmse, nmae=None, rmse_max=500, nmae_max=1.0): | |
| """ | |
| ๋ชจ๋ธ ์ฑ๋ฅ ์ ์ํ ํจ์ | |
| - RMSE์ NMAE๋ ์์์๋ก ์ข์ | |
| - RMSE๋ [0, rmse_max], NMAE๋ [0, nmae_max] ๊ตฌ๊ฐ์ผ๋ก ์ ๊ทํ | |
| - NMAE๊ฐ ์๋ ๊ฒฝ์ฐ 0์ ์ฒ๋ฆฌ | |
| - ์ต์ข ์ ์๋ RMSE์ NMAE ์ ์์ ๋จ์ ํ๊ท | |
| Args: | |
| rmse : float | |
| ๋ชจ๋ธ์ RMSE ๊ฐ | |
| nmae : float or None | |
| ๋ชจ๋ธ์ NMAE ๊ฐ (์์ผ๋ฉด None) | |
| rmse_max : float | |
| RMSE ์ต๋ ๊ธฐ์ค๊ฐ (default=500) | |
| nmae_max : float | |
| NMAE ์ต๋ ๊ธฐ์ค๊ฐ (default=1.0) | |
| Return: | |
| dict : { | |
| "rmse_score": float, | |
| "nmae_score": float, | |
| "final_score": float | |
| } | |
| """ | |
| # RMSE ์ ์ (0~100) | |
| rmse_score = max(0, (1 - rmse / rmse_max) * 100) | |
| # NMAE ์ ์ (0~100) | |
| if nmae is not None: | |
| nmae_score = max(0, (1 - nmae / nmae_max) * 100) | |
| else: | |
| nmae_score = 0 | |
| # ์ต์ข ์ ์ = ๋จ์ ํ๊ท | |
| final_score = (rmse_score + nmae_score) / 2 | |
| return final_score | |
| # return { | |
| # "rmse": round(rmse_score, 2), | |
| # "nmae": round(nmae_score, 2), | |
| # "final": round(final_score, 2) | |
| # } | |