0% found this document useful (0 votes)
12 views49 pages

Machine Learning Intro & Evaluation Metrics

The document provides an overview of a Machine Learning course, detailing its fundamental concepts, techniques, and applications. It covers topics such as supervised and unsupervised learning, model evaluation, and various algorithms like regression, clustering, and ensemble methods. The document also discusses the importance of data preprocessing and evaluation metrics in machine learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views49 pages

Machine Learning Intro & Evaluation Metrics

The document provides an overview of a Machine Learning course, detailing its fundamental concepts, techniques, and applications. It covers topics such as supervised and unsupervised learning, model evaluation, and various algorithms like regression, clustering, and ensemble methods. The document also discusses the importance of data preprocessing and evaluation metrics in machine learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

MACHINE

LEARNING
2

COURSE OVERVIEW
Machine learning is a branch of computer science that uses algorithms to imitate the way in
which humans learn. It uses statistical methods to train algorithms and make predictions. The
accuracy of these predictions improves over time.
This course covers the basic concepts and techniques of Machine Learning from both theoretical
and practical perspective
Introduction to Artificial Intelligence and Machine Learning
Data Prepossessing: TOPICS
• Feature Scaling.
• Missing Data.
• Dummy Variable.
• Imbalanced Data.
Feature Engineering.
• Backward Elimination.
• Forward Elimination.
• Model Validation
Supervised Learning:
• Linear Regression.
• Logistic Regression.
• Naive Bays.
• Regression and Classification Metrics, Confusion Matrix, ROC and AUC.
Ensemble Learning
• Decision Tree.
• Random Forest.
• Gradient Boost, XG Boost and LGBM
Unsupervised learning
• K-means Clustering.
• Hieratical Clustering.
• Gaussian Mixture Model GMM.
• Principal Component Analysis PCA.
4

DEFINITION
• Arthur Samuel (1959). Machine Learning: Field of
study that gives computers the ability to learn
without being explicitly programmed.

• Tom Mitchell (1998). Well-posed Learning


Problem: A computer program is said to learn
from experience E with respect to some task T
and some performance measure P, if its
performance on T, as measured by P, improves
with experience E.
5

WHY ?
• Flood of available data (especially with the advent of the Internet) “2.5
quintillion / day (10^30)”
• Increasing computational power
• Growing progress in available algorithms and theory developed by
researchers
• Increasing support from industries
6

HOW ?
E.g. Spam mails program

T >> Classifying Emails as Spam or not

E>> Watching you label emails as spam or not spam

P>> Number of emails correctly classified as Spam / Not Spam


7

GOOGLE – ‘MACHINES THAT


DREAM’
8

WHAT IS MACHINE LEARNING?

Experience
=
Data
9
10

SUPERVISED LEARNING
• Classification and Regression is seen as supervised learning from examples.

• Supervision: The data (observations, measurements, etc.) are labeled with pre-
defined classes. It is like that a “teacher” gives the classes (supervision).

• Test data are classified into these classes too (in case of Classification).
11

THE LEARNING PROCESS


12

DATA SET
13

MODEL LEARNING
14

MODEL TESTING

Cross Classifier
Validation & Classification Model Evaluation
Testing Set
15

PREDICTION / REGRESSION
16

QUESTION

➢ We have a hospital application for the suspects of a cancer, they get the
data of the hospital and contains many features and attributes, to have an
efficient system to decide whether the tumor is malignant or benign. What
would be the type of the problem?

➢ We have a hyper market which contains many types of products,


according to the data of the market we want to know how the profits of
the market for the next month. What would be the type of the problem?
17

UNSUPERVISED LEARNING
• given the data can you derive a certain group / cluster ?
18

UNSUPERVISED LEARNING
• studies how systems can learn to represent particular input patterns in a way
that reflects the statistical structure of the overall collection of input patterns.
• It is likely to be much more common in the brain than supervised learning.
• Examples:
• Clustering.
• Blind signal separation.
• Self- organising maps
• Etc.
19

SOCIAL NETWORK ANALYSIS


20

REINFORCEMENT LEARNING
• Learning from interaction with an environment to achieve some long-term
goal that is related to the state of the environment
• The goal is defined by reward signal, which must be maximized
• Agent must be able to partially/fully sense the environment state and take
actions to influence the environment state
• The state is typically described with a feature-vector
21

Model Evaluation and Validation


• How well is my model doing?

• is this model good or not?

• How do we improve it based on these metrics?


22
23
24

Evaluation Metrics
25
26

Media Source: Udacity


27
28
29

ACCURACY

Out of all the patients , how many did we classify correctly ?


30

When accuracy won't work

Can you help me think of a model that has over 99


percent accuracy?
31

QUESTION 1 OF 2
In the medical example, what is worse, a False
Positive, or a False Negative?
False Negative
32

QUESTION 2 OF 2
In the spam detector example, what is
worse, a False Positive, or a False
Negative?
False positive
33
34
35
36
37

F1 SCORE
Y

Precision = 1 Precision = 0.2


Recall = 0 Recall = 0.8
Arithmetic Average = 0.5 Average = 0.5
X+Y /2
Mean = Harmonic Mean = 0 Harmonic Mean = 0.32

Harmonic
2XY Arithmetic Mean(Precision , Recall)
Mean =
/X+Y
F1 score = Harmonic Mean(Precision , Recall)
X
38
39

F-BETA SCORE

• F0.5-Measure (beta=0.5): More weight on precision, less weight on recall.


• F1-Measure (beta=1.0): Balance the weight on precision and recall.
• F2-Measure (beta=2.0): Less weight on precision, more weight on recall

beta = 1.0
Precision Recall
beta = 0.5 F1 Score beta = 2
40
41
42

RECEIVER OPERATING CHARACTERISTIC


CURVE (ROC)

is a graph showing the performance of a classification model at all classification


thresholds. This curve plots two parameters:
• True Positive Rate
• False Positive Rate
43

RECEIVER OPERATING CHARACTERISTIC CURVE (ROC)

True Positive Rate (TPR) is a synonym for recall and is therefore defined as follows:

Sensitivit
y
False Positive Rate (FPR) is defined as follows:

Specificit
y
44

RECEIVER OPERATING CHARACTERISTIC CURVE (ROC)


45

RECEIVER OPERATING CHARACTERISTIC CURVE (ROC)


46

RECEIVER OPERATING CHARACTERISTIC CURVE (ROC)


47

Which one is better?

AUC ROC-curve A = 0.75


AUC ROC-curve B = 0.78
48

Q&A

Questions and answers


49

Any Questions?

You might also like