Zero-Code Research: Using AI Agents to Run Complete Machine Learning Experiments

Run complete ML experiments with zero code using AI agents like Codex and Claude Code.
AI coding agents like Codex and Claude Code can now execute full machine learning research workflows — data exploration, model training, evaluation, and visualization — from a single natural-language instruction. This article walks through a real demonstration using a heart disease dataset, explaining key concepts like AUC, data leakage, cross-validation, and SHAP, along with a step-by-step setup guide.
When Research Meets AI Agents: Building Models Without Writing Code
For many researchers outside computer science, code has long been a wall standing between raw data and meaningful results. As AI coding agents like Codex and Claude Code continue to mature, that wall is rapidly coming down. According to a hands-on demonstration by Bilibili creator "潜域," a single natural-language instruction is now enough for AI to automatically complete an entire research workflow — from data analysis and model training to results visualization.
It's worth noting that Codex and Claude Code don't simply represent "intelligent code completion." They embody a fundamentally new paradigm known as Code Execution Agents. These agents operate with a full perceive–plan–execute–feedback loop: they can read data from the file system, autonomously devise an experimental plan, break that plan into executable code steps, run the code in a local or sandboxed environment, and dynamically adjust their strategy based on the output. This is categorically different from earlier large language models that could only generate static code snippets — agents don't just "suggest what to do," they actually do it, self-correcting when errors arise until the task is complete. This closed-loop autonomy is precisely what enables them to support complete research workflows.
This isn't simple code completion — it's a genuine disruption of the research workflow. Machine learning experiments that once took days or months can now be compressed into minutes. This article dives deep into the practical capabilities of AI agents in research settings, grounded in this real-world demonstration.
Case Study: From a CSV File to a Complete Experiment
The demonstration used a heart disease dataset containing 303 samples — 13 features and one binary classification label (disease or no disease). The author entered just one instruction: "Help me analyze the data in the current folder and see what research tasks can be done." The AI then began working systematically.
Step 1: Automated Data Exploration
The AI first performed a full data audit: identifying variable types, computing class distributions, and detecting missing values. Based on the 303-sample size, it offered a pragmatic assessment — this scale is "insufficient for publishing in top-tier journals, but suitable for building an interpretable clinical prediction model." This kind of proactive judgment about research feasibility is precisely what beginners tend to overlook.
The AI then proposed a complete experimental design: binary classification for heart disease detection, cross-validation, and supplementary external validation or an internal holdout test set. This was no longer passive execution — it was active planning grounded in research methodology.

Step 2: A Rigorous Experimental Workflow
The rigor of the experimental design is equally noteworthy. The AI followed a standard research protocol: 20% of the data was held out as an internal test set, 5-fold cross-validation was applied within the training set to prevent data leakage, duplicate records were removed, and multiple algorithms were benchmarked side by side (Random Forest, SVM, Logistic Regression, Gradient Boosting, etc.).
It's worth explaining why data leakage and 5-fold cross-validation matter — these two design choices are critical to the credibility of any experimental conclusion. Data leakage occurs when information from the test set indirectly "leaks" into the training phase, causing evaluation metrics to appear artificially inflated while actual real-world performance falls far short. It is one of the most common yet most hidden methodological flaws in machine learning research — and particularly dangerous in medical prediction, where it has led to the retraction of multiple published findings. The correct approach is to completely seal off the test set from the beginning, never allowing it to influence any training or tuning decisions. 5-fold cross-validation addresses a different concern: within the training data, the dataset is randomly split into 5 equal parts, with the model trained on 4 parts and validated on the 5th, rotating through all 5 combinations and averaging the results. This yields a more robust estimate of generalization performance on limited data, while guiding hyperparameter selection without contaminating the final test set. The fact that the AI automatically applied both of these standards demonstrates that its embedded experimental design logic has reached a professional level.
Throughout the process, code was written and executed automatically by the AI, with models trained in the background. Logistic Regression ultimately achieved the best performance with an AUC of 0.89 — a solid result for this sample size.
Results Output: More Than Numbers — Complete Visualizations
After the experiment, the AI generated a complete results directory in the folder that originally contained only the dataset. Opening it in VSCode revealed a comprehensive set of outputs.

The deliverables included: label distribution charts (showing a relatively balanced 0/1 split), ROC curves comparing multiple models, confusion matrices, average predicted probabilities per model, feature importance rankings, and saved model weight files. Also included were complete experiment logs, metric records (AUC, sensitivity, specificity), and a summary comparison table.
AUC (Area Under the ROC Curve) is the most comprehensive evaluation metric for binary classification models, ranging from 0.5 to 1.0: 0.5 indicates performance equivalent to random guessing, while 1.0 represents perfect prediction. AUC's key advantage is that it is unaffected by class imbalance and holistically measures a model's discriminative ability across all possible classification thresholds. In clinical prediction, AUC of 0.7–0.8 is generally considered acceptable, 0.8–0.9 is good, and above 0.9 is excellent. Logistic Regression achieving AUC 0.89 on a 303-sample dataset represents a solid baseline, indicating strong ability to distinguish between "disease" and "healthy" populations. Combined with the output sensitivity (true positive rate) and specificity (true negative rate), researchers can select an appropriate decision threshold based on their specific clinical context — whether minimizing missed diagnoses or minimizing false alarms is the higher priority.

