Machine learning

On this page 7

Machine learning (ML) is the branch of artificial intelligence in which a system learns patterns from data and uses them to make predictions or decisions, instead of following rules written explicitly by a programmer. Formally, a program learns when its performance on a task improves with experience, measured by a defined metric.

Among AI fundamentals, machine learning is the dominant practical approach: spam filters, credit scoring, recommendation systems, speech recognition and large language models all rely on it. Deep learning is a subset of machine learning that uses multilayer neural networks, while artificial intelligence is the broader field that also includes search, planning and symbolic reasoning.

How machine learning works

A machine learning system has three ingredients: a model, which is a function with adjustable parameters; a loss function, which measures how wrong the model’s outputs are; and an optimization algorithm, which changes the parameters to reduce the loss on training data. The most widespread optimizer is gradient descent and its stochastic variants.

The goal is not to memorize the training data but to generalize to new, unseen data. Data is therefore split into training, validation and test sets. The validation set guides choices such as model size, while the test set provides a final, unbiased estimate of performance.

StagePurposeTypical output
Problem framingDefine task, target and metricClear success criterion
Data preparationCollect, clean and label dataTraining, validation and test sets
Feature engineeringTurn raw data into useful inputsFeature vectors or embeddings
TrainingFit parameters by minimizing lossTrained model
EvaluationMeasure generalizationMetrics on held-out data
Deployment and monitoringServe predictions, watch for driftProduction model with alerts
Stages of a machine learning workflow

Main types of machine learning

Machine learning methods are grouped by the kind of feedback available during learning. The type determines what data must be collected and what the model can do.

ParadigmTraining signalTypical tasks
Supervised learningLabeled input and output pairsClassification, regression, forecasting
Unsupervised learningUnlabeled data onlyClustering, dimensionality reduction, anomaly detection
Self-supervised learningLabels derived from the data itselfPretraining language and vision models
Semi-supervised learningFew labels, many unlabeled examplesClassification with scarce labels
Reinforcement learningRewards from interactionControl, games, sequential decisions
Learning paradigms

Supervised learning remains the most common in business applications because outcomes such as churn, default or fraud are recorded in historical data. Self-supervised pretraining became central with large neural networks, because it extracts learning signals from vast amounts of unlabeled text and images.

Common model families

No single algorithm is best for every problem. The choice depends on data type, data volume, interpretability needs and compute budget.

Model familyStrengthsLimitationsTypical data
Linear and logistic regressionFast, interpretable, stableCaptures only simple relationshipsTabular, small to large
Decision treesReadable rulesUnstable, overfit easilyTabular
Gradient-boosted treesTop accuracy on tabular dataLess interpretable, needs tuningTabular, structured
Support vector machinesStrong on medium-sized dataScale poorly to very large dataTabular, text features
Neural networksLearn representations automaticallyData-hungry, costly to trainImages, audio, text
Clustering algorithmsFind structure without labelsResults depend on assumptionsCustomer or sensor data
Model families and where they fit

For structured tabular data, gradient-boosted trees are frequently the strongest baseline, while deep neural networks dominate unstructured data such as images, speech and natural language.

Generalization, overfitting and evaluation

The central tension in machine learning is the bias-variance trade-off. A model that is too simple underfits and misses real patterns, while a model that is too flexible overfits, learning noise in the training data that does not recur. Overfitting shows as excellent training performance but much weaker validation performance.

Remedies include more and better data, regularization, early stopping, simpler models and cross-validation, which rotates the validation split to obtain a more reliable estimate. Metrics must match the business goal: accuracy is misleading on imbalanced data, where precision, recall, F1 score or the area under the ROC curve tell more.

ProblemSymptomRemedy
OverfittingTraining score far above validation scoreRegularization, more data, simpler model
UnderfittingPoor scores everywhereRicher features or more flexible model
Data leakageUnrealistically high test resultsRemove future or target-derived features
Class imbalanceHigh accuracy, missed rare casesResampling, class weights, suitable metrics
Data driftPerformance declines after deploymentMonitoring and scheduled retraining
Typical problems and remedies

Limitations and responsible use

Machine learning finds correlations, not causes, so a model can rely on shortcuts that fail when conditions change. Models also inherit biases present in their training data, which can produce unfair outcomes for groups underrepresented or historically disadvantaged in that data.

Responsible practice includes documenting data sources and intended use, testing performance across subgroups, explaining important decisions where regulations require it, and keeping human oversight for high-stakes outcomes such as lending, hiring and medical diagnosis.

Understanding it simply

Machine learning is teaching computers by example instead of by instructions. Rather than writing a rule for every possible spam email, people show a program thousands of emails marked as spam or not spam, and the program works out the telltale patterns on its own.

It is similar to how a person learns to recognize ripe fruit after seeing many examples. The more good examples the program sees, the better it becomes, but it can only be as good as the examples it learned from.

Applied in practice

A regional electricity supplier wants to forecast hourly demand one day ahead to plan purchases on the wholesale market. Analysts assemble five years of hourly consumption together with temperature forecasts, calendar features such as holidays and weekdays, and recent demand levels.

They train a gradient-boosted tree model on the first four years and test it on the most recent year. The model reduces the average forecasting error by about a third compared with the previous rule-based method, and a monthly retraining schedule keeps it current as consumption habits change.

With more accurate forecasts, the supplier buys less expensive short-notice energy, and operators receive alerts when actual demand deviates strongly from the prediction, which often signals unusual weather or a grid incident.