Skip to main content

Machine Learning

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/machine-learning

In short

Machine learning is a branch of artificial intelligence in which computers learn patterns from data to make predictions instead of following hand-written rules.

What is machine learning?

Machine learning is a way of building software where, instead of writing every rule by hand, you show a program many examples and let it discover the patterns itself. The result is a model: a mathematical function that takes new input, such as an email, and produces an output, such as a label of spam or not spam.

Training is the process of feeding a model example data and adjusting its internal numbers, called parameters or weights, so its predictions get closer to the correct answers. Once trained, the model is used for inference, which simply means making predictions on data it has never seen. Projects usually keep a separate test set of examples to check that the model works on new data and has not just memorized the training data.

There are three main styles. In supervised learning the examples come with correct answers, called labels; in unsupervised learning the model finds structure, such as groups, in unlabeled data; and in reinforcement learning a program learns by trial and error from rewards. Common uses include recommendations, fraud detection, image recognition, speech-to-text, and language models.

Machine learning is often used as a synonym for artificial intelligence (AI), but it is a subset of it. AI is the broad goal of making machines perform tasks that normally need human intelligence, machine learning is the most common way to achieve it today, and deep learning is a subset of machine learning that uses large neural networks.

At a glance

Machine learning in two phases: in training, a model sees many labelled examples and adjusts its parameters until its answers match the labels; in inference, the trained model takes new input and makes a prediction.1Training2Inferencecompare with the labels, repeatExamplesemails + spam / not spamLearnadjust the parametersNew emailnever seen beforeModellearned patternsspam · 97%prediction
Nobody writes the rule for spam: the model finds it in the examples, so it is only as good as the data it learned from.

Key takeaways

  • Models learn patterns from example data rather than hand-written rules.
  • Training adjusts a model's parameters; inference uses the trained model to make predictions.
  • The main styles are supervised, unsupervised, and reinforcement learning.
  • A model is only as good as the data it was trained on.

Example

Training a simple model and making a predictionpython
from sklearn.linear_model import LinearRegression

# Training data: house size in square meters -> price
sizes = [[50], [80], [100], [120]]
prices = [150_000, 240_000, 300_000, 360_000]

# Training: the model learns the relationship from the examples
model = LinearRegression()
model.fit(sizes, prices)

# Inference: predict the price of a house it has never seen
print(model.predict([[90]]))  # about 270000

Readers ask

What is the difference between AI and machine learning?

Artificial intelligence is the broad field of making computers perform tasks that normally require human intelligence. Machine learning is one approach within AI in which systems learn from data instead of being explicitly programmed.

What is the difference between machine learning and deep learning?

Deep learning is a subset of machine learning that uses neural networks with many layers. It works especially well for images, audio, and text, but it usually needs more data and computing power.

Do I need a lot of math to use machine learning?

To use existing libraries and pretrained models, basic statistics and programming skills are usually enough. Designing new models or doing research requires more linear algebra, calculus, and probability.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings