2025-03-05 18:30:02 +08:00
|
|
|
from pydantic_settings import SettingsConfigDict
|
|
|
|
|
|
|
|
|
|
from rdagent.core.conf import ExtendedBaseSettings
|
2024-08-19 10:58:28 +08:00
|
|
|
|
|
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
class KaggleBasePropSetting(ExtendedBaseSettings):
|
2025-03-05 18:30:02 +08:00
|
|
|
model_config = SettingsConfigDict(env_prefix="KG_", protected_namespaces=())
|
2024-08-19 10:58:28 +08:00
|
|
|
|
|
|
|
|
# 1) overriding the default
|
2024-09-11 15:26:52 +08:00
|
|
|
scen: str = "rdagent.scenarios.kaggle.experiment.scenario.KGScenario"
|
2024-08-19 10:58:28 +08:00
|
|
|
"""Scenario class for data mining model"""
|
|
|
|
|
|
2024-09-11 15:26:52 +08:00
|
|
|
hypothesis_gen: str = "rdagent.scenarios.kaggle.proposal.proposal.KGHypothesisGen"
|
2024-08-19 10:58:28 +08:00
|
|
|
"""Hypothesis generation class"""
|
|
|
|
|
|
2024-09-11 15:26:52 +08:00
|
|
|
hypothesis2experiment: str = "rdagent.scenarios.kaggle.proposal.proposal.KGHypothesis2Experiment"
|
2024-08-19 10:58:28 +08:00
|
|
|
"""Hypothesis to experiment class"""
|
|
|
|
|
|
2024-09-11 15:26:52 +08:00
|
|
|
feature_coder: str = "rdagent.scenarios.kaggle.developer.coder.KGFactorCoSTEER"
|
|
|
|
|
"""Feature Coder class"""
|
2024-08-19 10:58:28 +08:00
|
|
|
|
2024-09-28 00:40:25 +08:00
|
|
|
model_feature_selection_coder: str = "rdagent.scenarios.kaggle.developer.coder.KGModelFeatureSelectionCoder"
|
|
|
|
|
"""Model Feature Selection Coder class"""
|
|
|
|
|
|
2024-09-11 15:26:52 +08:00
|
|
|
model_coder: str = "rdagent.scenarios.kaggle.developer.coder.KGModelCoSTEER"
|
|
|
|
|
"""Model Coder class"""
|
2024-08-19 10:58:28 +08:00
|
|
|
|
2024-09-11 15:26:52 +08:00
|
|
|
feature_runner: str = "rdagent.scenarios.kaggle.developer.runner.KGFactorRunner"
|
|
|
|
|
"""Feature Runner class"""
|
|
|
|
|
|
|
|
|
|
model_runner: str = "rdagent.scenarios.kaggle.developer.runner.KGModelRunner"
|
|
|
|
|
"""Model Runner class"""
|
|
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
summarizer: str = "rdagent.scenarios.kaggle.developer.feedback.KGExperiment2Feedback"
|
2024-08-19 10:58:28 +08:00
|
|
|
"""Summarizer class"""
|
|
|
|
|
|
|
|
|
|
evolving_n: int = 10
|
|
|
|
|
"""Number of evolutions"""
|
|
|
|
|
|
|
|
|
|
competition: str = ""
|
2024-10-23 13:26:57 +08:00
|
|
|
"""Kaggle competition name, e.g., 'sf-crime'"""
|
2024-08-19 10:58:28 +08:00
|
|
|
|
2024-11-20 17:01:18 +08:00
|
|
|
template_path: str = "rdagent/scenarios/kaggle/experiment/templates"
|
|
|
|
|
"""Kaggle competition base templates path"""
|
|
|
|
|
|
2024-11-04 14:57:10 +08:00
|
|
|
local_data_path: str = ""
|
2024-10-23 13:26:57 +08:00
|
|
|
"""Folder storing Kaggle competition data"""
|
|
|
|
|
|
2025-05-06 16:00:13 +08:00
|
|
|
# Evaluation on Test related
|
2025-01-17 22:53:05 +08:00
|
|
|
if_using_mle_data: bool = False
|
|
|
|
|
auto_submit: bool = False
|
|
|
|
|
"""Automatically upload and submit each experiment result to Kaggle platform"""
|
2025-05-06 16:00:13 +08:00
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
# Conditionally set the knowledge_base based on the use of graph RAG
|
|
|
|
|
knowledge_base: str = ""
|
|
|
|
|
"""Knowledge base class, uses 'KGKnowledgeGraph' when advanced graph-based RAG is enabled, otherwise empty."""
|
2024-10-23 13:26:57 +08:00
|
|
|
if_action_choosing_based_on_UCB: bool = False
|
|
|
|
|
"""Enable decision mechanism based on UCB algorithm"""
|
2024-09-20 20:49:44 +08:00
|
|
|
|
2024-09-27 00:17:28 +08:00
|
|
|
domain_knowledge_path: str = "/data/userdata/share/kaggle/domain_knowledge"
|
2024-10-23 13:26:57 +08:00
|
|
|
"""Folder storing domain knowledge files in .case format"""
|
2024-09-27 00:17:28 +08:00
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
knowledge_base_path: str = "kg_graph.pkl"
|
|
|
|
|
"""Advanced version of graph-based RAG"""
|
|
|
|
|
|
2024-10-23 13:26:57 +08:00
|
|
|
rag_path: str = "git_ignore_folder/kaggle_vector_base.pkl"
|
|
|
|
|
"""Base version of vector-based RAG"""
|
2024-09-19 11:33:33 +08:00
|
|
|
|
2024-10-23 13:26:57 +08:00
|
|
|
if_using_vector_rag: bool = False
|
|
|
|
|
"""Enable basic vector-based RAG"""
|
2024-09-24 15:03:18 +08:00
|
|
|
|
2024-09-27 00:17:28 +08:00
|
|
|
if_using_graph_rag: bool = False
|
2024-10-23 13:26:57 +08:00
|
|
|
"""Enable advanced graph-based RAG"""
|
2024-09-27 00:17:28 +08:00
|
|
|
|
2024-09-29 15:51:51 +08:00
|
|
|
mini_case: bool = False
|
2024-10-23 13:26:57 +08:00
|
|
|
"""Enable mini-case study for experiments"""
|
2024-09-29 01:15:33 -04:00
|
|
|
|
2025-08-05 18:16:10 +08:00
|
|
|
time_ratio_limit_to_enable_hyperparameter_tuning: float = 1
|
2025-08-29 16:59:22 +08:00
|
|
|
"""
|
|
|
|
|
Runner time ratio limit to enable hyperparameter tuning, if not change, hyperparameter tuning is always enabled in the first evolution.
|
|
|
|
|
"""
|
2025-08-12 21:12:54 +08:00
|
|
|
|
|
|
|
|
res_time_ratio_limit_to_enable_hyperparameter_tuning: float = 1
|
2025-08-29 16:59:22 +08:00
|
|
|
"""
|
|
|
|
|
Overall rest time ratio limit to enable hyperparameter tuning, if not change, hyperparameter tuning is always enabled in the first evolution.
|
|
|
|
|
`1` indicate we enable hyperparameter tuning when we have 100% residual time. (so hyperparameter tuning is always enabled)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
only_first_loop_enable_hyperparameter_tuning: bool = True
|
|
|
|
|
"""Enable hyperparameter tuning feedback only in the first loop of evaluation."""
|
2025-08-12 21:12:54 +08:00
|
|
|
|
|
|
|
|
only_enable_tuning_in_merge: bool = False
|
|
|
|
|
"""Enable hyperparameter tuning only in the merge stage"""
|
2025-07-31 16:47:19 +08:00
|
|
|
|
2024-08-19 10:58:28 +08:00
|
|
|
|
2024-09-12 00:30:16 +08:00
|
|
|
KAGGLE_IMPLEMENT_SETTING = KaggleBasePropSetting()
|