SEPT08: Introduction to Machine Learning
Wednesday, September 10, 2025 3:59 PM
Introduction
Definition
• A computer program learns from experience E with respect to some class of tasks T and performance measure P, if
its performance at tasks in T, as measured by P, improves with experience E.
Types of problems:
• Unsupervised Learning: No feedback is provided to the algorithm
• Supervised Learning: Each example is accompanied by a label => most extensively studied and arguably the most
intuitive type of learning. It is the first type of learning introduced in educational contexts.
• Reinforcement Learning: The algorithm receives a reward or a punishment following each action
Two phases
1. Learning (building a model)
2. Inference (using a model)
Carp-e Diem! (example)
1. Problem: Develop a predictive model to classify the likelihood of a successful fishing day into three
categories: ‘Poor’, ‘Average’, or ‘Excellent’.
2. Attributes (features): suggesting that the moon phase serves as reliable predictor of fishing success.
• Moon Phase (Categorical): ‘New Moon’, ‘First Quarter’, ‘Full Moon’, and ‘Last Quarter’.
• Forecast (Categorical): ‘Rainy’, ‘Cloudy’, and ‘Sunny’.
• Outdoor Temperature (Numerical): The temperature in Celcius.
• Water Temperature (Numerical): The water temperature of the lake or river.
Carp-e Diem! (example)
1. Problem: Develop a predictive model to classify the likelihood of a successful fishing day into three
categories: ‘Poor’, ‘Average’, or ‘Excellent’.
2. Attributes (features): suggesting that the moon phase serves as reliable predictor of fishing success.
• Moon Phase (Categorical): ‘New Moon’, ‘First Quarter’, ‘Full Moon’, and ‘Last Quarter’.
• Forecast (Categorical): ‘Rainy’, ‘Cloudy’, and ‘Sunny’.
• Outdoor Temperature (Numerical): The temperature in Celcius.
• Water Temperature (Numerical): The water temperature of the lake or river.
3. Training Data
• Data representation:
The data is often presented in a tabular (matrix) format, where each row represents an attribute vector (feature
vector), typically denoted as 𝑥i, which corresponds to the 𝑖-th example in the training set.
• Label representation:
The labels are represented as column vector, with yi denoting the label for the i-the example.
4. Model training:
• Involving using labeled data to teach a machine learning algorithm how to make predictions.
• It adjusts the model's parameters to minimize the error between the predicted and actual outcomes.
5. Prediction
• Given new, unseen data, predict whether today will be successful
• Life Cycle:
1. Data collection and preparation
2. Feature engineering
3. Training
4. Model evaluation
• Life Cycle:
1. Data collection and preparation
2. Feature engineering
3. Training
4. Model evaluation
5. Model deployment
6. Monitoring and maintenance
Formal definitions
Supervised learning (notation)
• The data set ("experience") is a collection of labelled examples.
• When the label yi is a class, taken from a finite list of classes, {1, 2,…,C}, we call the task a classification task.
• When the label yi is a real number, we call the task a regression task.
Scikit-learn
• Scikit-learn is an open source machine learning library that supports supervised and unsupervised learning. It also
provides various tools for model fitting, data preprocessing, model selection, model evaluation, and many other
utilities.
• Scikit-learn provides dozens of built-in machine learning algorithms and models, called estimators.
• Built on NumPy, SciPy, and matplotlib.
Example: Plamer Pinguins Dataset
• Loading the data
• Selecting a classifier
• Training the model
• Visualising the model
• Making prediction