Download as pdf or txt
Download as pdf or txt
You are on page 1of 168

COLLEGE OF TECHNOLOGY – UNIVERSITY OF BUEA

CEC435

Course: Machine Learning

Aurelle TCHAGNA, PhD, Eng


Sr. Data Scientist
Objectives
• To be able to formulate machine learning problems corresponding to different applications. To
understand a range of machine learning algorithms along with their strengths and weaknesses.
To be able to apply machine learning algorithms to solve problems of moderate complexity
Course Description
• This course will provide an understanding of machine learning models (logistic regression, decision trees, K-
Means, SVM, etc.) as well as demonstrate how these models can solve complex problems in a variety of
industries, from medical diagnostics to image recognition to market prediction. In addition, we have designed
practice exercises that will give the students hands-on experience implementing these machine learning models
on data sets. These practice exercises will teach students how to implement machine learning algorithms. This
course will also prepare students for research or industry application of machine learning techniques.
• We explore many algorithms and models:
• • Popular algorithms: Regression, Classification, Clustering and Reinforcement
• • Popular models: Train/Test Split, Gradient Descent, and Mean Squared Error
Outcomes:
• By the end of the course, students should be able to:
• Develop an appreciation for what is involved in learning models
from data.
• Understand a wide variety of learning algorithms.
• Understand how to evaluate models generated from data.
• Apply the algorithms to a real-world problem, optimize the
models learned and report on the expected accuracy that can be
achieved by applying the models.
Overview of ML

3
Overview and history of ML/ DL

Machine learning is a type of artificial intelligence (AI) that provides


computers with the ability to learn without being explicitly programed.

Arthur Samuel
Computer

program:
Inputs
{ Calculation Output
X= 0
Y= 1 f(X,Y,Z)=2X+Y+8Z f(X,Y,Z)= 17
Z= 2 return f(X,Y,Z)
}

4
Overview of ML
Can all our problems be solved by calculations?

Inputs program:
{
f(photo)=????? ‘’chat’’
}

Can machine do what we do?


Can Machine thinks?
Alan Turing

5
Overview of ML
Learn with time and experience

Experience
E
Learning Algorithms

✓ Supervised Learning
Performance Task ✓ Unsupervised Learning
P
T
✓ Reinforcement Learning

Tom Mitchell
in 1998 5
Learning Algorithms
Supervised Learning
random calculation T: f(x)=x

New model of f(x)


output f(x)
100 F Measure Modify f(x) to
Input x Error Error minimize the
100 m2 Calculation between Y 299900 F Error
and f(x)

X=100 m2
Y=300000 F
Training phase

Classification Regression
Discrete variable Continue variable
finite number of values Infinite number of values
7
Learning Algorithms
Unsupervised Learning
Chien

Chien Chien

Chat
Chat Chat

Labelled Dataset Unlabelled Dataset


Supervised Learning similarities or differences Unsupervised Learning

Group A Group B

K-Means Clustering

8
Learning Algorithms
Reinforcement Learning
which actions to choose
to maximize my
rewards?
Association
State/ reward
Actions

Agent

Modify Reinforcement Learning Perform


state an action