This output package covers nearly all the material needed for the experimental section of a machine learning methods paper. If further depth is required, a single additional instruction — such as "add an XGBoost model" or "include SHAP interpretability analysis" — is all it takes for the AI to seamlessly extend the existing work without any manual code changes.
SHAP (SHapley Additive exPlanations) deserves a separate note here. Rooted in the Shapley value concept from game theory, SHAP quantifies how much each input feature contributes to a single prediction, and in which direction — in other words, it answers: "For this particular patient, why did the model predict disease? Which feature mattered most?" In medical AI, model interpretability is no longer merely an academic bonus — it is a regulatory requirement and a foundation for clinical trust. Physicians need to understand the reasoning behind an AI prediction before deciding whether to act on it. SHAP has become the de facto standard for interpretability analysis in medical prediction models thanks to its theoretical rigor and intuitive outputs (including beeswarm plots, waterfall charts, and other visualizations). Many top-tier journals now list SHAP analysis as a recommended reporting standard for machine learning research.
From Tabular Data to Images and Text: The Scope of AI Agent Capabilities
This demonstration used structured tabular data, but the author notes that AI agents are equally capable of handling more complex scenarios involving image data, text data, and other modalities — completing analysis, modeling, and outputting results and visualizations.
The underlying logic is straightforward: scientific experimentation is essentially a structured workflow — data processing, model selection, training and validation, result evaluation. When AI both understands this methodology and has the ability to autonomously write and execute code, the role of the human researcher shifts from "code implementer" to "problem definer." You simply articulate what you want to accomplish; the agent handles the rest.
That said, this doesn't mean the barriers to research have entirely disappeared. Scientific judgment of experimental results, the ability to identify valuable research questions, and deep domain expertise remain areas where AI cannot substitute for human insight. What AI lowers is the engineering implementation barrier — not the scientific thinking barrier.
Getting Started: Installation Guide for Codex and Claude Code
To replicate this workflow, you'll need to set up a basic environment. The author provides a detailed installation path.

Three Steps to Get Started
Step 1: Install Node.js. Both Codex and Claude Code depend on the Node.js runtime environment. Node.js is a JavaScript runtime built on Chrome's V8 engine, allowing developers to run JavaScript outside of the browser — on a server or locally. The command-line clients (CLIs) for Codex and Claude Code are themselves written in JavaScript/TypeScript, so Node.js is required as the host environment. This is a separate layer from the Python environment used for scientific scripts: Node.js handles "launching and managing the agent," while Python handles "executing the data analysis code the agent generates." The two don't need to be conflated. Download the appropriate installer, follow the setup wizard, and verify success by running a confirmation command in the terminal.
Step 2: Install the agent tool. Install Codex or Claude Code via the command line in your terminal. You can verify the installation status the same way. The steps differ slightly between Windows and Mac, but the overall process is essentially the same.
Step 3: Configure model access. For the login step, you can use the official API or connect through a relay service. The author mentions using Sense Switch to connect to a range of models including the GPT-5 series, offering considerable flexibility.
Once set up, simply run the agent and enter your request in the dialog box to get started. The generated code can be opened and further edited in either VSCode or PyCharm — your choice.
Conclusion: A Paradigm Shift in Research Productivity
The most striking aspect of this demonstration is that it was entirely code-free. From data analysis to final results, the author never wrote a single line of code — a complete, methodologically sound machine learning experiment was conducted through natural language alone.
For researchers without a programming background — in medicine, biology, social sciences, and beyond — this means data-driven research methods are, for the first time, genuinely within reach. AI agents are stripping "can you write code" out of the list of prerequisites for doing research.
The competitive edge in future research may depend less on whether you can type correct code, and more on whether you can ask good questions, design sound experiments, and interpret results with rigor. That is both an opportunity and a transformation that every researcher would do well to take seriously.
Key Takeaways
Related articles

Greek Fire: The Ultimate Military Secret Guarded by the Byzantine Empire for a Millennium
Greek Fire was the Byzantine Empire's most closely guarded state secret — an ancient flamethrower that burned on water. Learn how it helped repel Arabs and Vikings and ensured the empire's survival.

7 Vibe Coding Agents Tested & Ranked: Which AI Coding Tool Should Beginners Choose?
Hands-on comparison of 7 Vibe Coding agents including Trae, Cursor, Claude Code, Codex, WorkBuddy & CoderWork, ranked by beginner-friendliness and performance.

AI-Generated Series 'Nido de Villanas': How AI Tells a Soap Opera Story
Deep analysis of AI-generated telenovela Nido de Villanas Episode 2: examining dialogue design, narrative tension, and AI's potential in dramatic storytelling.