Extract factors from financial reports loop finished. (#90)

- Extract factors from financial reports loop finished.

- Fix some small bugs.
This commit is contained in:
WinstonLiyt
2024-07-20 12:31:40 +08:00
committed by GitHub
parent 8c600f42ae
commit c17244a317
10 changed files with 357 additions and 19 deletions
@@ -334,6 +334,13 @@ class FactorValueEvaluator(FactorEvaluator):
) -> Tuple:
conclusions = []
# Initialize result variables
single_column_result = None
same_index_result = None
output_format_result = None
equal_value_ratio_result = 0
high_correlation_result = False
# Check if both dataframe has only one columns
feedback_str, _ = FactorSingleColumnEvaluator(self.scen).evaluate(implementation, gt_implementation)
conclusions.append(feedback_str)
@@ -373,9 +380,6 @@ class FactorValueEvaluator(FactorEvaluator):
high_correlation_result = False
feedback_str = "The source dataframe and the ground truth dataframe have different index. Give up comparing the values and correlation because it's useless"
conclusions.append(feedback_str)
else:
equal_value_ratio_result = 0
high_correlation_result = False
# Combine all conclusions into a single string
conclusion_str = "\n".join(conclusions)
@@ -68,9 +68,9 @@ class MultiProcessEvolvingStrategy(EvolvingStrategy):
# if the number of factors to be implemented is larger than the limit, we need to select some of them
if FACTOR_IMPLEMENT_SETTINGS.select_ratio < 1:
# if the number of loops is equal to the select_loop, we need to select some of them
implementation_factors_per_round = int(
FACTOR_IMPLEMENT_SETTINGS.select_ratio * len(to_be_finished_task_index)
)
implementation_factors_per_round = round(FACTOR_IMPLEMENT_SETTINGS.select_ratio * len(to_be_finished_task_index) + 0.5) # ceilling
implementation_factors_per_round = min(implementation_factors_per_round, len(to_be_finished_task_index)) # but not exceed the total number of tasks
if FACTOR_IMPLEMENT_SETTINGS.select_method == "random":
to_be_finished_task_index = RandomSelect(
to_be_finished_task_index,