How does machine learning work?

For engineers, machine learning represents the most practical form of artificial intelligence, but how does it work?

Like ‘artificial intelligence,’ the term ‘machine learning’ has been around for a long time: it was coined in 1959 by the computer scientist Arthur Samuel. He used the first machine learning model to calculate the winning chances for each side in checkers. Today, machine learning models seem to be everywhere.

The modern field of machine learning focuses on classifying data and making predictions using advanced algorithms, often in the form of an artificial neural network (ANN), which is designed to approximate the ways neurons function in living brains.

Broadly speaking, machine learning involves five sequential steps:

  1. Data Collection: Machine learning depends on data, so the first step is to gather it from various sources, including databases, sensors and online repositories. Collection includes both structured data — which fits neatly into tables —  and unstructured data, which doesn’t fit neatly into tables because of its size or type.
  2. Data Preparation: Once the data has been collected, it typically needs to be cleaned up by reformatting, filling in missing values and so on. Once the data is suitably prepared, the final step is to divide it into training and testing sets for the subsequent steps.
  3. Model Selection: Choosing the right machine learning model depends on the problem you’re dealing with, broadly divided into classification, regression and clustering. Depending on whether you’re using labeled or unlabeled data, you need to use either supervised or unsupervised learning algorithms, respectively.
  4. Model Training: During training, models are given the training dataset. Their performance is then evaluated based on general criteria such as accuracy, precision and mean squared error, as well as more specific metrics, such as F1 score and ROC-AUC. To ensure models can generalize to new data, they then need to be tested using the testing dataset.
  5. Model Tuning: By tweaking a model’s parameters, data scientists iteratively refine their models until they meet the necessary performance criteria. At that point, the model can be deployed to production and begin making predictions about new data. Even after they’re deployed, models are typically adjusted periodically to ensure continued performance.

Obviously, there are a great many more technical details involved at each step in this sequence but, whatever the particulars of a given machine learning use case, the overall approach will conform to this framework.

Written by

Ian Wright

Ian is a senior editor at engineering.com, covering additive manufacturing and 3D printing, artificial intelligence, and advanced manufacturing. Ian holds bachelors and masters degrees in philosophy from McMaster University and spent six years pursuing a doctoral degree at York University before withdrawing in good standing.