2024-06-27 09:39:17 +01:00
|
|
|
from rdagent.benchmark.conf import BenchmarkSettings
|
2024-06-14 12:59:44 +08:00
|
|
|
from rdagent.core.utils import import_class
|
|
|
|
|
from rdagent.benchmark.eval_method import FactorImplementEval
|
2024-06-27 09:39:17 +01:00
|
|
|
from rdagent.factor_implementation.task_loader.json_loader import FactorTestCaseLoaderFromJsonFile
|
2024-06-14 12:59:44 +08:00
|
|
|
|
|
|
|
|
# 1.read the settings
|
|
|
|
|
bs = BenchmarkSettings()
|
|
|
|
|
|
|
|
|
|
# 2.read and prepare the eval_data
|
2024-06-27 09:39:17 +01:00
|
|
|
test_cases = FactorTestCaseLoaderFromJsonFile().load(bs.bench_data_path)
|
2024-06-14 12:59:44 +08:00
|
|
|
|
|
|
|
|
# 3.declare the method to be tested and pass the arguments.
|
2024-06-27 09:39:17 +01:00
|
|
|
|
2024-06-14 12:59:44 +08:00
|
|
|
method_cls = import_class(bs.bench_method_cls)
|
2024-06-27 09:39:17 +01:00
|
|
|
generate_method = method_cls()
|
2024-06-14 12:59:44 +08:00
|
|
|
|
|
|
|
|
# 4.declare the eval method and pass the arguments.
|
|
|
|
|
eval_method = FactorImplementEval(
|
|
|
|
|
method=generate_method,
|
|
|
|
|
test_cases=test_cases,
|
|
|
|
|
catch_eval_except=True,
|
|
|
|
|
test_round=bs.bench_test_round,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# 5.run the eval
|
2024-06-27 09:39:17 +01:00
|
|
|
res = eval_method.eval()
|