Introduction
Hyperparameter Optimization (HPO) and Automated Machine Learning (AutoML) tools have revolutionized model development, yet they suffer from a significant "cold start" problem. These tools require strictly defined search spaces—schemas—to identify tunable parameters, their types, and valid ranges. Historically, these schemas have been manually maintained, a process that is both error-prone and difficult to scale as libraries like scikit-learn expand to include hundreds of operators.
This paper presents an automated solution that treats Python source files as the "single source of truth." By converting human-readable docstrings into machine-readable JSON Schemas, the authors bridge the gap between developer documentation and the requirements of automated tuning frameworks.
Methodology: A Two-Stage Extraction Pipeline
The proposed system utilizes a hybrid approach combining static and dynamic analysis to ensure both high coverage and accuracy.
1. CNL Parser (Static Analysis)
Recognizing that major machine learning libraries follow strict documentation conventions (such as numpydoc or Sphinx), the authors treat these docstrings as a Controlled Natural Language (CNL). They developed specialized grammars to parse the "Parameters" section of docstrings, extracting initial names, types, and default values.
2. Schema Refiner (Dynamic Analysis)
Because documentation can be outdated or ambiguous, the system employs dynamic analysis to refine the initial schema:
- Default Value Detection: The tool instantiates classes at runtime to identify the actual algorithmic defaults, bypassing placeholder strings like
'warn'often found in scikit-learn. - Runtime Exception Testing: By deliberately passing invalid values to an operator, the tool triggers descriptive error messages. These messages often explicitly list valid options, which are then parsed to populate the schema.
- Greedy Harvesting: The system samples various value ranges to observe crashes, effectively "learning" the boundaries of the hyperparameter space through trial and error.
Datasets and Evaluation
The approach was evaluated using two primary datasets:
- Complete Dataset: 119 operators from scikit-learn, XGBoost, and LightGBM to test broad applicability.
- Curated Dataset: 42 operators with manually verified "ground truth" schemas used to calculate precision and recall.
To test real-world utility, the authors integrated the generated schemas into the Lale AutoML library and compared its performance against auto-sklearn across 15 OpenML datasets.
Key Results
The automated tool demonstrated high effectiveness in capturing the nuances of hyperparameter definitions. It successfully mined 94% of argument types across the complete dataset of 119 operators.
As shown in the performance metrics for the curated dataset, the system achieved near-perfect precision and recall for arguments and defaults. Specifically, it correctly identified the default value for 97% of parameters and the type for 81%. In end-to-end AutoML benchmarks, the Lale system using these automated schemas achieved an average accuracy of 88.1%, statistically comparable to the 88.0% achieved by the manually-tuned auto-sklearn.
Discussion and Limitations
While the tool excels at individual parameter extraction, it faces challenges with complex inter-argument constraints (e.g., dependencies where one parameter's valid range depends on the value of another). Only 36% of such constraints were correctly captured. Additionally, the rule-based CNL grammar can occasionally be tripped up by linguistic variability or typos in docstrings.
Future work aims to incorporate more advanced Natural Language Understanding (NLU) techniques to better interpret unconstrained text and complex logical dependencies, further reducing the manual effort required to support evolving ML ecosystems.
Summary updated