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 the result storing of factor costeer
  • Loading branch information
WinstonLiyt committed Nov 25, 2024
commit de4d413feff26011a3c4c6e15d65bb96b05e94f1
5 changes: 4 additions & 1 deletion rdagent/components/coder/factor_coder/factor.py
Original file line number Diff line number Diff line change
@@ -147,7 +147,10 @@ def execute(self, data_type: str = "Debug") -> Tuple[str, pd.DataFrame]:
execution_code_path = code_path
elif self.target_task.version == 2:
execution_code_path = self.workspace_path / f"{uuid.uuid4()}.py"
execution_code_path.write_text((Path(__file__).parent / "factor_execution_template.txt").read_text())
if KAGGLE_IMPLEMENT_SETTING.template_path == "rdagent/scenarios/kaggle/tpl_ex":
execution_code_path.write_text((Path(__file__).parent / "factor_execution_template_v2.txt").read_text())
else:
execution_code_path.write_text((Path(__file__).parent / "factor_execution_template_v1.txt").read_text())

try:
subprocess.check_output(
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import h5py
import numpy as np
import pandas as pd
from feat01 import feat_eng

if os.path.exists("X.pkl"):
X = pd.read_pickle("X.pkl")
y = pd.read_pickle("y.pkl")
else:
raise FileNotFoundError("No valid data found.")

X, y, p = feat_eng(X, y)

with h5py.File('result.h5', 'w') as hf:
hf.create_dataset('default', data=X)
Loading
Oops, something went wrong.