4Classical Machine Learning 4.1General Problem Setup
4.1.1Terminology Used in Classical Machine Learning
The standard terms for data, models and evaluation, with the notation and scikit-learn names used throughout this guide.
Task statements, documentation and research papers describe machine learning problems in a shared vocabulary. This module defines the terms used throughout the guide: the parts of a dataset, the main types of learning problem, the components of a model, and the terms used to evaluate one. Structure of a Typical Classical Machine Learning Problem shows how these parts fit together, and Approaching a Typical Classical Machine Learning Problem turns them into a complete workflow.
Samples, features and labels
The data for a classical machine learning problem is usually a table.
The Iris dataset, which is included in scikit-learn, is a standard example. It describes 150 iris flowers by four measurements in centimetres: sepal length, sepal width, petal length and petal width. The label is the species, stored as 0 (setosa), 1 (versicolor) or 2 (virginica). The first two rows and the last row are shown below.
| Sample | Sepal length | Sepal width | Petal length | Petal width | Species |
|---|---|---|---|---|---|
| 1 | 5.1 | 3.5 | 1.4 | 0.2 | 0 (setosa) |
| 2 | 4.9 | 3.0 | 1.4 | 0.2 | 0 (setosa) |
| ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
| 150 | 5.9 | 3.0 | 5.1 | 1.8 | 2 (virginica) |
Let us take the first row as an example.
It represents an iris flower with a sepal length and width of 5.1 and 3.5 centimetres, and a petal length and width of 1.4 and 0.2 centimetres. This iris flower, like any other flower in the dataset, is referred to as a "sample." The characteristics of the flower are called "features," and the species of the flower is defined as its "label."
Notation
The following symbols describe any table of this kind. The values in brackets refer to the table above.
- is the number of samples and is the number of features (, in the Iris dataset).
- is the feature vector of sample : its feature values, in order. For the first flower, .
- is the value of feature for sample ().
- is the feature matrix: all feature values, with one row per sample and one column per feature (150 rows and 4 columns).
- is the vector of labels, and is the label of sample ().
- , read "y-hat", is a model's prediction for sample . The hat distinguishes a prediction from the true label .
Row of is the feature vector , and column contains feature for every sample. Since all the values are real numbers, this is often written and .
In code, and are arrays. scikit-learn expects X to have the shape (n_samples, n_features) and y the shape (n_samples,). Python counts from 0, so sample is at index .
Several labels per sample
In some problems each sample has more than one target value. These problems are called multi-output. With target values per sample, the label of sample is a vector , and the labels of all samples form an matrix with one row per sample and one column per target. In Lost in Hyperspace (IOAI 2024), three numeric properties are predicted for each sample, so . scikit-learn expects such labels as y with the shape (n_samples, n_outputs).
Feature engineering and feature extraction
Classical models require each sample to be represented by a feature vector of fixed length. Tabular data already has this form; images, audio and text do not. A 720 × 1280 RGB image, for example, consists of 2,764,800 pixel values, and the meaning of each value depends on its position and its neighbours. Designing features from raw data by hand is called feature engineering. Computing them with a fixed transformation or a pretrained model is called feature extraction.
In Lost in Hyperspace, each sample is a 5 × 5 × 5 × 6 array. The model was fixed to linear regression with at most 300 input features for each predicted property, so the task consisted entirely of feature engineering.
Types of learning problems
The form of the labels determines the type of problem.
- Supervised learning. Every training sample is labelled, and the model learns a mapping from features to labels.
- Classification: the label takes one of a finite set of values, called classes. A problem with two classes is binary; a problem with more is multi-class. Iris is a multi-class problem with three classes. In Save the Factory (IOAI 2024), each widget belongs to one of two classes, Ruby or Sapphire.
- Regression: the label is a real number, or several real numbers in a multi-output problem such as Lost in Hyperspace.
- Unsupervised learning. No labels are available. The model finds structure in the features alone, for example groups of similar samples found by K-means clustering.
- Semi-supervised learning. Only some of the training samples are labelled. In Antique Painting Authentication (IOAI 2025), only 4 of the 500 training paintings are labelled, and the statement asks for a model trained on all samples, labelled and unlabelled.
Models, parameters and hyperparameters
A model is a function that maps a feature vector to a prediction, . A family of models fixes the form of and leaves some quantities to be determined. Linear regression, for example, predicts
where the weights and the bias are determined from data.
This might seem complicated, but essentially, a model takes a vector or matrix of numbers as input and spits out a vector or matrix of numbers as output. We will go into this later in CML Models.
Training, or fitting, is the process of choosing parameter values for which the model's predictions agree with the labels of the training data. Agreement is measured by a loss function. For regression, a standard choice is the mean squared error,
and Loss Functions covers the common alternatives. Inference, or prediction, is the application of a trained model to new samples.
In scikit-learn, models are called estimators. Every estimator provides fit(X, y) for training and predict(X) for inference.
Save the Factory illustrates the distinction. The organisers fixed both the model, a DecisionTreeClassifier, and its hyperparameters: max_depth=20 for one difficulty level and max_depth=4 for the other. Since neither could be changed, performance depended only on the features supplied to the model.
Training, validation and test sets
A model's performance on its own training data is not a reliable estimate of its performance on new data, because its parameters were chosen to fit those labels. Labelled data is therefore divided into disjoint subsets.
| Subset | Purpose | Must not be used for |
|---|---|---|
| Training set | Fitting the parameters | — |
| Validation set | Choosing hyperparameters and comparing models | Fitting the parameters |
| Test set | Estimating performance on new data, once, at the end | Any decision about the model |
In IOAI tasks, the test labels are withheld and submissions are scored on hidden test sets. Data leakage is any flow of information from validation or test data into training; it makes validation scores unreliable. Approaching a Typical Classical Machine Learning Problem shows how to split data in code and avoid leakage, and Cross-Validation describes how to validate when labelled data is limited.
Evaluation: generalisation, metrics and baselines
Generalisation is a model's ability to make accurate predictions on data it was not trained on.
- Underfitting: the model cannot represent the underlying relationship, so its error is high on both the training data and the validation data.
- Overfitting: the model fits noise specific to the training data, so its training error is low and its validation error is substantially higher.
A metric is the quantity by which predictions are evaluated, such as accuracy or root mean squared error (RMSE). It often differs from the loss used in training. Underfitting and Overfitting and Model Evaluation Metrics treat both topics in detail.
Summary
| Term | Also called | Notation | In scikit-learn |
|---|---|---|---|
| Sample | example, instance, data point, observation | a row of X |
|
| Feature | attribute, predictor, independent variable | a column of X |
|
| Label | target, ground truth | y |
|
| Multi-output labels | several targets per sample | , an matrix | y of shape (n_samples, n_outputs) |
| Prediction | model output | model.predict(X) |
|
| Parameters | learned weights | , | attributes ending in _, such as coef_ |
| Hyperparameters | settings fixed before training | , maximum depth | constructor arguments, such as max_depth |
| Training | fitting | model.fit(X, y) |
|
| Inference | prediction | model.predict(X) |
|
| Baseline | reference solution | DummyClassifier, DummyRegressor |
Resources
| Source | Title | Why read it |
|---|---|---|
| Google for Developers | What is Machine Learning? | Short sections on supervised learning (regression and classification), unsupervised learning and reinforcement learning, each with a quick quiz. |
| Google for Developers | Supervised Learning | Data, model, training, evaluating and inference, explained with one running example. |
| scikit-learn | Glossary of Common Terms and API Elements | The exact meaning of sample, feature, target, parameter and attribute in the scikit-learn documentation. |
| scikit-learn | Getting Started | Read “Fitting and predicting: estimator basics” to see fit and predict on a tiny dataset. |
| scikit-learn | User Guide: Dummy estimators | The baseline estimators DummyClassifier and DummyRegressor and their strategies. |
| IOAI | 2026 Contest Rules and Technical Appendix | Section 2.5 defines the baseline solution and how each task's score is normalised. |
| Google for Developers | Machine Learning Glossary | Look up any term you meet in a task statement. |