Skip to content

Commit 1b057d0

Browse files
you-n-gXianBW
andauthored
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 <[email protected]>
1 parent a9caab7 commit 1b057d0

File tree

184 files changed

+588
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+588
-11
lines changed

rdagent/app/kaggle/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class Config:
4444
competition: str = ""
4545
"""Kaggle competition name, e.g., 'sf-crime'"""
4646

47+
template_path: str = "rdagent/scenarios/kaggle/experiment/templates"
48+
"""Kaggle competition base templates path"""
49+
4750
local_data_path: str = ""
4851
"""Folder storing Kaggle competition data"""
4952

rdagent/scenarios/kaggle/experiment/kaggle_experiment.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class KGModelExperiment(ModelExperiment[ModelTask, KGFBWorkspace, ModelFBWorkspa
3838
def __init__(self, *args, source_feature_size: int = None, **kwargs) -> None:
3939
super().__init__(*args, **kwargs)
4040
self.experiment_workspace = KGFBWorkspace(
41-
template_folder_path=Path(__file__).parent / f"{KAGGLE_IMPLEMENT_SETTING.competition}_template"
41+
template_folder_path=Path(__file__).resolve()
42+
/ Path(KAGGLE_IMPLEMENT_SETTING.template_path).resolve()
43+
/ KAGGLE_IMPLEMENT_SETTING.competition
4244
)
4345
if len(self.based_experiments) > 0:
4446
self.experiment_workspace.inject_code(**self.based_experiments[-1].experiment_workspace.code_dict)
@@ -62,7 +64,9 @@ class KGFactorExperiment(FeatureExperiment[FactorTask, KGFBWorkspace, FactorFBWo
6264
def __init__(self, *args, source_feature_size: int = None, **kwargs) -> None:
6365
super().__init__(*args, **kwargs)
6466
self.experiment_workspace = KGFBWorkspace(
65-
template_folder_path=Path(__file__).parent / f"{KAGGLE_IMPLEMENT_SETTING.competition}_template"
67+
template_folder_path=Path(__file__).resolve()
68+
/ Path(KAGGLE_IMPLEMENT_SETTING.template_path).resolve()
69+
/ KAGGLE_IMPLEMENT_SETTING.competition
6670
)
6771
if len(self.based_experiments) > 0:
6872
self.experiment_workspace.inject_code(**self.based_experiments[-1].experiment_workspace.code_dict)

rdagent/scenarios/kaggle/experiment/covid19-global-forecasting-week-1_template/fea_share_preprocess.py renamed to rdagent/scenarios/kaggle/experiment/templates/covid19-global-forecasting-week-1/fea_share_preprocess.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/covid19-global-forecasting-week-1_template/feature/feature.py renamed to rdagent/scenarios/kaggle/experiment/templates/covid19-global-forecasting-week-1/feature/feature.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/covid19-global-forecasting-week-1_template/model/model_xgboost.py renamed to rdagent/scenarios/kaggle/experiment/templates/covid19-global-forecasting-week-1/model/model_xgboost.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/covid19-global-forecasting-week-1_template/model/select_xgboost.py renamed to rdagent/scenarios/kaggle/experiment/templates/covid19-global-forecasting-week-1/model/select_xgboost.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/covid19-global-forecasting-week-1_template/train.py renamed to rdagent/scenarios/kaggle/experiment/templates/covid19-global-forecasting-week-1/train.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/digit-recognizer_template/fea_share_preprocess.py renamed to rdagent/scenarios/kaggle/experiment/templates/digit-recognizer/fea_share_preprocess.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/digit-recognizer_template/feature/feature.py renamed to rdagent/scenarios/kaggle/experiment/templates/digit-recognizer/feature/feature.py

File renamed without changes.

rdagent/scenarios/kaggle/experiment/digit-recognizer_template/model/model_nn.py renamed to rdagent/scenarios/kaggle/experiment/templates/digit-recognizer/model/model_nn.py

File renamed without changes.

0 commit comments

Comments
 (0)