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

feat: Feature selection better #340

Open
wants to merge 20 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
Updated for putting code
  • Loading branch information
xisen-w committed Sep 26, 2024
commit 5f435568d63ccbc1e5337f6774395c7b0e4f583d
31 changes: 17 additions & 14 deletions rdagent/components/coder/model_coder/CoSTEER/evolving_strategy.py
Original file line number Diff line number Diff line change
@@ -33,28 +33,31 @@ def implement_one_model(
self,
target_task: ModelTask,
queried_knowledge: ModelQueriedKnowledge = None,
based_exp: Sequence[ASpecificWSForExperiment] = [],
based_experiments: Sequence[ASpecificWSForExperiment] = [],
) -> str:
model_information_str = target_task.get_task_information()
model_type = target_task.model_type

current_code = ""
data_desc = None

model_file_mapping = {
"XGBoost": "model_xgb.py",
"RandomForest": "model_rf.py",
"LightGBM": "model_lgb.py",
"NN": "model_nn.py",
}

for exp in based_exp:
if model_type in model_file_mapping:
current_code = exp.experiment_workspace.code_dict.get(model_file_mapping[model_type], "")
data_desc = exp.experiment_workspace.data_description
# model_file_mapping = {
# "XGBoost": "model_xgb.py",
# "RandomForest": "model_rf.py",
# "LightGBM": "model_lgb.py",
# "NN": "model_nn.py",
# }

# for exp in based_exp:
# if model_type in model_file_mapping:
# current_code = exp.experiment_workspace.code_dict.get(model_file_mapping[model_type], "")
# data_desc = exp.experiment_workspace.data_description

if current_code:
break # Use the first non-empty code found
# if current_code:
# break # Use the first non-empty code found

if len(based_experiments) > 0:
current_code = based_experiments[-1].experiment_workspace.code_dict

if queried_knowledge is not None and model_information_str in queried_knowledge.success_task_to_knowledge_dict:
return queried_knowledge.success_task_to_knowledge_dict[model_information_str].implementation