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.
| Stage | Purpose | Typical output |
|---|---|---|
| Problem framing | Define task, target and metric | Clear success criterion |
| Data preparation | Collect, clean and label data | Training, validation and test sets |
| Feature engineering | Turn raw data into useful inputs | Feature vectors or embeddings |
| Training | Fit parameters by minimizing loss | Trained model |
| Evaluation | Measure generalization | Metrics on held-out data |
| Deployment and monitoring | Serve predictions, watch for drift | Production model with alerts |
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.
| Paradigm | Training signal | Typical tasks |
|---|---|---|
| Supervised learning | Labeled input and output pairs | Classification, regression, forecasting |
| Unsupervised learning | Unlabeled data only | Clustering, dimensionality reduction, anomaly detection |
| Self-supervised learning | Labels derived from the data itself | Pretraining language and vision models |
| Semi-supervised learning | Few labels, many unlabeled examples | Classification with scarce labels |
| Reinforcement learning | Rewards from interaction | Control, games, sequential decisions |
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 family | Strengths | Limitations | Typical data |
|---|---|---|---|
| Linear and logistic regression | Fast, interpretable, stable | Captures only simple relationships | Tabular, small to large |
| Decision trees | Readable rules | Unstable, overfit easily | Tabular |
| Gradient-boosted trees | Top accuracy on tabular data | Less interpretable, needs tuning | Tabular, structured |
| Support vector machines | Strong on medium-sized data | Scale poorly to very large data | Tabular, text features |
| Neural networks | Learn representations automatically | Data-hungry, costly to train | Images, audio, text |
| Clustering algorithms | Find structure without labels | Results depend on assumptions | Customer or sensor data |
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.
| Problem | Symptom | Remedy |
|---|---|---|
| Overfitting | Training score far above validation score | Regularization, more data, simpler model |
| Underfitting | Poor scores everywhere | Richer features or more flexible model |
| Data leakage | Unrealistically high test results | Remove future or target-derived features |
| Class imbalance | High accuracy, missed rare cases | Resampling, class weights, suitable metrics |
| Data drift | Performance declines after deployment | Monitoring and scheduled retraining |
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.