banner
Automated ML, pt. 1
Because I'm lazy
#️⃣   ⌛  ~50 min 🤓  Intermediate
12.05.2024
upd:
#106

views-badgeviews-badge
banner
Automated ML, pt. 1
Because I'm lazy
⌛  ~50 min
#106


🎓 141/167

This post is a part of the Other ML problems & advanced methods educational series from my free course. Please keep in mind that the correct sequence of posts is outlined on the course page, while it can be arbitrary in Research.

I'm also happy to announce that I've started working on standalone paid courses, so you could support my work and get cheap educational material. These courses will be of completely different quality, with more theoretical depth and niche focus, and will feature challenging projects, quizzes, exercises, video lectures and supplementary stuff. Stay tuned!


Automated Machine Learning (AutoML) has emerged as one of the most promising areas in the field of machine learning, with the potential to democratize data science by making complex machine learning tasks accessible to non-experts, while also providing experts with tools to streamline and automate repetitive tasks. The primary purpose of this article is to offer a comprehensive guide to AutoML, covering its fundamental concepts, methodologies, and practical applications. This article also provides insights into the workflow of AutoML systems, highlights key tasks that can be automated, and explores the future of this rapidly evolving field.

Brief history of automated machine learning (AutoML)

The journey of AutoML began with the aim to alleviate the burden on data scientists and machine learning practitioners, who often spend the majority of their time on tasks like model selection, hyperparameter tuning, and data preprocessing. The initial concept of automating these steps arose from the need for tools that could not only automate repetitive tasks but also improve the performance of machine learning systems. Over time, AutoML evolved with contributions from diverse domains including meta-learning, neural architecture search (NAS), and evolutionary algorithms.

In the early 2010s, key developments in AutoML began with frameworks like Auto-WEKA, which automated model selection and hyperparameter tuning. However, it was with the advent of more sophisticated algorithms and computing power that frameworks like Auto-sklearn, TPOT, and H2O AutoML gained significant traction. These platforms enabled the automation of entire machine learning workflows, such as data preprocessing, feature engineering, and model selection, which were traditionally done manually by data scientists.

Scope and audience

This article is intended for machine learning practitioners, data scientists, and researchers with a deep understanding of machine learning concepts and a desire to explore the state-of-the-art tools that make machine learning more accessible and efficient. If you are familiar with basic machine learning workflows, this article will dive into how AutoML systems can be used to automate various stages of these workflows, save time, and potentially improve the results.

Why Automated Machine Learning?

Definition and core concepts of AutoML

At its core, AutoML refers to the process of automating the design, training, and optimization of machine learning models. AutoML systems aim to reduce the human intervention required in the typical machine learning pipeline, allowing non-experts to build high-quality models and enabling experts to focus on more complex tasks like model interpretation or domain-specific problem-solving.

The central concept behind AutoML is the automation of the following machine learning tasks:

  1. Data preprocessing and feature engineering: Automatic cleaning, transformation, and selection of features from raw data.
  2. Model selection: Choosing the best machine learning algorithm for a given task.
  3. Hyperparameter tuning: Automatically adjusting the hyperparameters of the model to improve performance.
  4. Model ensembling: Combining the predictions of multiple models to achieve better results.
  5. Evaluation and validation: Selecting the appropriate evaluation metrics and validation techniques.

Advantages and motivations behind automating machine learning

The primary motivation behind AutoML is to enhance the efficiency of machine learning processes by automating time-consuming tasks. Some of the main advantages of AutoML include:

  • Speed: It significantly reduces the time taken to develop a machine learning model by automating repetitive and manual steps.
  • Improved performance: AutoML systems can fine-tune models and explore hyperparameter spaces in ways that humans may not, potentially yielding better performance.
  • Accessibility: AutoML opens the door to machine learning for non-experts by lowering the barrier to entry.
  • Reproducibility: By automating workflows, AutoML ensures that models and results are reproducible, as each step in the process is clearly defined.

Common challenges and pain points in traditional ML workflows

While machine learning workflows can be highly effective, they also come with challenges:

  • Manual labor: Data preprocessing, feature engineering, and model selection often require significant time and expertise.
  • Hyperparameter tuning: Choosing the right set of hyperparameters for a model is critical for performance but can be a very time-consuming process.
  • Lack of consistency: It's easy for human error to introduce inconsistencies or bias, especially when handling large datasets.
  • Model complexity: Understanding and optimizing models, particularly deep learning networks, can require substantial expertise and resources.

AutoML addresses these challenges by introducing automation, reducing human error, and providing solutions for faster and more efficient model development.

Full AutoML Workflow

Data preparation and ingestion

One of the first and most critical stages of any machine learning project is the preparation and ingestion of data. In a typical ML pipeline, data comes in various formats and sources, and it requires substantial effort to clean and preprocess it. In AutoML, this stage is fully automated, allowing the system to handle raw, unstructured data.

Handling raw data in miscellaneous formats

Data comes in different forms, ranging from structured tabular data (CSV, Excel) to unstructured data (text, images). AutoML systems are designed to ingest these different formats, transforming them into a standard representation suitable for machine learning tasks.

Column type detection

AutoML platforms use algorithms to automatically detect the type of each column in the dataset. This includes recognizing whether a column contains:

  • Boolean values (True/False)
  • Discrete numerical values** (real numbers)
  • Textual data (such as categories or free-form text)

