An autonomous agent loop for feature subset selection. Inspired by work done at INADS, Inc., where a similar RL + evolutionary approach was used to automate dataset and feature selection for downstream fine-tuning regression tasks on fMRI biomarker data — removing human trial-and-error from the ML pipeline.
This implements the auto-research loop: a self-improving agent that iterates against a metric, keeps what works, discards what doesn't, and converges without human intervention.
seed population → evaluate (parallel) → rank → keep survivors → mutate → repeat
Each round, agents evaluate candidate feature subsets concurrently using a thread pool. The loop selects survivors, breeds a new generation through mutation, and stops when improvement drops below a threshold or the round limit is reached.
from agent import run, Config
result = run(
features=["age", "bmi", "glucose", "insulin", "bp"],
evaluate=your_scoring_function, # frozenset[str] → float
config=Config(population_size=8, max_rounds=10),
)
print(result.best_features) # optimal subset found
print(result.best_score)
print(result.history) # per-round traceThe evaluate function is the only thing you supply — the agent handles everything else.
python agent.pyRuns against a synthetic regression problem with a known optimal feature subset. Typically converges in 5–8 rounds.
Feature/dataset selection is one of the highest-leverage places to remove humans from the ML loop. Automating it as an agent — rather than a grid search script — means it can be composed into larger pipelines, handed context from upstream agents, and report results to downstream consumers without synchronous human review.