Skip to content

Commit

Permalink
Ml dev add metric (#37)
Browse files Browse the repository at this point in the history
* power grid benchmark configurations updated with new metric MAPE10 for ML category

* external metrics updated with a new MAPE10 metric imported from LeapNet
  • Loading branch information
Mleyliabadi authored Apr 24, 2024
1 parent fb4048e commit 5a2816f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
8 changes: 3 additions & 5 deletions configurations/powergrid/benchmarks/l2rpn_case14_sandbox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,15 @@ dataset_create_params = {
"max_disc": 2} # authorize at most 2 disconnection
}
eval_dict = {
"ML": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "TIME_INF"],
"ML": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "MAPE_10_avg", "TIME_INF"],
"Physics": ["CURRENT_POS", "VOLTAGE_POS", "LOSS_POS", "DISC_LINES", "CHECK_LOSS", "CHECK_GC", "CHECK_LC", "CHECK_JOULE_LAW"],
"IndRed": ["TIME_INF"],
"OOD": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "TIME_INF"]}
"OOD": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "MAPE_10_avg", "TIME_INF"]}
eval_params = {
"inf_batch_size": 14000,
"EL_tolerance": 0.04,
"GC_tolerance": 1e-3,
"LC_tolerance": 1e-2,
"KCL": {"tolerance": 1e-2,
"ACTIVE_FLOW": True},
"JOULE_tolerance": 1e-2
"JOULE_tolerance": 1e-2,
}

4 changes: 2 additions & 2 deletions configurations/powergrid/benchmarks/l2rpn_idf_2023.ini
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ dataset_create_params = {
"action_by_area": True} # authorize at most 2 disconnection
}
eval_dict = {
"ML": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "TIME_INF"],
"ML": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "MAPE_10_avg", "TIME_INF"],
"Physics": ["CURRENT_POS", "VOLTAGE_POS", "LOSS_POS", "DISC_LINES", "CHECK_LOSS", "CHECK_GC", "CHECK_LC", "CHECK_JOULE_LAW"],
"IndRed": ["TIME_INF"],
"OOD": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "TIME_INF"]}
"OOD": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "MAPE_10_avg", "TIME_INF"]}
eval_params = {
"inf_batch_size": 14000,
"EL_tolerance": 0.04,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,14 @@ dataset_create_params = {
"max_disc": 2} # authorize at most 2 disconnection
}
eval_dict = {
"ML": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "TIME_INF"],
"Physics": ["CURRENT_POS", "VOLTAGE_POS", "LOSS_POS", "DISC_LINES", "CHECK_LOSS", "CHECK_GC", "CHECK_LC", "CHECK_VOLTAGE_EQ"],
"ML": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "MAPE_10_avg", "TIME_INF"],
"Physics": ["CURRENT_POS", "VOLTAGE_POS", "LOSS_POS", "DISC_LINES", "CHECK_LOSS", "CHECK_GC", "CHECK_LC", "CHECK_JOULE_LAW"],
"IndRed": ["TIME_INF"],
"OOD": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "TIME_INF"]}
"OOD": ["MSE_avg", "MAE_avg", "MAPE_avg", "MAPE_90_avg", "MAPE_10_avg", "TIME_INF"]}
eval_params = {
"inf_batch_size": 59000,
"inf_batch_size": 14000,
"EL_tolerance": 0.04,
"GC_tolerance": 1e-3,
"LC_tolerance": 1e-2,
"KCL": {"tolerance": 1e-2,
"ACTIVE_FLOW": True},
"VOLTAGE_EQ": {"tolerance": 1e-4,
"verify_theta": False}
"JOULE_tolerance": 1e-2,
}
7 changes: 7 additions & 0 deletions lips/metrics/ml_metrics/external_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@
metric_factory.register_metric("MAPE_90", lambda y_true, y_pred: mape_quantile(y_true=y_true,
y_pred=y_pred,
multioutput="raw_values"))
metric_factory.register_metric("MAPE_10_avg", lambda y_true, y_pred: mape_quantile(y_true=y_true,
y_pred=y_pred,
quantile=0.9))
metric_factory.register_metric("MAPE_10", lambda y_true, y_pred: mape_quantile(y_true=y_true,
y_pred=y_pred,
multioutput="raw_values",
quantile=0.9))
except ImportError as exc_:
pass

0 comments on commit 5a2816f

Please sign in to comment.