Skip to content

Commit 7af689e

Browse files
committed
fix: fix some bugs in the entire loop (#274)
* fix some bugs in the entire loop * refine the code
1 parent 9d909f7 commit 7af689e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rdagent/scenarios/kaggle/experiment/meta_tpl/fea_share_preprocess.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
77

88

9-
def prepreprocess():
9+
def prepreprocess(debug_mode=False):
1010
"""
1111
This method loads the data, drops the unnecessary columns, and splits it into train and validation sets.
1212
"""
@@ -78,11 +78,11 @@ def preprocess_transform(X: pd.DataFrame, preprocessor):
7878
return X_transformed
7979

8080

81-
def preprocess_script():
81+
def preprocess_script(debug_mode=False):
8282
"""
8383
This method applies the preprocessing steps to the training, validation, and test datasets.
8484
"""
85-
X_train, X_valid, y_train, y_valid = prepreprocess()
85+
X_train, X_valid, y_train, y_valid = prepreprocess(debug_mode=debug_mode)
8686

8787
# Fit the preprocessor on the training data
8888
preprocessor = preprocess_fit(X_train)

rdagent/scenarios/kaggle/experiment/workspace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
from fea_share_preprocess import preprocess_script
1515
16-
X_train, X_valid, y_train, y_valid, X_test, passenger_ids = preprocess_script()
16+
X_train, X_valid, y_train, y_valid, X_test, passenger_ids = preprocess_script(debug_mode=True)
1717
1818
pickle.dump(X_train, open("X_train.pkl", "wb"))
1919
pickle.dump(X_valid, open("X_valid.pkl", "wb"))

0 commit comments

Comments
 (0)