# What is machine learning?

> Machine learning is a way to build software that learns patterns from data instead of following fixed rules. Learn how training works and where it is used.

URL: https://www.jalkarna.in/based/learn/what-is-machine-learning/  
Last updated: 2026-11-16

Machine learning (ML) is a method of building software that learns patterns from example data instead of being given explicit rules. You show a model many examples, it adjusts itself to get better at the task, and it can then make predictions on new data it has not seen.

It is the main technique behind modern [artificial intelligence](https://www.jalkarna.in/based/learn/what-is-artificial-intelligence/), including spam filters, recommendation systems, speech recognition, and chatbots.

## How does machine learning work?

Almost every ML project follows the same loop:

1. **Collect data.** For a spam filter, that means many emails already labeled spam or not spam.
2. **Pick a model.** A model is a mathematical structure with adjustable numbers called parameters.
3. **Train it.** The model makes guesses on the data, a score measures how wrong the guesses are, and the parameters are nudged to reduce the error. This repeats many times.
4. **Test it.** The model is checked on data it never trained on, to see whether it learned a general pattern or just memorized the examples.
5. **Use it.** The trained model makes predictions on new inputs.

The key idea is that the programmer does not write the rules. The rules emerge from the data.

## What are the types of machine learning?

| Type | How it learns | Example |
|---|---|---|
| Supervised | From examples with correct answers attached | Labeling emails as spam |
| Unsupervised | From unlabeled data, finding structure on its own | Grouping similar customers |
| Reinforcement | By trial and error, guided by rewards | Training a program to play a game |

Many language models combine approaches. They first learn from raw text by predicting what comes next, then get extra training from human feedback. See [what is a large language model](https://www.jalkarna.in/based/learn/what-is-a-large-language-model/).

## What is deep learning?

Deep learning is a branch of machine learning that uses neural networks with many layers. Each layer transforms its input a little, and stacking many layers lets the network learn complicated patterns like the shape of a face or the structure of a sentence. Today's most capable image and language systems are deep learning models.

## Machine learning vs traditional programming

In traditional programming you supply rules and data, and the program produces answers. In machine learning you supply data and answers, and the training process produces the rules. That is why ML suits problems where rules are hard to write down, such as recognizing speech, and why it is a poor fit for problems with clear exact rules, like calculating tax from a formula.

## What can go wrong?

- **Bad or biased data.** A model learns whatever patterns are in its data, including unfair ones.
- **Overfitting.** The model memorizes training examples and fails on new ones.
- **Distribution shift.** The real world changes after training, and the model's patterns go stale.
- **Opaque reasoning.** Large models are hard to inspect, so it can be difficult to explain why they gave an answer.

## Where machine learning shows up

You meet ML when your phone unlocks with your face, when a map predicts traffic, when a store suggests a product, and when an [AI chatbot](https://www.jalkarna.in/based/learn/what-is-an-ai-chatbot/) replies to a message. For an encyclopedic overview, see [Wikipedia on machine learning](https://en.wikipedia.org/wiki/Machine_learning).

## Machine learning in Based

Based is an AI Discord bot, so features like chat, summaries, and image creation rely on trained models behind the scenes. You can explore what is available in the [Based docs](https://www.jalkarna.in/based/docs/) or on the [features page](https://www.jalkarna.in/based/features/).

## FAQ

### What is machine learning in simple terms?

It is teaching a computer by example instead of by rules. The program studies lots of data, finds patterns, and uses them to make predictions on new inputs.

### What is the difference between AI and machine learning?

AI is the broad goal of making software do tasks that need intelligence. Machine learning is one method for achieving that goal, by learning from data.

### What is a model in machine learning?

A model is the trained result: a mathematical structure whose internal numbers were tuned on data so it can make predictions on new inputs.

### Does machine learning need a lot of data?

Usually yes. Simple tasks can work with modest data, but large modern models need very large datasets to learn well.

## Related
- [What is artificial intelligence (AI)?](https://www.jalkarna.in/based/learn/what-is-artificial-intelligence/)
- [What is a large language model (LLM)?](https://www.jalkarna.in/based/learn/what-is-a-large-language-model/)
- [What is generative AI?](https://www.jalkarna.in/based/learn/what-is-generative-ai/)
- [What is an AI chatbot?](https://www.jalkarna.in/based/learn/what-is-an-ai-chatbot/)
