# Machine learning

> Machine learning is a branch of AI in which software learns patterns from examples rather than following hand-written rules, then uses those patterns to make predictions or decisions about new data.

Also called: ML, predictive modelling, statistical learning. Category: Models and training. Source: https://aibuildindex.com/glossary/machine-learning

## In the index

- Machine learning: median $3,520, middle half $500 to $10,000, 4,945 priced briefs (https://aibuildindex.com/skills/machine-learning)
- Forecasting and prediction model: median $2,000, middle half $300 to $7,200, 109 priced briefs (https://aibuildindex.com/cost/forecasting-prediction)
- Recommendation system: median $1,850, middle half $560 to $4,700, 67 priced briefs (https://aibuildindex.com/cost/recommendation-system)

Machine learning is the practice of teaching a computer by example. Instead of writing a rule for every case, a team gives the software many past cases with known outcomes, and it finds patterns that let it predict outcomes for new ones. For a business buyer it sits behind demand forecasts, fraud flags, churn scores, product recommendations and lead scoring, and it remains the right tool for many problems that do not involve language at all.

## How it works

Most business machine learning is **supervised**: each training example has a known answer, such as whether a customer churned. The model learns to map inputs, such as usage, tenure and support history, to that answer. **Unsupervised** learning looks for structure without answers, for example grouping customers into segments. **Reinforcement learning** learns from trial and reward and is rarer in business builds.

A typical project runs through the same stages. Gather and clean historical data. Choose features, meaning the inputs the model sees. Train several candidate models, often gradient-boosted trees or [neural networks](https://aibuildindex.com/glossary/neural-network). Test on data the model never saw, ideally from a later time period. Then deploy the model so it scores new records, and monitor it. A retailer predicting weekly demand per store, for instance, trains on past sales, holidays and promotions, then compares the model's forecasts against what actually sold.

## What it means for cost

Machine learning budgets are dominated by data and upkeep rather than algorithms:

- **Data readiness.** If history is scattered, inconsistent or missing the outcome you want to predict, cleaning and joining it is the largest task. See [training data](https://aibuildindex.com/glossary/training-data).
- **Evaluation.** A model is only useful if it beats the current method, so a builder needs a fair baseline and a clear success measure.
- **Deployment.** A notebook result is not a product. Scheduling, integration and [MLOps](https://aibuildindex.com/glossary/mlops) turn a model into something people use.
- **Maintenance.** Patterns change and accuracy fades through [model drift](https://aibuildindex.com/glossary/model-drift), so retraining should be planned and budgeted.

Ask a builder what baseline they will compare against and how the model will be retrained. Live figures for prediction builds are on the [forecasting and prediction cost page](https://aibuildindex.com/cost/forecasting-prediction).

## When it is the wrong tool

If the rules are known and stable, write the rules. If there is little history, or the outcome you care about has rarely happened, a model will struggle to learn anything reliable.

## Common questions

### Is machine learning the same as AI?

It is the largest part of modern AI but not all of it. Rule-based systems and search are also AI in the broad sense. Large language models are a product of machine learning, specifically [deep learning](https://aibuildindex.com/glossary/deep-learning).

### How much data does machine learning need?

Enough examples of each outcome to learn from, which depends on the problem. A forecast with several years of steady weekly data can work well; a fraud model with only a handful of known fraud cases usually cannot.

## Related terms

- [Deep learning](https://aibuildindex.com/glossary/deep-learning): Deep learning is a type of machine learning that uses neural networks with many layers to learn directly from raw data such as text, images and audio, and it underpins modern language, vision and speech models.
- [Training data](https://aibuildindex.com/glossary/training-data): Training data is the set of examples a machine learning model learns from, such as labelled images, past transactions or question-and-answer pairs, and its quality, coverage and rights largely decide how well the finished model performs.
- [Classification](https://aibuildindex.com/glossary/classification): Classification is a machine learning task in which a model assigns each input, such as an email, image, transaction or document, to one of a set of predefined categories, for example spam or not spam, or which team should handle it.
- [Forecasting](https://aibuildindex.com/glossary/forecasting): Forecasting is the use of historical data and statistical or machine learning models to estimate future values, such as next month's sales, call volumes or stock needs, usually with a range that shows how uncertain the estimate is.
- [MLOps](https://aibuildindex.com/glossary/mlops): MLOps is the set of practices for building, deploying and maintaining machine learning models in production, covering data pipelines, training, versioning, deployment, monitoring and retraining when performance declines.
- [Model drift](https://aibuildindex.com/glossary/model-drift): Model drift is the gradual decline in an AI system's accuracy after launch, caused by real-world data, user behaviour or the underlying model changing away from the conditions the system was built and tested on.
