-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: supporting various Kaggle competitions & scenarios for RD-Agent (…
…#409) * Fixes on kaggle output * feat: add kaggle s3e14 template (#394) * add s3e14 template * fix CI * Initialisation of a template of competition * add kaggle s3e16 template (#396) * get kaggle competition scores (#397) * Adding a new competition s4e6 * feat: s4e5 (#400) * init for s4e5 * edit s4e5 * ci issue * feat: S4e3 (#402) * Initialisation of a template of competition * Adding a new competition s4e6 * Competition Initialised * Fixed to make sure that now it runs * Fixing for CI * correct evaluation (#403) * find rank in leaderboard (#405) * fix: model templates for KG scenario (#408) * fix feature selection for some models * feat select template * Updating the prompts for a more powerful model tuning * refine the prompt * fix: template error in s4e6 * feat: show simple execution time in demo (#410) * show time in kaggle demo * change color * fix a small bug * edit loop.py and proposal * delete useless files * CI issues * ci issue --------- Co-authored-by: XianBW <[email protected]> Co-authored-by: Haoran Pan <[email protected]> Co-authored-by: Way2Learn <[email protected]> Co-authored-by: WinstonLiyt <[email protected]> Co-authored-by: TPLin22 <[email protected]>
- Loading branch information
1 parent
8f8afea
commit 75eea22
Showing
55 changed files
with
1,162 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
rdagent/scenarios/kaggle/experiment/digit-recognizer_template/model/select_lightgbm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
12 changes: 12 additions & 0 deletions
12
rdagent/scenarios/kaggle/experiment/digit-recognizer_template/model/select_randomforest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 0 additions & 78 deletions
78
rdagent/scenarios/kaggle/experiment/forest-cover-type-prediction_template/model/model_nn.py
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...cenarios/kaggle/experiment/forest-cover-type-prediction_template/model/select_lightgbm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...aggle/experiment/optiver-realized-volatility-prediction_template/model/select_lightgbm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
12 changes: 12 additions & 0 deletions
12
...rios/kaggle/experiment/optiver-realized-volatility-prediction_template/model/select_nn.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
12 changes: 12 additions & 0 deletions
12
...ent/scenarios/kaggle/experiment/playground-series-s3e11_template/model/select_lightgbm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
12 changes: 12 additions & 0 deletions
12
rdagent/scenarios/kaggle/experiment/playground-series-s3e11_template/model/select_nn.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pandas as pd | ||
|
||
|
||
def select(X: pd.DataFrame) -> pd.DataFrame: | ||
""" | ||
Select relevant features. To be used in fit & predict function. | ||
""" | ||
# For now, we assume all features are relevant. This can be expanded to feature selection logic. | ||
if X.columns.nlevels == 1: | ||
return X | ||
X.columns = ["_".join(str(i) for i in col).strip() for col in X.columns.values] | ||
return X |
38 changes: 38 additions & 0 deletions
38
rdagent/scenarios/kaggle/experiment/playground-series-s3e14_template/fea_share_preprocess.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
|
||
import numpy as np # linear algebra | ||
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) | ||
from sklearn.model_selection import train_test_split | ||
|
||
|
||
def preprocess_script(): | ||
""" | ||
This method applies the preprocessing steps to the training, validation, and test datasets. | ||
""" | ||
if os.path.exists("/kaggle/input/X_train.pkl"): | ||
X_train = pd.read_pickle("/kaggle/input/X_train.pkl") | ||
X_valid = pd.read_pickle("/kaggle/input/X_valid.pkl") | ||
y_train = pd.read_pickle("/kaggle/input/y_train.pkl") | ||
y_valid = pd.read_pickle("/kaggle/input/y_valid.pkl") | ||
X_test = pd.read_pickle("/kaggle/input/X_test.pkl") | ||
others = pd.read_pickle("/kaggle/input/others.pkl") | ||
y_train = pd.Series(y_train).reset_index(drop=True) | ||
y_valid = pd.Series(y_valid).reset_index(drop=True) | ||
|
||
return X_train, X_valid, y_train, y_valid, X_test, *others | ||
|
||
# train | ||
train = pd.read_csv("/kaggle/input/train.csv") | ||
X_train, X_valid, y_train, y_valid = train_test_split( | ||
train.drop(["yield", "id"], axis=1), train["yield"], test_size=0.2, random_state=2023 | ||
) | ||
y_train = pd.Series(y_train).reset_index(drop=True) | ||
y_valid = pd.Series(y_valid).reset_index(drop=True) | ||
|
||
# test | ||
test = pd.read_csv("/kaggle/input/test.csv") | ||
|
||
ids = test["id"] | ||
X_test = test.drop(["id"], axis=1) | ||
|
||
return X_train, X_valid, y_train, y_valid, X_test, ids |
Oops, something went wrong.