move to ext/sela

This commit is contained in:
Cyzus Chi 2024-10-25 22:18:43 +08:00
parent 7c5b29de63
commit eb3d49dfdd
32 changed files with 56 additions and 56 deletions

4
.gitignore vendored
View file

@ -29,7 +29,7 @@ share/python-wheels/
MANIFEST
metagpt/tools/schemas/
examples/data/search_kb/*.json
sela/AutogluonModels
metagpt/ext/sela/AutogluonModels
# PyInstaller
# Usually these files are written by a python scripts from a template
@ -189,4 +189,4 @@ cov.xml
*-structure.json
*.dot
.python-version
sela/results/*
metagpt/ext/sela/results/*

View file

@ -1,6 +1,6 @@
import random
from sela.MCTS import MCTS
from metagpt.ext.sela.MCTS import MCTS
class Greedy(MCTS):

View file

@ -8,12 +8,12 @@ import shutil
import numpy as np
import pandas as pd
from sela.data.custom_task import get_mle_bench_requirements, get_mle_task_id
from sela.data.dataset import generate_task_requirement, get_split_dataset_path
from sela.evaluation.evaluation import evaluate_score
from sela.insights.instruction_generator import InstructionGenerator
from sela.research_assistant import ResearchAssistant, TimeoutException
from sela.utils import get_exp_pool_path, load_execute_notebook, mcts_logger
from metagpt.ext.sela.data.custom_task import get_mle_bench_requirements, get_mle_task_id
from metagpt.ext.sela.data.dataset import generate_task_requirement, get_split_dataset_path
from metagpt.ext.sela.evaluation.evaluation import evaluate_score
from metagpt.ext.sela.insights.instruction_generator import InstructionGenerator
from metagpt.ext.sela.research_assistant import ResearchAssistant, TimeoutException
from metagpt.ext.sela.utils import get_exp_pool_path, load_execute_notebook, mcts_logger
from metagpt.tools.tool_recommend import ToolRecommender
from metagpt.utils.common import read_json_file

View file

@ -0,0 +1,3 @@
datasets_dir: "path/to/datasets" # path to the datasets directory
work_dir: ../workspace # path to the workspace directory
role_dir: storage/SELA # path to the role directory

View file

@ -1,7 +1,7 @@
import os
from sela.data.dataset import SPECIAL_INSTRUCTIONS
from sela.experimenter.mle_bench.instructions import (
from metagpt.ext.sela.data.dataset import SPECIAL_INSTRUCTIONS
from metagpt.ext.sela.experimenter.mle_bench.instructions import (
ADDITIONAL_NOTES,
INSTRUCTIONS,
INSTRUCTIONS_OBFUSCATED,

View file

@ -9,8 +9,8 @@ import pandas as pd
import yaml
from sklearn.model_selection import train_test_split
from sela.insights.solution_designer import SolutionDesigner
from sela.utils import DATA_CONFIG
from metagpt.ext.sela.insights.solution_designer import SolutionDesigner
from metagpt.ext.sela.utils import DATA_CONFIG
BASE_USER_REQUIREMENT = """
This is a {datasetname} dataset. Your goal is to predict the target column `{target_col}`.

View file

@ -7,14 +7,14 @@ import pandas as pd
from datasets import load_dataset
from PIL import Image
from sela.data.dataset import (
from metagpt.ext.sela.data.dataset import (
ExpDataset,
parse_args,
process_dataset,
save_datasets_dict_to_yaml,
)
from sela.insights.solution_designer import SolutionDesigner
from sela.utils import DATA_CONFIG
from metagpt.ext.sela.insights.solution_designer import SolutionDesigner
from metagpt.ext.sela.utils import DATA_CONFIG
HFDATSETS = [
{"name": "sms_spam", "dataset_name": "ucirvine/sms_spam", "target_col": "label", "modality": "text"},

View file

@ -3,7 +3,7 @@ import textwrap
import matplotlib.pyplot as plt
import networkx as nx
from sela.MCTS import Node
from metagpt.ext.sela.MCTS import Node
NODE_TEMPLATE = """\
[Node {id}]

View file

@ -1,7 +1,7 @@
from sela.experimenter.experimenter import Experimenter
from sela.insights.instruction_generator import InstructionGenerator
from sela.research_assistant import ResearchAssistant
from sela.utils import get_exp_pool_path
from metagpt.ext.sela.experimenter.experimenter import Experimenter
from metagpt.ext.sela.insights.instruction_generator import InstructionGenerator
from metagpt.ext.sela.research_assistant import ResearchAssistant
from metagpt.ext.sela.utils import get_exp_pool_path
EXPS_PROMPT = """
When doing the tasks, you can refer to the insights below:

View file

@ -1,5 +1,5 @@
from datetime import datetime
from sela.experimenter.custom import CustomExperimenter
from metagpt.ext.sela.experimenter.custom import CustomExperimenter
import os
import pandas as pd

View file

@ -1,7 +1,7 @@
from datetime import datetime
import pandas as pd
from sela.experimenter.custom import CustomExperimenter
from sela.evaluation.evaluation import evaluate_score
from metagpt.ext.sela.experimenter.custom import CustomExperimenter
from metagpt.ext.sela.evaluation.evaluation import evaluate_score
from functools import partial

View file

@ -2,9 +2,9 @@ import os
import pandas as pd
from sela.evaluation.evaluation import evaluate_score
from sela.experimenter.experimenter import Experimenter
from sela.MCTS import create_initial_state
from metagpt.ext.sela.evaluation.evaluation import evaluate_score
from metagpt.ext.sela.experimenter.experimenter import Experimenter
from metagpt.ext.sela.MCTS import create_initial_state
class CustomExperimenter(Experimenter):

View file

@ -5,10 +5,10 @@ import os
import numpy as np
import pandas as pd
from sela.evaluation.evaluation import evaluate_score
from sela.MCTS import create_initial_state
from sela.research_assistant import ResearchAssistant
from sela.utils import DATA_CONFIG, save_notebook
from metagpt.ext.sela.evaluation.evaluation import evaluate_score
from metagpt.ext.sela.MCTS import create_initial_state
from metagpt.ext.sela.research_assistant import ResearchAssistant
from metagpt.ext.sela.utils import DATA_CONFIG, save_notebook
class Experimenter:

View file

@ -1,13 +1,13 @@
import shutil
from sela.evaluation.evaluation import (
from metagpt.ext.sela.evaluation.evaluation import (
node_evaluate_score_mlebench,
node_evaluate_score_sela,
)
from sela.evaluation.visualize_mcts import get_tree_text
from sela.experimenter.experimenter import Experimenter
from sela.Greedy import Greedy, Random
from sela.MCTS import MCTS
from metagpt.ext.sela.evaluation.visualize_mcts import get_tree_text
from metagpt.ext.sela.experimenter.experimenter import Experimenter
from metagpt.ext.sela.Greedy import Greedy, Random
from metagpt.ext.sela.MCTS import MCTS
class MCTSExperimenter(Experimenter):

View file

@ -8,7 +8,7 @@ You will be given a machine learning task. You must solve the task by training a
BENCHMARK INSTRUCTIONS
------
First, please read the instructions below which are specific to our benchmark setup. Note, these instructions can be found again in `sela.experimenter.mle_bench.instructions.py`.
First, please read the instructions below which are specific to our benchmark setup. Note, these instructions can be found again in `experimenter/mle_bench/instructions.py`.
- **Competition-specific instructions**: The instructions for the competition are available in `{dataset_dir}/description.md`. Read this file to understand the problem setup for the competition you are currently solving.
- **Dataset**: The dataset files for the competition are available in `{dataset_dir}`.
@ -28,7 +28,7 @@ You will be given a machine learning task. You must solve the task by training a
BENCHMARK INSTRUCTIONS
------
First, please read the instructions below which are specific to our benchmark setup. Note, these instructions can be found again in `sela.experimenter.mle_bench.instructions.py`.
First, please read the instructions below which are specific to our benchmark setup. Note, these instructions can be found again in `experimenter/mle_bench/instructions.py`.
- **Task-specific instructions**: The instructions for the task are available in `{dataset_dir}/description.md`. Read this file to understand the problem setup for the task you are currently solving.
- **Dataset**: The dataset files for the task are available in `{dataset_dir}/`.

View file

@ -3,8 +3,8 @@ import os
import random
from difflib import SequenceMatcher
from sela.insights.solution_designer import SolutionDesigner
from sela.utils import clean_json_from_rsp, load_data_config, mcts_logger
from metagpt.ext.sela.insights.solution_designer import SolutionDesigner
from metagpt.ext.sela.utils import clean_json_from_rsp, load_data_config, mcts_logger
from metagpt.llm import LLM
from metagpt.schema import Message

View file

@ -1,6 +1,6 @@
import json
from sela.utils import clean_json_from_rsp, load_data_config
from metagpt.ext.sela.utils import clean_json_from_rsp, load_data_config
from metagpt.llm import LLM
DATA_CONFIG = load_data_config()

View file

@ -6,7 +6,7 @@ import os
from pydantic import model_validator
from sela.utils import mcts_logger, save_notebook
from metagpt.ext.sela.utils import mcts_logger, save_notebook
from metagpt.actions.di.write_analysis_code import WriteAnalysisCode
from metagpt.const import SERDESER_PATH
from metagpt.roles.di.data_interpreter import DataInterpreter

View file

@ -1,13 +1,13 @@
import argparse
import asyncio
from sela.data.custom_task import get_mle_is_lower_better, get_mle_task_id
from sela.experimenter.aug import AugExperimenter
from sela.experimenter.autogluon import GluonExperimenter
from sela.experimenter.autosklearn import AutoSklearnExperimenter
from sela.experimenter.custom import CustomExperimenter
from sela.experimenter.experimenter import Experimenter
from sela.experimenter.mcts import MCTSExperimenter
from metagpt.ext.sela.data.custom_task import get_mle_is_lower_better, get_mle_task_id
from metagpt.ext.sela.experimenter.aug import AugExperimenter
from metagpt.ext.sela.experimenter.autogluon import GluonExperimenter
from metagpt.ext.sela.experimenter.autosklearn import AutoSklearnExperimenter
from metagpt.ext.sela.experimenter.custom import CustomExperimenter
from metagpt.ext.sela.experimenter.experimenter import Experimenter
from metagpt.ext.sela.experimenter.mcts import MCTSExperimenter
def get_args(cmd=True):

View file

@ -1,9 +1,9 @@
import networkx as nx
from sela.evaluation.visualize_mcts import build_tree_recursive, visualize_tree
from sela.MCTS import MCTS, create_initial_state, initialize_di_root_node
from sela.run_experiment import get_args
from sela.utils import DATA_CONFIG
from metagpt.ext.sela.evaluation.visualize_mcts import build_tree_recursive, visualize_tree
from metagpt.ext.sela.MCTS import MCTS, create_initial_state, initialize_di_root_node
from metagpt.ext.sela.run_experiment import get_args
from metagpt.ext.sela.utils import DATA_CONFIG
if __name__ == "__main__":
args = get_args()

View file

@ -1,3 +0,0 @@
datasets_dir: "D:/work/automl/datasets" # path to the datasets directory
work_dir: ../workspace # path to the workspace directory
role_dir: storage/SELA # path to the role directory