Type-Driven Automated Learning with Lale

Martin Hirzel, Kiran Kate, Avraham Shinnar, Subhrajit Roy, Parikshit RamarXiv 2019

Abstract

LALE (Language for Automated Learning Exploration) is an open-source library designed to unify the fragmented landscape of Automated Machine Learning (AutoML). By leveraging JSON Schema types to define search spaces, LALE enables a seamless transition between manual pipeline construction and automated optimization. This type-driven approach ensures that search algorithms respect the underlying constraints of machine learning libraries, preventing invalid configurations and facilitating cross-language portability between Python, Java, and R.

Introduction

The field of Automated Machine Learning (AutoML) currently suffers from significant fragmentation. While numerous tools exist for Combined Algorithm Selection and Hyperparameter optimization (CASH)—such as auto-sklearn, TPOT, and hyperopt—they often rely on incompatible syntaxes for defining search spaces. Furthermore, these search spaces are frequently disconnected from the actual constraints of the underlying machine learning libraries. For instance, an automated tool might attempt to pair a solver with an unsupported penalty type, leading to computational waste or runtime errors. LALE addresses these challenges by providing a Domain-Specific Embedded Language (DSEL) that bridges the gap between manual control and "black-box" automation.

Methodology: The LALE Framework

LALE introduces three primary innovations to streamline the machine learning lifecycle:

1. Lifecycle as Bindings

LALE pipelines transition through three explicit states: Planned (structure defined, but choices are free), Trainable (algorithms and hyperparameters selected), and Trained (parameters learned from data). This lifecycle allows data scientists to manually "bind" certain parts of a pipeline while leaving others for automated search.

Transition from a Planned pipeline with multiple algorithmic choices to a specific Trained pipeline using Hyperopt.

As shown in the figure above, a "Planned" pipeline can define a wide search space using the choice operator (|). In this example, the system considers both BERT and TFIDF for feature extraction, followed by a suite of potential classifiers. The HyperoptClassifier then explores this space to produce a specific "Trained" pipeline.

2. Types as Search Spaces

Instead of inventing a new syntax for search spaces, LALE utilizes JSON Schema to describe hyperparameters. These schemas serve a dual purpose: they validate that a configuration is correct and act as a "single source of truth" that can be automatically translated into tool-specific search spaces for backends like Hyperopt or SMAC. This "Don't Repeat Yourself" (DRY) approach ensures that documentation and search spaces are always in sync.

Transition from a manually specified Trainable pipeline to a Trained state.

Alternatively, a user can manually specify a "Trainable" pipeline with fixed hyperparameters, as shown in the figure above, which is then fit to data to become "Trained".

3. Pluggable Middleware

LALE acts as a shim between ML libraries and search tools. It provides intuitive combinators, such as >> for piping and | for algorithmic choice, that maintain a scikit-learn-like feel while supporting components from diverse ecosystems, including Python, Java, and R.

Evaluation and Results

The authors evaluated LALE across four data modalities: text (Movie Reviews), structured (Car evaluation), image (CIFAR-10), and time-series (Epilepsy).

  • Efficiency Gains: Ablation studies demonstrated that LALE’s type-driven constraints significantly speed up convergence. By encoding "side constraints" (e.g., "if solver is X, then penalty must be Y"), LALE prevents search tools from exploring invalid points that would otherwise cause crashes.
  • Cross-Language Portability: LALE successfully demonstrated "polyglot" pipelines. For example, on the Car dataset, the automated search found that a Java-based J48 decision tree outperformed Python-native alternatives, a discovery that might have been missed in a single-language environment.
  • Competitive Accuracy: LALE achieved competitive accuracies, such as 98.07% accuracy on the Car dataset and 93.53% on CIFAR-10, matching or exceeding the performance of native tool implementations.

Conclusion

LALE provides a robust framework for unifying the AutoML ecosystem by treating types as first-class citizens in the search process. While future work focuses on scaling LALE to distributed frameworks and expanding its library of machine-readable JSON Schemas, it already offers a powerful tool for data scientists seeking to combine manual expertise with automated exploration.

Summary updated

BibTeX
@misc{hirzel2019type,
  author = {Martin Hirzel and Kiran Kate and Avraham Shinnar and Subhrajit Roy and Parikshit Ram},
  title = {{Type-Driven Automated Learning with Lale}},
  year = {2019},
  eprint = {1906.03957},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.03957},
}
Figure