mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fce241b9f9
* Use ExtendedBaseSettings to replace BaseSettings * update a more general way to pass the default setting * update all code * fix CI * fix CI * fix qlib scenario * fix CI * fix CI * fix CI & add data science interfaces * remove redundant code * abandon costeer knowledge base v1 --------- Co-authored-by: Xu Yang <xuyang1@microsoft.com> Co-authored-by: XianBW <36835909+XianBW@users.noreply.github.com>
26 lines
682 B
Python
26 lines
682 B
Python
import random
|
|
|
|
from rdagent.components.coder.CoSTEER.evolvable_subjects import EvolvingItem
|
|
from rdagent.components.coder.CoSTEER.knowledge_management import (
|
|
CoSTEERQueriedKnowledge,
|
|
)
|
|
from rdagent.core.evaluation import Scenario
|
|
from rdagent.log import rdagent_logger as logger
|
|
|
|
|
|
def random_select(
|
|
to_be_finished_task_index: list,
|
|
evo: EvolvingItem,
|
|
selected_num: int,
|
|
queried_knowledge: CoSTEERQueriedKnowledge,
|
|
scen: Scenario,
|
|
):
|
|
|
|
to_be_finished_task_index = random.sample(
|
|
to_be_finished_task_index,
|
|
selected_num,
|
|
)
|
|
|
|
logger.info(f"The random selection is: {to_be_finished_task_index}")
|
|
return to_be_finished_task_index
|