Supervised learning

Supervised learning is a type of machine learning where a model is trained on labeled data to learn the mapping between input features and corresponding outputs. The goal is to enable the model to make accurate predictions or classifications on unseen data by minimizing the error between its predictions and the true labels. Common tasks include regression (predicting continuous values) and classification (assigning categories). Supervised learning relies on a training dataset with known inputs and outputs and evaluates performance using a separate test dataset. Examples include spam email detection, image recognition, and speech-to-text systems.
click, swipe or press → to begin

Testing

In supervised machine learning, *testing* (or *inference*) is the process of evaluating a trained model's ability to make accurate predictions on new, unseen data. During this phase, the model is given data points with *features* (inputs like size or color) but without the labels it was trained on. The model uses the patterns it learned during training to predict the labels for this data. The results are then compared to the actual labels (if available) to measure the model's performance using metrics like accuracy or precision. Inference is the final application of the model to make real-world predictions.

Supervised learning & Human learning

Supervised learning parallels human learning through its reliance on guidance from labeled examples, similar to how humans learn with feedback. For instance, when a child learns to identify objects, they receive input (the object) and a corresponding label (e.g., "dog" or "apple") from a teacher or parent. Mistakes are corrected, reinforcing the connection between input and label, much like how supervised learning algorithms adjust their predictions based on errors.

Categorization

Categorization is a fundamental human cognitive process where we group objects, ideas, or experiences based on shared characteristics.

Classifiers

A classifier in machine learning is a model or algorithm designed to categorize data into predefined groups or labels. It takes input data, analyzes its features, and assigns it to a specific class based on learned patterns from training data. For example, a classifier might identify whether an email is spam or not spam, or recognize handwritten digits. Classifiers are essential in supervised learning tasks and operate by minimizing errors in predictions through training on labeled datasets. Common types include neural networks, support vector machines, decision trees etc.

Support Vector Machines

A Support Vector Machine (SVM) is a machine learning method that helps divide data into categories. Imagine drawing a line (or boundary) on a graph to separate different groups of points, like cats and dogs. SVM finds the best line that keeps the groups as far apart as possible. For trickier data, it can use special math (called kernels) to draw curves or work in higher dimensions.

Decision Trees

A Decision Tree is a visual and intuitive machine learning method that makes decisions by asking questions about the data. It works like a flowchart, starting with a question at the top and branching out based on answers. These questions are not just yes/no, but can also be comparisons, like "Is the age greater than 18?" or "Is the temperature below 30°C?" Each split is chosen using a quantitative measure, such as information gain or Gini impurity, to find the best threshold for separating the data.

Exercicio: AI Unplugged 1

You will form teams of two and use the training data to develop criteria for distinguishing biting from non-biting monkeys. These must be clearly noted so that they can be applied to new examples by another team afterwards. A possibility to record the criteria is a decision tree. It should be the goal that the existence or absence of a particular feature permits a clear assignment to one of the groups. The use of decision trees is optional, alternatively, it is also possible to explicitly write down decision rules.

At the end ofthe training phase, the criteria formulated are exchanged with another team. Now, the students are shown the pictures of the remaining monkeys (test data) one after the other. For each image, the teams decide whether the monkey will bite or not using the scheme of rules developed by their classmates...

Training

In supervised machine learning, training is the process of teaching a model, like a classifier, to make accurate predictions by learning patterns from labeled data. Each data point in the training set includes features (characteristics or inputs that describe the data, like size or color) and a corresponding label (the correct output or category). The model uses this data to adjust its internal parameters, minimizing the error between its predictions and the actual labels. This is done through algorithms like gradient descent. The goal is to generalize from the training data, enabling the classifier to make accurate predictions on new, unseen data.

Validating

In supervised machine learning, *validating* is the process of fine-tuning and assessing a model's performance during training to ensure it generalizes well to unseen data. Unlike testing, validation occurs on a separate *validation set*, distinct from both training and testing data. The model uses the *features* of this set to make predictions, which are compared to the actual labels to calculate metrics like accuracy or loss. This helps monitor overfitting or underfitting and guides adjustments to model parameters or hyperparameters (e.g., learning rate or regularization). Validation ensures the classifier is optimized before its final evaluation on the test set.

Evaluation

Binary classifiers are evaluated by comparing their predictions to the actual outcomes using a confusion matrix. This is a table with four categories: True Positives (TP), where the classifier correctly predicts a positive outcome; True Negatives (TN), where it correctly predicts a negative outcome; False Positives (FP), where it wrongly predicts a positive; and False Negatives (FN), where it misses a positive case. Metrics like accuracy (overall correctness), precision (focus on positives), and recall (how well positives are found) are calculated from this matrix, helping to assess the classifier’s performance.