HomeArticlesPhysics & Mechanics

The Basics of Machine Learning

Supervised learning is a fundamental approach in machine learning where algorithms learn from labeled data – data with both inputs and desired outputs. This allows the algorithm to build predictive models based on existing examples.

mysimulator teamUpdated June 2026≈ 5 min read▶ Open the simulation

Labeled Data & Training

The key characteristic of supervised learning is the use of labeled data. This means each input example has a corresponding correct output associated with it. For instance, if training an algorithm to recognize cats in images, you’d provide it with many images *labeled* as ‘cat’ or ‘not cat.’

This labeled dataset is then used for 'training' the model. The algorithm analyzes these examples and learns to identify patterns between the inputs and outputs.

None

Types of Supervised Learning Algorithms

Several algorithms fall under the umbrella of supervised learning. Regression models predict continuous values (e.g., house prices), while classification models categorize data into distinct groups (e.g., spam detection).

Common examples include Linear Regression, Logistic Regression, Support Vector Machines (SVMs), and Decision Trees – each suited for different types of problems.

None
live demo · related simulation● LIVE

The Learning Process: Model Building

During training, the algorithm iteratively adjusts its internal parameters to minimize the difference between its predictions and the actual labeled outputs. This process is often referred to as ‘learning’ or ‘fitting.’

Algorithms use techniques like gradient descent to find the optimal parameter values that best represent the relationships within the data.

None

Evaluation & Testing

Once a model is trained, it’s crucial to evaluate its performance. This involves testing the model on a separate dataset (the ‘test set’) that was not used during training.

Metrics like accuracy, precision, and recall are used to assess how well the model generalizes to new, unseen data. Overfitting—where the model learns the training data too well and performs poorly on new data—is a key concern.

None

Frequently asked questions

What’s the difference between supervised and unsupervised learning?

Supervised learning uses labeled data, while unsupervised learning discovers patterns in unlabeled data.

Why is labeled data important?

Labeled data provides the algorithm with ground truth to learn from and build accurate predictive models.

Can I train a model without any initial labeled data?

Not directly. You typically start with existing labeled data, but techniques like semi-supervised learning can leverage both labeled and unlabeled data.

Try it live

Everything above runs in your browser — open SPH Fluid and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open SPH Fluid simulation

What did you find?

Add reproduction steps (optional)