W1 - Introduction To ML
W1 - Introduction To ML
CS-245: Machine
Learning
Dr. Mehwish Fatima
Assistant Professor,
AI & DS Department,
SEECS-NUST, Pakistan
WEEK 1:
INTRODUCTION TO MACHINE
LEARNING
AGENDA 3
01 Introduction to course
04 Types of machine
learning
02 Artificial intelligence
05 ML pipeline
03 What is machine
learning 06 Challenges in ML
INTRODUCTION TO COURSE
Course
● This course introduces the foundational concepts of machine learning
(ML) with a focus on understanding core algorithms, performance
evaluation, and practical implementation.
○ Supervised, and unsupervised paradigms
○ Build, analyze, and evaluate ML models.
○ Regression, classification, clustering, dimensionality reduction, and debugging ML
systems
○ Learning with a project that applies ML techniques to solve practical problems.
Instructor
● Phd:
○ Ruprecht-Karls-Universität Heidelberg, Germany (2018–2024)
● Experience:
○ Industry & Academia (10+years)
● Research:
○ https://scholar.google.com/citations?user=zEyTPkMAAAAJ&hl=en
● Research Area:
○ Generative AI (GenAI) & Natural Language Processing (NLP)
○ Computational Linguistics (CL)
WHAT IS
○ Machine Learning (ML) & Deep Learning (DL)
● GENERATIVE
Practical Skills: AI?
○ Languages & Frameworks: Python, PyTorch, TensorFlow, CUDA, C++/Java
○ Tools: DeepSpeed, Docker, Kubernetes, LangChain, AWS, Google Colab, GitHub,
MultiGPU server deployments
ARTIFICIAL INTELLIGENCE
Artificial Intelligence Artificial Intelligence
Machine Learning
The basic goal of AI is to develop
intelligent machines. Deep Learning
GenAI
This consists of many sub-goals:
• Perception
• Reasoning
• Control / Motion /
Manipulation
• Planning
• Communication
• Creativity
• Learning
Artificial Intelligence Artificial Intelligence
Machine Learning
The basic goal of AI is to develop
intelligent machines. Deep Learning
GenAI
This consists of many sub-goals:
• Perception
• Reasoning
• Control / Motion /
Manipulation
• Planning
• Communication
• Creativity
• Learning
Artificial
Artificial Intelligence Artificial Intelligence
Intelligence
Intelligence
Machine Learning
The basic goal of AI is to develop Learning
intelligent machines. Deep Learning
Learning
This consists of many sub-goals: GenAI
GenAI
• Perception
• Reasoning
• Control / Motion /
Manipulation
• Planning
• Communication
• Creativity
• Learning
Artificial
Artificial Intelligence Artificial Intelligence
Intelligence
Intelligence
Machine Learning
The basic goal of AI is to develop Learning
intelligent machines. Deep Learning
Learning
This consists of many sub-goals: GenAI
GenAI
• Perception
• Reasoning
• Control / Motion / Manipulation
• Planning
• Communication
• Creativity
• Learning
Artificial
Artificial Intelligence Artificial Intelligence
Intelligence
Intelligence
Machine Learning
The basic goal of AI is to develop Learning
intelligent machines. Deep Learning
Learning
This consists of many sub-goals: GenAI
GenA
I
• Perception
• Reasoning
• Control / Motion /
Manipulation
• Planning
• Communication
• Creativity
• Learning
Artificial
Artificial Intelligence
Artificial Intelligence
Intelligence
Intelligence
Machine Learning
The basic goal of AI is to develop Learning
intelligent machines. Deep Learning
Learning
This consists of many sub-goals: GenAI
GenA
I
• Perception
• Reasoning
• Control / Motion /
Manipulation
Planning
•• Communication
• Creativity
• Learning
Artificial
Artificial Intelligence Artificial Intelligence
Intelligence
Intelligence
Machine Learning
The basic goal of AI is to develop Learning
intelligent machines. Deep Learning
Learning
This consists of many sub-goals: GenAI
GenA
I
• Perception
• Reasoning
• Control / Motion /
Manipulation
• Planning
Communication
• Creativity
• Learning
1
“Deep Style” from https://deepdreamgenerator.com/#gallery 0
Artificial
Artificial Intelligence Artificial Intelligence
Intelligence
Intelligence
Machine Learning
The basic goal of AI is to develop Learning
intelligent machines. Deep Learning
Learning
This consists of many sub-goals: GenAI
GenA
I
• Perception
• Reasoning
• Control / Motion /
Manipulation
• Planning
• Communication
Creativity
• Learning
History
WHAT IS MACHINE LEARNING?
Machine Learning
● Machine Learning (ML) is a subset of AI that enables models to learn
patterns from data and make decisions without being explicitly
programmed.
● Mathematically
○ A model 𝑓 learns a function that maps input 𝑋 to output 𝑌,
○ 𝑌 = 𝑓(𝑋)+ϵ where ϵ represents the error or noise in predictions.
Machine Learning
● Logically
○ The goal of ML is to generalize from past data (training data) to make accurate
predictions on unseen data (test data).
● Example
○ Predicting house prices using features like square footage, location, and number of
rooms.
Learning in Humans
Learning in Humans
● Imagine you're teaching a child to recognize
different types of animals, like dogs and cats.
This is what machine learning models aim to do when we say they are
"generalizing".
Machine Learning
● Generalization
○ A model that has generalized well can handle new data and make correct
predictions,
■ like predicting house prices in a new neighborhood based on the
features (size, number of rooms, etc.) it learned during training.
○ A model that doesn't generalize well might only work on the data it has seen
before and fail when presented with new data, which is called overfitting.
Traditional Programming Approach Vs. ML
Traditional Programming
Approach Vs. ML
ML CLASSIFICATION
Types of Machine Learning
Types of Machine Learning
● There are so many different types of ML systems that it is useful to
classify them in broad categories based on:
○ Whether or not they are trained with human supervision (supervised, unsupervised,
semi-supervised, and reinforcement learning)
○ Whether or not they can learn incrementally on the fly (online versus batch learning)
○ Whether they work by simply comparing new data points to known data points, or
instead detect patterns in the training data and build a predictive model, much like
scientists do (instance-based versus model-based learning)
Types of Machine Learning
Types of Machine Learning
Machine Learning systems can be classified according to the amount and type
of supervision they get during training.
Supervised Learning
Supervised Learning
● The training data you feed to the
algorithm includes the desired solutions,
called labels
● Mathematically
○ Learning a function that maps input 𝑋 to output 𝑌, where labels are provided.
● Use cases
○ Spam detection (classification), house price prediction (regression).
Supervised Learning
Supervised Learning
● Classification
○ predictive model that approximates a
mapping function from input variables to
identify discrete output variables
■ labels or categories
○ A classification algorithm can have both discrete and real-valued variables, but it
requires that the examples be classified into one of two or more classes.
Supervised Learning
Supervised Learning
● Regression
○ predict a continuous value based on the
input variables.
○ The main goal of regression problems is to estimate a mapping function based on the
input and output variables.
○ If your target variable is a quantity like income, scores, height or weight, or the
probability of a binary category (like the probability of rain in particular regions), then
you should use the regression model.
● Overlap
○ A regression algorithm can predict a discrete value which is in the form of an integer
quantity
● Linear Regression
● Logistic Regression
● Neural networks
Unsupervised Learning
● As you might guess, the training data is
unlabeled. The system tries to learn without
a teacher.
● Mathematically
○ Learning patterns in the data without any labels by either minimizing or maximizing the
objective function.
● Use cases
○ Customer segmentation, anomaly detection.
Unsupervised Learning
● Clustering
○ The goal is to find natural groups or clusters
in a feature space and interpret the input data.
○ To divide the data points in a way that each data point falls into a group that is similar
to other data points in the same group based on a predefined similarity or distance
metric in the feature space.
○ Ex: Google Photos-you upload all your family photos, it automatically recognizes that
the same person A shows up in photos 1, 5, and 11, while another person B shows up in
photos 2, 5, and 7.
■ This is the unsupervised part of the algorithm (clustering).
○ Now all the system needs is for you to tell it who these people are.
■ Just one label per person, and it is able to name everyone in every photo, which is
useful for searching photos.
Unsupervised Learning
● The learning system—called an agent
in this context
○ can observe the environment,
○ select and perform actions, and
○ get rewards in return
○ or penalties in the form of negative
rewards.
○ A policy defines what action the agent should choose when it is in a given situation.
ML PIPELINE
ML Pipeline
ML Pipeline
ML Pipeline
ML Pipeline
ML Pipeline
● A real estate company wants to predict house prices based on various
factors. They use a machine learning model to help estimate the price of a
house based on its features.
○ Features: These are the characteristics or input variables of each house that are used
to predict the price.
■ Ex: Square footage, number of bedrooms, and age of the house.
○ Labels: This is the target value the model is trying to predict, which in this case is the
house price.
■ Ex: The actual sale price of the house, like $350,000.
ML Pipeline: Predicting House Prices
● A real estate company wants to predict house prices based on various
factors. They use a machine learning model to help estimate the price of a
house based on its features.
○ Training: The process model learns from historical data, where both the features
(house characteristics) and labels (house prices) are known.
■ The company uses past house sales data to train the model so it can learn the
relationship between features and the house price.
ML Pipeline: Predicting House Prices
● A real estate company wants to predict house prices based on various
factors. They use a machine learning model to help estimate the price of a
house based on its features.
○ Testing: The model is tested on unseen data to check how accurately it predicts house
prices for new examples.
■ The model is tested on new houses, where it predicts the price, and the
predictions are compared with the actual prices.
ML Pipeline: Predicting House Prices
● A real estate company wants to predict house prices based on various
factors. They use a machine learning model to help estimate the price of a
house based on its features.
○ Evaluation Metrics: These are measures used to assess how well the model performs.
■ Ex: Mean Squared Error (MSE) can measure how far the predicted house prices
are from the actual prices. Lower error indicates better accuracy.
Challenges in ML
Data Challenges in ML
The two things that can go wrong are “bad algorithm” and “bad data.” Let’s
start with examples of bad data.
Questions?
THANK YOU