mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-01 17:37:43 +00:00
82bef3a375
* init a scenario for kaggle feature engineering * fix some bugs and add original features' description * refine the process of data downloading * fix a error * revert the code * fix a bug in feedback * fix a ci bug * fix a ci bug
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
from pathlib import Path
|
|
|
|
import pandas as pd
|
|
|
|
from rdagent.app.data_mining.conf import MED_PROP_SETTING
|
|
from rdagent.core.experiment import FBWorkspace
|
|
from rdagent.log import rdagent_logger as logger
|
|
from rdagent.utils.env import DMDockerEnv
|
|
|
|
|
|
class DMFBWorkspace(FBWorkspace):
|
|
def __init__(self, template_folder_path: Path, *args, **kwargs) -> None:
|
|
super().__init__(*args, **kwargs)
|
|
self.inject_code_from_folder(template_folder_path)
|
|
|
|
def execute(self, run_env: dict = {}, *args, **kwargs) -> str:
|
|
qtde = DMDockerEnv()
|
|
qtde.prepare(MED_PROP_SETTING.username, MED_PROP_SETTING.password)
|
|
|
|
execute_log = qtde.run(
|
|
local_path=str(self.workspace_path),
|
|
entry=f"python train.py",
|
|
env=run_env,
|
|
)
|
|
|
|
csv_path = self.workspace_path / "submission.csv"
|
|
|
|
if not csv_path.exists():
|
|
logger.error(f"File {csv_path} does not exist.")
|
|
return None
|
|
return pd.read_csv(csv_path, index_col=0).iloc[:, 0]
|