fix: handle division by zero in percentage calculations (#550)

* fix: Handle division by zero in percentage calculations

* lint
This commit is contained in:
you-n-g
2025-02-05 10:21:53 +08:00
committed by GitHub
parent 8bc381855e
commit cade50de89
6 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
"""
CLI entrance for all rdagent application.
This will
This will
- make rdagent a nice entry and
- autoamtically load dotenv
"""
@@ -1,6 +1,6 @@
"""
Beyond previous tests
-
-
"""
import json
@@ -3,8 +3,8 @@
Loop should not large change exclude
- Action Choice[current data loader & spec]
- other should share
- Propose[choice] => Task[Choice] => CoSTEER =>
-
- Propose[choice] => Task[Choice] => CoSTEER =>
-
Extra feature:
- cache
+1 -3
View File
@@ -1,6 +1,4 @@
"""
"""
""" """
from __future__ import annotations
+2 -2
View File
@@ -270,10 +270,10 @@ def all_summarize_win():
base_df.loc[k, "Competition"] = v["competition"]
base_df.loc[k, "Total Loops"] = loop_num
base_df.loc[k, "Made Submission"] = (
f"{v['made_submission_num']} ({round(v['made_submission_num'] / loop_num * 100, 2)}%)"
f"{v['made_submission_num']} ({round(v['made_submission_num'] / loop_num * 100, 2) if loop_num != 0 else 0}%)"
)
base_df.loc[k, "Successful Final Decision"] = (
f"{v['success_loop_num']} ({round(v['success_loop_num'] / loop_num * 100, 2)}%)"
f"{v['success_loop_num']} ({round(v['success_loop_num'] / loop_num * 100, 2) if loop_num != 0 else 0}%)"
)
base_df.loc[k, "Medal"] = v["medal"]
st.dataframe(base_df)
@@ -1,7 +1,7 @@
"""
Motivation of the model:
The Linear Regression model is chosen for its simplicity and interpretability. It is a good starting point for regression tasks
and provides a baseline to compare more complex models against. Linear Regression assumes a linear relationship between the
and provides a baseline to compare more complex models against. Linear Regression assumes a linear relationship between the
features and the target variable, which can be a reasonable assumption for many problems.
"""