Column intent detection

AutoML systems also automatically detect the intended use of each column. This can include recognizing columns that represent the:

  • Target/label: The column that contains the values we want to predict.
  • Stratification field: The field used for stratification during cross-validation, ensuring that the splits are representative.
  • Numerical features: Columns with numerical data that are used for prediction.
  • Categorical text features: Columns with categorical data represented as text.
  • Free-text features: Columns containing unstructured text (e.g., user reviews, descriptions).

Task detection

The task at hand also needs to be detected automatically. AutoML systems can identify the appropriate type of machine learning task, such as:

  • Binary classification: Classifying data into two categories (e.g., spam vs. not spam).
  • Regression: Predicting continuous values (e.g., house prices).
  • Clustering: Grouping data points based on similarity (e.g., customer segmentation).
  • Ranking: Ranking items based on relevance (e.g., search engine results).

Feature engineering

Feature engineering is the process of selecting, transforming, and extracting features from raw data. In traditional machine learning, this step requires domain knowledge and considerable time investment. AutoML automates feature engineering through various strategies:

Feature selection

Feature selection involves choosing the most relevant features for the model, often based on metrics like correlation, mutual information, or importance scores.

Feature extraction

AutoML can automate the creation of new features through transformations like:

  • Principal Component Analysis (PCA) for dimensionality reduction.
  • One-hot encoding for categorical variables.
  • Text vectorization (e.g., TF-IDF, word embeddings) for text data.

Meta-learning and transfer learning

Meta-learning, or "learning to learn", is a technique where a model uses prior knowledge gained from previous tasks to improve the learning process on new tasks. AutoML leverages meta-learning to optimize the model selection and hyperparameter tuning processes. Transfer learning, where a pre-trained model is fine-tuned for a new task, is also a powerful technique that can be automated.

Detection and handling of skewed data and missing values

AutoML systems detect data imbalances (e.g., in classification tasks with imbalanced classes) and missing values. These issues are automatically addressed through resampling techniques or imputation methods.

Model selection

In the model selection stage, AutoML systems automatically evaluate different algorithms to determine the best one for the given task. This process typically involves training and evaluating models such as:

  • Linear models (e.g., Logistic Regression, Linear Regression)
  • Tree-based models (e.g., Decision Trees, Random Forests, XGBoost)
  • Support Vector Machines (SVM)
  • Neural networks (e.g., MLPs, CNNs, RNNs)

The system compares the performance of various algorithms, selecting the best one based on predefined criteria such as accuracy, speed, and memory usage.

Ensembling

Ensembling is a method where multiple models are combined to make predictions, often yielding better performance than any single model. AutoML systems employ several ensembling techniques, such as:

  • Bagging: Training multiple instances of the same model on different subsets of data and combining their predictions.
  • Boosting: Sequentially training models, where each subsequent model corrects the errors of the previous one.
  • Stacking: Using the predictions of several models as features for a final meta-model.

Hyperparameter optimization

Hyperparameter optimization is the process of fine-tuning the parameters of the selected model to improve its performance. AutoML systems typically use techniques such as:

  • Grid search: Exhaustively searching over a specified hyperparameter space.
  • Random search: Randomly sampling hyperparameters and evaluating their performance.
  • Bayesian optimization: A probabilistic model-based approach to optimize hyperparameters more efficiently.

Neural architecture search (NAS)

For deep learning models, AutoML systems also incorporate neural architecture search (NAS), which involves searching for the optimal architecture of neural networks (e.g., the number of layers, type of connections, etc.) to improve performance.

Pipeline selection

In addition to individual model optimization, AutoML systems automate the selection of the optimal machine learning pipeline. This includes choosing the appropriate preprocessing steps, feature transformations, and model types. Constraints such as time, memory usage, and computational complexity are taken into account to select the best pipeline.

Selection of evaluation metrics and validation procedures

AutoML systems automatically choose the evaluation metrics that are most appropriate for the task at hand, such as accuracy for classification tasks, mean squared error for regression, or silhouette score for clustering. Additionally, the system selects the best validation method, such as cross-validation or train-validation splits, to assess the model's performance.

Problem checking

Problem checking is a crucial part of any machine learning system. AutoML platforms automatically check for:

  • Data leakage: Ensuring that no information from the validation or test set has been used during training.
  • Misconfigurations: Detecting issues such as incorrect data preprocessing steps, improper handling of categorical features, or incompatible model types.

Analysis of obtained results

Once the models have been trained, AutoML systems provide an analysis of the obtained results, including interpreting performance metrics, identifying sources of error, and offering recommendations for further improvement.

Creating user interfaces and visualizations

Finally, AutoML systems present results through user-friendly interfaces and visualizations, such as dashboards and interactive model exploration tools. This allows users to gain insights into the models' behavior and make informed decisions based on the results.


This concludes the first part of our exploration into the world of Automated Machine Learning. In the next sections, we will dive deeper into the key methodologies, tools, and frameworks that power AutoML systems, with a focus on meta-learning, hyperparameter optimization, and neural architecture search. Stay tuned for the next installment.

kofi_logopaypal_logopatreon_logobtc-logobnb-logoeth-logo
kofi_logopaypal_logopatreon_logobtc-logobnb-logoeth-logo