Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix a bug in KGFBWorkspace (about data loading) #495

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix a bug in source_data
  • Loading branch information
WinstonLiyt committed Nov 25, 2024
commit 01162b9019fb0701ae32686eb048a6d4b6ed8a90
15 changes: 15 additions & 0 deletions rdagent/scenarios/kaggle/experiment/scenario.py
Original file line number Diff line number Diff line change
@@ -148,6 +148,21 @@ def background(self) -> str:
def source_data(self) -> str:
data_folder = Path(KAGGLE_IMPLEMENT_SETTING.local_data_path) / self.competition

if KAGGLE_IMPLEMENT_SETTING.template_path == "rdagent/scenarios/kaggle/tpl_ex":
if not (data_folder / "X.pkl").exists():
preprocess_experiment = KGFactorExperiment([])
X, y, X_test, others = preprocess_experiment.experiment_workspace.generate_preprocess_data()

data_folder.mkdir(exist_ok=True, parents=True)
pickle.dump(X, open(data_folder / "X.pkl", "wb"))
pickle.dump(y, open(data_folder / "y.pkl", "wb"))
pickle.dump(X_test, open(data_folder / "X_test.pkl", "wb"))
pickle.dump(others, open(data_folder / "others.pkl", "wb"))

X = pd.read_pickle(data_folder / "X.pkl")
self.input_shape = X.shape
return str(self.input_shape)

if not (data_folder / "X_valid.pkl").exists():
preprocess_experiment = KGFactorExperiment([])
(