Files
NexQuant/rdagent/scenarios/data_science/experiment/experiment.py
T
you-n-g c40f22361c refactor: update MLEBench submission validation logic in runner and eval (#769)
* refactor: Update MLEBench submission validation logic in runner and eval

* lint

* Delete docs/scens/data_science.rst

* fix: update variable name in feedback prompt

* define a variable: submission_check_out

* fix: update submission check handling for MLE data

* refactor: reformat if condition for clarity

---------

Co-authored-by: Linlang <Lv.Linlang@hotmail.com>
2025-04-09 13:34:48 +08:00

32 lines
1.2 KiB
Python

import re
from typing import Literal
import pandas as pd
from rdagent.core.experiment import Experiment, FBWorkspace, Task
COMPONENT = Literal["DataLoadSpec", "FeatureEng", "Model", "Ensemble", "Workflow"]
class DSExperiment(Experiment[Task, FBWorkspace, FBWorkspace]):
def __init__(self, pending_tasks_list: list, *args, **kwargs) -> None:
super().__init__(sub_tasks=[], *args, **kwargs)
# Status
# - Initial: blank;
# - Injecting from SOTA code;
# - New version no matter successful or not
# the initial workspace or the successful new version after coding
self.experiment_workspace = FBWorkspace()
self.pending_tasks_list = pending_tasks_list
self.format_check_result = None
# this field is optional. It is not none only when we have a format checker. Currently, only following cases are supported.
# - mle-bench
def is_ready_to_run(self) -> bool:
"""
ready to run does not indicate the experiment is runnable
(so it is different from `trace.next_incomplete_component`.)
"""
return self.experiment_workspace is not None and "main.py" in self.experiment_workspace.file_dict