Skip to content

Commit e126471

Browse files
authored
feat: Supporting Model Specifications (#319)
* Key changes * Revised to support submission specifications * Revised to support submission specifications * revise CI * CI-Fix * fixing-CI
1 parent 87c23f4 commit e126471

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

rdagent/scenarios/kaggle/experiment/prompts.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ kg_description_template:
88
"Competition Type": "The type of competition, e.g., 'Classification', 'Regression', 'Clustering', 'Prediction", "Time-Series Forecasting",
99
"Competition Description": "A brief description of the competition",
1010
"Target Description": "A description of the target variable to be predicted",
11+
"Competition Features": "Two-line description of the overall features involved within the competition as background."
12+
"Submission Specifications": "The submission specification & sample submission csv descriptions for the model to output."
1113
}
1214
Since these might be very similar column names in data like one_hot_encoded columns, you can use some regex to group them together.
1315
@@ -20,7 +22,7 @@ kg_description_template:
2022
2123
kg_background: |-
2224
You are solving a data science tasks and the type of the competition is {{ competition_type }}.
23-
The competition description is:{{competition_description}}
25+
The competition description is:{{competition_description}}.
2426
2527
We provide an overall script in file: train.py. The user will run the train.py script along with several feature and model scripts to train several model to get a good performance on this task.
2628
@@ -63,6 +65,8 @@ kg_background: |-
6365
6466
For each loop, you need to help user decide which action item to choose and provide the corresponding code to implement the action item.
6567
68+
Most importantly, the output format & submission requirements are listed here: {submission_specifications}
69+
6670
kg_feature_interface: |-
6771
Your code should contain several parts:
6872
1. The import part: import the necessary libraries.

rdagent/scenarios/kaggle/experiment/scenario.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self, competition: str) -> None:
3434
self.competition_description = None
3535
self.target_description = None
3636
self.competition_features = None
37+
self.submission_specifications = None
3738
self._analysis_competition_description()
3839
self.if_action_choosing_based_on_UCB = KAGGLE_IMPLEMENT_SETTING.if_action_choosing_based_on_UCB
3940

@@ -66,13 +67,16 @@ def _analysis_competition_description(self):
6667
self.competition_description = response_json_analysis.get("Competition Description", "No description provided")
6768
self.target_description = response_json_analysis.get("Target Description", "No target provided")
6869
self.competition_features = response_json_analysis.get("Competition Features", "No features provided")
70+
self.submission_specifications = response_json_analysis.get(
71+
"Submission Specifications", "No submission requirements provided"
72+
)
6973

7074
def get_competition_full_desc(self) -> str:
7175
return f"""Competition Type: {self.competition_type}
72-
Competition Description: {self.competition_description}
73-
Target Description: {self.target_description}
74-
Competition Features: {self.competition_features}
75-
"""
76+
Competition Description: {self.competition_description}
77+
Target Description: {self.target_description}
78+
Competition Features: {self.competition_features}
79+
"""
7680

7781
@property
7882
def background(self) -> str:
@@ -91,6 +95,7 @@ def background(self) -> str:
9195
competition_description=self.competition_description,
9296
target_description=self.target_description,
9397
competition_features=self.competition_features,
98+
submission_specifications=self.submission_specifications,
9499
)
95100
)
96101
return background_prompt
@@ -165,4 +170,6 @@ def get_scenario_all_desc(self) -> str:
165170
{self._output_format}
166171
The simulator user can use to test your model:
167172
{self._simulator}
173+
The expected output & submission format specifications:
174+
{self.submission_specifications} # Added again to emphasize the importance
168175
"""

0 commit comments

Comments
 (0)