Files
NexQuant/rdagent/app/data_science/conf.py
T
Roland Minrui 6f3a44c18a fix: add spec for hyperparameters in task design and coder (#995)
* init commit

* remove the 5-fold spec from prompts

* refine the hyperparameter specification

* do not sample data

* a small spelling issue

* refine prompt to avoid submission cheating

* do not sample data

* simplify code

* refine the coder evaluator prompt

* refine wording

* remove runtime from proposal

* refine wording

* refine prompt

* add gpu info in runtime_info.py

* modify the spec

* add router and add refinement exp gen

* fix prompt bug

* use rule-based logic for router

* complete the prompt

* fix circular import bug

* fix bug

* make refine_decision optional

* update pipeline prompts: (1) add scenary: in an iterative cooding loop and use sample datasets (2)add some generation tops in coding (3)add evaluation guidelines in evaluation (4)polish the json schema and description

* fix a small bug

* fix a small bug

* rdagent/scenarios/data_science/loop.py back to the original version

* refactor: replace _get_exp_gen with default_exp_gen for exp generation

* import

* refactor: make the __init__ back to main

* fix small bugs

* fix bugs for proposal_version

* move refine into runner

* check early stop

* EDA improvement & coder classes number

* fix CI

* slightly refine the prompt

* remove rule_base_eval and remove useless prompt

---------

Co-authored-by: Xu <v-xuminrui@microsoft.com>
Co-authored-by: TPLin22 <tplin2@163.com>
Co-authored-by: amstrongzyf <amstrongzyf@126.com>
Co-authored-by: Xu Yang <peteryang@vip.qq.com>
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
Co-authored-by: Young <afe.young@gmail.com>
2025-07-08 15:22:39 +08:00

116 lines
4.0 KiB
Python

from typing import Literal
from pydantic_settings import SettingsConfigDict
from rdagent.app.kaggle.conf import KaggleBasePropSetting
class DataScienceBasePropSetting(KaggleBasePropSetting):
# TODO: Kaggle Setting should be the subclass of DataScience
model_config = SettingsConfigDict(env_prefix="DS_", protected_namespaces=())
# Main components
## Scen
scen: str = "rdagent.scenarios.data_science.scen.KaggleScen"
"""
Scenario class for data science tasks.
- For Kaggle competitions, use: "rdagent.scenarios.data_science.scen.KaggleScen"
- For custom data science scenarios, use: "rdagent.scenarios.data_science.scen.DataScienceScen"
"""
hypothesis_gen: str = "rdagent.scenarios.data_science.proposal.exp_gen.proposal.DSProposalV2ExpGen"
"""Hypothesis generation class"""
## Workflow Related
consecutive_errors: int = 5
## Coding Related
coding_fail_reanalyze_threshold: int = 3
debug_timeout: int = 600
"""The timeout limit for running on debugging data"""
full_timeout: int = 3600
"""The timeout limit for running on full data"""
### specific feature
#### enable specification
spec_enabled: bool = True
#### proposal related
# proposal_version: str = "v2" deprecated
coder_on_whole_pipeline: bool = True
max_trace_hist: int = 3
coder_max_loop: int = 10
runner_max_loop: int = 1
sample_data_by_LLM: bool = False
use_raw_description: bool = False
show_nan_columns: bool = False
#### model dump
enable_model_dump: bool = False
enable_doc_dev: bool = False
model_dump_check_level: Literal["medium", "high"] = "medium"
### knowledge base
enable_knowledge_base: bool = False
knowledge_base_version: str = "v1"
knowledge_base_path: str | None = None
idea_pool_json_path: str | None = None
### archive log folder after each loop
enable_log_archive: bool = True
log_archive_path: str | None = None
log_archive_temp_path: str | None = (
None # This is to store the mid tar file since writing the tar file is preferred in local storage then copy to target storage
)
#### Evaluation on Test related
eval_sub_dir: str = "eval" # TODO: fixme, this is not a good name
"""We'll use f"{DS_RD_SETTING.local_data_path}/{DS_RD_SETTING.eval_sub_dir}/{competition}"
to find the scriipt to evaluate the submission on test"""
"""---below are the settings for multi-trace---"""
### multi-trace related
max_trace_num: int = 3
"""The maximum number of traces to grow before merging"""
#### multi-trace:checkpoint selector
selector_name: str = "rdagent.scenarios.data_science.proposal.exp_gen.ckp_select.LatestCKPSelector"
"""The name of the selector to use"""
sota_count_window: int = 5
"""The number of trials to consider for SOTA count"""
sota_count_threshold: int = 1
"""The threshold for SOTA count"""
#### multi-trace: SOTA experiment selector
sota_exp_selector_name: str = "rdagent.scenarios.data_science.proposal.exp_gen.sota_exp_select.GlobalSOTASelector"
"""The name of the SOTA experiment selector to use"""
### multi-trace:inject optimals for multi-trace
# inject diverse when start a new sub-trace
enable_inject_diverse: bool = False
# inject knowledge at the root of the trace
enable_inject_knowledge_at_root: bool = False
# enable different version of DSExpGen for multi-trace
enable_multi_version_exp_gen: bool = False
exp_gen_version_list: str = "v3,v2"
#### multi-trace: time for final multi-trace merge
merge_hours: int = 2
"""The time for merge"""
#### multi-trace: max SOTA-retrieved number, used in AutoSOTAexpSelector
# constrains the number of SOTA experiments to retrieve, otherwise too many SOTA experiments to retrieve will cause the exceed of the context window of LLM
max_sota_retrieved_num: int = 10
"""The maximum number of SOTA experiments to retrieve in a LLM call"""
DS_RD_SETTING = DataScienceBasePropSetting()