feat: kaggle refactor (#489)

* init trail

* Add spec info

* auto unzip mlebench prepared data for out scenario

* successfully run example

* successfully run main

* simplify load traing

* extract load_from_raw_data

* split the fies(still buggy)
It should stop on ~20 epoch and reach the end

* some changes

* Fix bug to run example

* (success) until feature

* refine model and ensemble

* add metrics in ens.py

* update README &  spec.md

* ens change

* fix ens bug

* Delete rdagent/scenarios/kaggle/tpl_ex/aerial-cactus-identification/train.py

* add template_path in KG_conf

* fix test kaggle

* CI

* make test_import not check kaggle template codes

---------

Co-authored-by: Bowen Xian <xianbowen@outlook.com>
This commit is contained in:
you-n-g
2024-11-20 17:01:18 +08:00
committed by GitHub
parent 5d5084b87e
commit 7ffe284c12
184 changed files with 588 additions and 11 deletions
+3
View File
@@ -44,6 +44,9 @@ class KaggleBasePropSetting(BasePropSetting):
competition: str = ""
"""Kaggle competition name, e.g., 'sf-crime'"""
template_path: str = "rdagent/scenarios/kaggle/experiment/templates"
"""Kaggle competition base templates path"""
local_data_path: str = ""
"""Folder storing Kaggle competition data"""
@@ -38,7 +38,9 @@ class KGModelExperiment(ModelExperiment[ModelTask, KGFBWorkspace, ModelFBWorkspa
def __init__(self, *args, source_feature_size: int = None, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.experiment_workspace = KGFBWorkspace(
template_folder_path=Path(__file__).parent / f"{KAGGLE_IMPLEMENT_SETTING.competition}_template"
template_folder_path=Path(__file__).resolve()
/ Path(KAGGLE_IMPLEMENT_SETTING.template_path).resolve()
/ KAGGLE_IMPLEMENT_SETTING.competition
)
if len(self.based_experiments) > 0:
self.experiment_workspace.inject_code(**self.based_experiments[-1].experiment_workspace.code_dict)
@@ -62,7 +64,9 @@ class KGFactorExperiment(FeatureExperiment[FactorTask, KGFBWorkspace, FactorFBWo
def __init__(self, *args, source_feature_size: int = None, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.experiment_workspace = KGFBWorkspace(
template_folder_path=Path(__file__).parent / f"{KAGGLE_IMPLEMENT_SETTING.competition}_template"
template_folder_path=Path(__file__).resolve()
/ Path(KAGGLE_IMPLEMENT_SETTING.template_path).resolve()
/ KAGGLE_IMPLEMENT_SETTING.competition
)
if len(self.based_experiments) > 0:
self.experiment_workspace.inject_code(**self.based_experiments[-1].experiment_workspace.code_dict)

Some files were not shown because too many files have changed in this diff Show More