Skip to content

Commit bbe06b9

Browse files
authored
feat: show workspace in demo (microsoft#348)
* change id name in s4e8 tpl * add workspace in demo * add workspace in demo * fix CI * change workspace path color
1 parent 9e14cef commit bbe06b9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

rdagent/log/ui/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@ def feedback_window():
536536
if isinstance(state.scenario, KGScenario):
537537
if fbe := state.msgs[round]["ef.runner result"]:
538538
submission_path = fbe[0].content.experiment_workspace.workspace_path / "submission.csv"
539+
st.markdown(
540+
f":green[**Exp Workspace**]: {str(fbe[0].content.experiment_workspace.workspace_path.absolute())}"
541+
)
539542
st.download_button(
540543
label="**Download** submission.csv",
541544
data=submission_path.read_bytes(),

rdagent/scenarios/kaggle/experiment/playground-series-s4e8_template/fea_share_preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def preprocess_script():
9292

9393
# Load and preprocess the test data
9494
submission_df = pd.read_csv("/kaggle/input/test.csv")
95-
passenger_ids = submission_df["id"]
95+
ids = submission_df["id"]
9696
submission_df = submission_df.drop(["id"], axis=1)
9797
X_test = preprocess_transform(submission_df, preprocessor, numerical_cols, categorical_cols)
9898

99-
return X_train, X_valid, y_train, y_valid, X_test, passenger_ids
99+
return X_train, X_valid, y_train, y_valid, X_test, ids

rdagent/scenarios/kaggle/experiment/playground-series-s4e8_template/train.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def import_module_from_path(module_name, module_path):
3030

3131

3232
# 1) Preprocess the data
33-
# TODO 如果已经做过数据预处理了,不需要再做了
34-
X_train, X_valid, y_train, y_valid, X_test, passenger_ids = preprocess_script()
33+
X_train, X_valid, y_train, y_valid, X_test, ids = preprocess_script()
3534

3635
# 2) Auto feature engineering
3736
X_train_l, X_valid_l = [], []
@@ -106,7 +105,7 @@ def flatten_columns(df: pd.DataFrame) -> pd.DataFrame:
106105
y_valid_pred = (y_valid_pred > 0.5).astype(int)
107106

108107
mcc = compute_metrics_for_classification(y_valid, y_valid_pred)
109-
print("Final on validation set: ", mcc)
108+
print("MCC on validation set: ", mcc)
110109

111110
# 6) Save the validation accuracy
112111
pd.Series(data=[mcc], index=["MCC"]).to_csv("submission_score.csv")
@@ -122,5 +121,5 @@ def flatten_columns(df: pd.DataFrame) -> pd.DataFrame:
122121
y_test_pred_labels = np.where(y_test_pred == 1, "p", "e") # 将整数转换回 'e' 或 'p'
123122

124123
# 8) Submit predictions for the test set
125-
submission_result = pd.DataFrame({"id": passenger_ids, "class": y_test_pred_labels.ravel()})
124+
submission_result = pd.DataFrame({"id": ids, "class": y_test_pred_labels.ravel()})
126125
submission_result.to_csv("submission.csv", index=False)

0 commit comments

Comments
 (0)