Environment
9
Intro to Machine Learning
Is this a benign or malignant cell?
Is this a benign or malignant cell?
Machine learning helps with predictions!
Machine learning helps with predictions!
Machine learning helps with predictions!
Machine learning helps with predictions!
What is machine learning?
How machine learning works?
How machine learning works?
How machine learning works?
How machine learning works?
Examples of machine learning
Examples of machine learning
Examples of machine learning
Examples of machine learning
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Major machine learning techniques
Let’s get started with machine learning!
PYTHON FOR MACHINE LEARNING
PYTHON FOR MACHINE LEARNING
PYTHON FOR MACHINE LEARNING
PYTHON FOR MACHINE LEARNING
PYTHON FOR MACHINE LEARNING
PYTHON FOR MACHINE LEARNING
Supervised vs Unsupervised
What is supervised learning?
What is supervised learning?
What is supervised learning?
What is supervised learning?
Teaching the model with labeled data
Teaching the model with labeled data
Teaching the model with labeled data
Teaching the model with labeled data
Teaching the model with labeled data
Types of supervised learning
What is classification?
What is regression?
What is unsupervised learning?
What is unsupervised learning?
What is unsupervised learning?
What is unsupervised learning?
What is unsupervised learning?
What is unsupervised learning?
What is unsupervised learning?
What is unsupervised learning?
What is clustering?
What is clustering?
Supervised vs unsupervised learning
Supervised vs unsupervised learning
Supervised vs unsupervised learning
Supervised vs unsupervised learning
Support Vector Machine (SVM)
Classification with SVM
Classification with SVM
Classification with SVM
Classification with SVM
What is SVM?
What is SVM?
What is SVM?
What is SVM?
What is SVM?
What is SVM?
Data transformation
Data transformation
Data transformation
Data transformation
Data transformation
Data transformation
Usinng SVM to find the hyperplane
Usinng SVM to find the hyperplane
Usinng SVM to find the hyperplane
Usinng SVM to find the hyperplane
Usinng SVM to find the hyperplane
Usinng SVM to find the hyperplane
Pros and cons of SVM
SVM applications
INTRO TO CLUSTERING
Ch. 16

What is clustering?
• Clustering: the process of grouping a set of objects into classes of
similar objects
• Documents within a cluster should be similar.
• Documents from different clusters should be dissimilar.
• The commonest form of unsupervised learning
• Unsupervised learning = learning from raw data, as opposed to
supervised data where a classification of examples is given
• A common and important task that finds many applications in IR and other
places
Why cluster?
• Labeling is expensive
• Gain insight into the structure of the data
• Find prototypes in the data
Goal of Clustering
• Given a set of data points, each described by a set
of attributes, find clusters such that:

• Inter-cluster similarity is F1 x
maximized x x
x xx xx
xx
xxxx
• Intra-cluster similarity is x
x xx x
minimized

F2
• Requires the definition of a similarity measure
What is a natural grouping of these objects?
What is a natural grouping of these objects?

Clustering is subjective

Simpson's Family School Employees Females Males


What is Similarity?

Similarity is
hard to define,
but…
“We know it
when we see it”
Defining Distance Measures
Definition: Let O1 and O2 be two objects from the universe of
possible objects. The distance (dissimilarity) between O1 and
O2 is a real number denoted by D(O1,O2)

Peter Piotr

0.23 3 342.7
Two Types of Clustering
• Partitional algorithms: Construct various partitions and
then evaluate them by some criterion
• Hierarchical algorithms: Create a hierarchical
decomposition of the set of objects using some criterion

Hierarchical Partitional
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
INTRO TO CLUSTERING
What is K-Means clustering?
k-Means algorithms
k-Means algorithms
Determine the similarity or dissimilarity
Determine the similarity or dissimilarity
Determine the similarity or dissimilarity
1- dimensional similarity / distance
1- dimensional similarity / distance
1- dimensional similarity / distance
2- dimensional similarity / distance
2- dimensional similarity / distance
Multi-dimentiional similarity/distance
How does k-Means clustering work?
How does k-Means clustering work?
K-Means clustering – initialize k
K-Means clustering – initialize k
K-Means clustering – initialize k
K-Means clustering – initialize k
K-Means clustering – calculate the distance
K-Means clustering – calculate the distance
K-Means clustering – calculate the distance
K-Means clustering – assign to centroid
K-Means clustering – assign to centroid
K-Means clustering – assign to centroid
K-Means clustering – assign to centroid
K-Means clustering – assign to centroid
K-Means clustering – compute new centroids
K-Means clustering – compute new centroids
K-Means clustering – compute new centroids
K-Means clustering – repeat
K-Means clustering – repeat
K-Means clustering – repeat
K-Means clustering – repeat
K-Means clustering – repeat
K-Means clustering – repeat

You might also like