0% found this document useful (0 votes)
2 views

Week 6 - Lecture 11-1

The document outlines an introduction to Machine Learning, covering its definition, importance, and types, including supervised and unsupervised learning. It details the life cycle of data science, focusing on modeling and validation processes, and explains various machine learning tasks such as classification, regression, and clustering. Additionally, it provides a framework for supervised machine learning and suggests recommended reading for further study.

Uploaded by

Saif Mohammad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Week 6 - Lecture 11-1

The document outlines an introduction to Machine Learning, covering its definition, importance, and types, including supervised and unsupervised learning. It details the life cycle of data science, focusing on modeling and validation processes, and explains various machine learning tasks such as classification, regression, and clustering. Additionally, it provides a framework for supervised machine learning and suggests recommended reading for further study.

Uploaded by

Saif Mohammad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Introduction to

Machine Learning
Week 6 - Lecture 11
COSC 202 Data Science and AI

Menatalla Abououf
Fall 2024
Outline – Week 6
• Introduction to Machine Learning
1. What is Machine Learning?
2. Why Machine learning?
3. What is a Model?
• Types of Machine Learning
• Types of supervised Machine learning and Its framework
• Linear Regression
• Understanding model parameters
• Train-test split
• Evaluating regression models

2
Life Cycle of Data Science
Problem Statement What Problem are we trying to solve?

Data Collection What data do we need to solve our problem?

Data Cleaning How should we clean or our data so our model can use it?

Exploratory Data Analysis What insights can we gain from the data?

Data Transformation How to prepare data so our model can use it?

Modeling Build a model to solve our problem?

Validation Did we solve the problem?

Decision Making & Deployment Communicate to stakeholders or put into production?

3
Life Cycle of Data Science – Modeling &
Validation
1. Selecting Appropriate Machine Learning Model
2. Splitting Data
3. Model Training
4. Model Validation
5. Model Evaluation
6. Final Model Selection

4
What is Machine Learning (ML)?
“A computational method that is a subfield of artificial
intelligence and that enables a computer to learn to perform tasks
by analyzing a large dataset without being explicitly programmed”

Traditional Approach ML Approach


5
https://www.merriam-webster.com/dictionary/machine%20learning
Why Machine Learning (ML)?
• Writing rules for complex problems might be impossible.
• ML can learn to find patterns and predict values.

Classify

Cluster

Predict

6
Do you want to
predict a
category?
That’s
Classification

Example:
Classify the
picture

7
Do you want to
discover
structure in
unexplored data?
That’s Clustering

Example:
Cluster the
following

Model

8
Do you want to
predict a value?
That’s
Regression

Example:
predict the
salary of an
employee with 8 8 years
years Experience
experience.

9
Exercise:

For each of the following tasks, classify it as either "Classification,"


"Clustering," or "Regression " :

1. Predicting tomorrow’s temperature.

2. Grouping documents into different categories based on the topic of each


document.

3. Identifying hand-written digits in images correctly.

4. Predicting an apartment rent using the location and the number of rooms.

10
What is a Model?

11
What is a Model?
• ML can perform a task by being 'trained' with a large dataset.
• During training, an algorithm is optimized to find certain patterns or outputs
from the dataset, depending on the task.
• The output of this process is called a machine learning model.
Input AI Model (Algorithm) Output

Predictions/
Data Classification/Cl
ustering

Data Preparation phase Training phase Performance Evaluation Phase


12
https://www.databricks.com/glossary/machine-learning-models#:~:text=During%20training%2C%20the%20machine%20learning,called%20a%20machine%20learning%20model.
Outline – Week 6
• Introduction to Machine Learning
1. What is Machine Learning?
2. Why Machine learning?
3. What is a Model?
• Types of Machine Learning
• Types of Supervised ML
1. Classification
2. Regression
• Types of Unsupervised ML
1. Clustering

13
Types of Machine Learning

14
Supervised Learning
• Supervised learning is a machine learning approach that’s defined by its use
of labeled data sets.
• These data sets are designed to train or “supervise” algorithms into
classifying data or predicting outcomes accurately.

15
Unsupervised Learning
• Unsupervised learning uses machine learning algorithms to analyze and
cluster unlabeled data sets.
• These algorithms discover hidden patterns in data without the need for
human intervention (hence, they are “unsupervised”).

16
Supervised vs Unsupervised Learning

Comparison Supervised Learning Unsupervised Learning

Data Labeling Input data is labeled Input data is unlabeled


How Data is Data is classified based Assigns properties of
classified/clustered on the training dataset given data to cluster it

Number of classes A known number of An unknown number of


classes classes

Purpose Used for prediction Used for analysis

17
Supervised vs unsupervised learning: Which
is best for you?
You need to:
1- Define your goals Starting point
2- Evaluate your input data
3- Review your options for Algorithms

18
Reinforcement learning
• Reinforcement learning (RL) is a machine
learning (ML) technique that trains software
to make decisions to achieve the most
optimal results.

• The learning process of RL algorithms is


similar to human reinforcement learning in
the field of behavioral psychology.

• Learning optimal behaviors through trial-


and-error interactions with an environment

19
Reinforcement learning - Example
Example: Recommendation System

E-Commerce Social media/News/Ads


20
Types of Machine Learning
In this course, we will focus on Supervised and Unsupervised learning. We will
discuss different concepts using the following models:

Machine
Learning

Supervised Unsupervised

Regression • Linear Regression


• K-means
• Decision Tree Clustering
Classification & regression
• Random Forest

21
Linear Regression

Recall - Supervised Learning


• Uses labelled data sets.
• The labeled data “supervise” algorithms into
classifying data or predicting outcomes.

• Supervised learning can be separated into


two types of problems:
Decision Tree
1. Regression: Predict a quantitative value
2. Classification: Predict a category

22
Classification vs Regression : Which is best
for you? Starting point

You need to:


1- Define your goals
2- Evaluate your input data

23
Supervised ML Framework
• A supervised ML framework estimates a relationship between the features
and the label.
𝑦𝑝 = 𝑓 Ω, 𝑥
• 𝑥 → Input
• Ω → the fit parameters which involves the aspects of the model being
estimated (fitted) using the data
• 𝑦p → Output (values predicted by the model)
• 𝑓 . → Prediction function (model) that generates predictions from the input
𝑥 and the learned parameters Ω

24
Supervised ML Framework
• Data scientists will train the model to find the best parameters by looking at
past data.
• Each observation X is going to relate to some outcome variable (label) y.
• The more of these values we have the better the machine learning model can
learn the parameters

x x x x

y y y y
25
Supervised ML Framework
• New observations are fed into the model with its learnt parameters (Ω) from
the training set to predict the output (𝑦𝑝 ).
• A model should generalize when new data comes in → we train on just a
subset of our old data and evaluate on a holdout set that hasn't been trained
to see how it'll perform in the real world.
• The model is evaluated by comparing the closeness of 𝑦 and 𝑦𝑝 .

x x x x x x x x

𝑦𝑝 = 𝑓 Ω, 𝑥

y y y y 𝑦𝑝 𝑦𝑝 𝑦𝑝 𝑦𝑝 26
Supervised ML Framework - Summary

fit
Labeled data + Model Fitted model

predict
unlabeled data + Fitted model Predicted label

27
Recommended Reading
• Artificial Intelligence with Python, by Alberto Artasanchez and Prateek Joshi.
Publisher: Packt Publishing Ltd, 2nd Edition, 2020. ISBN-10: 183921953X.
ISBN-13: 978-1839219535. - Pages 93 – 95 and page 117

28

You might also like