# Machine learning algorithm

> Canonical: https://skillalmanac.com/glossary/machine-learning-algorithm | Last verified: 2026-11-25 | Index status: index-eligible

A machine learning algorithm is a procedure for deriving a model or data-dependent behavior from training data. Methods can fit parameters, build structures or retain examples; repeated error-minimizing parameter updates are one approach, not the definition.

Also called: ML algorithm, ML algorithms, types of machine learning algorithms.

## In plain language

A machine learning algorithm is the method a computer uses to learn. Think of a recipe for learning rather than the dish. For spam filtering, one algorithm might look at many labelled emails, measure how often its guesses are wrong, and adjust itself again and again until it is mostly right. Different algorithms suit different jobs. What comes out is a trained model, which is a separate thing. An algorithm does nothing useful until it is run on data, and a method that works well on one kind of data may work poorly on another, so the choice has to be tested.

## Technical definition

Learning algorithms derive a model or data-dependent behavior from training examples. Some iteratively optimize parameters against a loss; other procedures differ. Scikit-learn's nearest-neighbor classifier stores training instances and predicts from nearby examples, so fitting is not always repeated parameter-error minimization. IBM describes a prediction-error adjustment loop, and MIT Sloan identifies neural networks as one class of machine learning algorithms. The procedure is distinct from the fitted result. Use validation data or cross-validation to select candidates and settings, then use a separate held-out test set for final evaluation; repeated selection on that test set leaks information.

## How it shows up when you use agents

You do not choose a learning algorithm when you use Claude Code, Codex or Cursor, because the model was trained before you got it. The algorithm matters when an agent helps with a data task: asked to "build a classifier", it picks an algorithm, trains it on your data and hands back a model. Ask which algorithm it chose and why.

What breaks when this is misunderstood: people treat the algorithm name as a quality guarantee. The result depends on the data and on how it was split and tested. Test leakage can inflate results. The [split leakage check skill](/skills/skill-almanac/split-leakage-check) flags selected file-based signals, not every leakage pathway. Select candidates on validation data or cross-validation, then reserve the final test for final evaluation.

The trained result is covered in [Machine learning model](/glossary/machine-learning-model). For the learning styles, see [Supervised learning](/glossary/supervised-learning) and [Unsupervised learning](/glossary/unsupervised-learning).

## Common confusions

- **Algorithm versus model.** The algorithm is the procedure and the model is what it produces. Running one algorithm on different data gives different models. See [Machine learning model](/glossary/machine-learning-model).
- **Learning algorithm versus any algorithm.** A sorting routine is an algorithm but does not learn from data. A machine learning algorithm derives data-dependent behavior from examples; this can include retaining examples rather than adjusting numeric parameters.
- **Algorithm versus learning style.** Supervised and unsupervised describe what data the algorithm sees, labelled or not. Many algorithms exist within each.
- **Myth.** A newer algorithm is better. Which suits a task depends on the data, so select candidates with validation data or cross-validation and evaluate the chosen result on a separate final test set.

## Worked examples in this catalogue

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A JSON report on train, validation and test files covering duplicates, shared groups, and time or label leakage.

Why it exercises the concept: Whatever algorithm is used, it learns from the training file. This check helps make sure the held-out files do not leak into it.

### [huggingface-datasets](https://skillalmanac.com/skills/huggingface/huggingface-datasets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Metadata, rows, search and filters for Hugging Face datasets, read through the Dataset Viewer API.

Why it exercises the concept: A learning algorithm works on data. This skill lets an agent look at the rows an algorithm would be given before any training is run.

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An eval dataset for an LLM feature, validated for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: Comparing two algorithms or models needs the same test data. This checker validates case structure and selected duplicate/leakage signals, not answer truth, model outputs or overall fairness. Using the same cases helps comparison but does not by itself make it reliable.

## Related terms

- [Machine learning model](https://skillalmanac.com/glossary/machine-learning-model.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)
- [Supervised learning](https://skillalmanac.com/glossary/supervised-learning.md)
- [Unsupervised learning](https://skillalmanac.com/glossary/unsupervised-learning.md)
- [Neural network](https://skillalmanac.com/glossary/neural-network.md)
- [Support vector machine (SVM)](https://skillalmanac.com/glossary/support-vector-machine.md)

## Sources

- [What is machine learning (ML)?](https://www.ibm.com/think/topics/machine-learning), IBM (accessed 2026-11-24)
- [Types of machine learning](https://www.ibm.com/think/topics/machine-learning-types), IBM (accessed 2026-11-24)
- [Machine learning, explained](https://mitsloan.mit.edu/ideas-made-to-matter/machine-learning-explained), MIT Sloan School of Management (accessed 2026-11-24)
- [Nearest Neighbors: instance-based learning](https://scikit-learn.org/stable/modules/neighbors.html), scikit-learn (accessed 2026-11-25)
- [Cross-validation: selection and final test evaluation](https://scikit-learn.org/stable/modules/cross_validation.html), scikit-learn (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
