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

Intro ML

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)
4 views

Intro ML

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/ 45

Introduction to

Machine
Learning

BMSCE - ME
MCL - Python | PA G E 1
BMSCE - ME
MCL - Python
| PA G E 2
BMSCE - ME
MCL - Python
| PA G E 3
BMSCE - ME
MCL - Python
| PA G E 4
Yeoh PSQ, Lai KW, Goh SL, Hasikin K, Hum YC, Tee YK, Dhanalakshmi S. Emergence of Deep Learning in
Knee Osteoarthritis Diagnosis. Comput Intell Neurosci. 2021 Nov 10;2021:4931437. doi:
10.1155/2021/4931437. PMID: 34804143; PMCID: PMC8598325. BMSCE - ME
MCL - Python
| PA G E 5
Machine Learning Definition

• Arthur Samuel (1959). Machine Learning: Field of study that


gives computers the ability to learn without being explicitly
programmed.

BMSCE - ME
MCL - Python
| PA G E 6
Machine Learning Definition

• 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.

BMSCE - ME
MCL - Python
| PA G E 7
Machine Learning Definition

Suppose your email program watches which emails you do or


do not mark as spam, and based on that learns how to better
filter spam.
• Task T: Classifying emails as spam or not spam.

• Experience E: Watching you label emails as spam or not spam.

• Performance P: The number (or fraction) of emails correctly classified


as spam/not spam.
BMSCE - ME
MCL - Python
| PA G E 8
Machine Learning Definition
• A checkers learning problem:
• Task T: playing checkers
• Performance measure P: percent of games won against opponents
• Training experience E: playing practice games against itself
• A handwriting recognition learning problem:
• Task T: recognizing and classifying handwritten words within images
• Performance measure P: percent of words correctly classified
• Training experience E: a database of handwritten words with given
classification
• A robot driving learning problem:
• Task T: driving on public 4-lane highways using vision sensors
• Performance measure P: Average distance travelled before an error
• Training experience E: a sequence of images and steering commands
recorded while observing a human driver BMSCE - ME
MCL - Python
| PA G E 9
Data and
Data Types

DSU - ME
BMSCE
AI&ML
MCL - Python
| PA G E 10
Data types..

• Continuous data
▪ Variable that has infinite possible values
▪ Ex : Distance, Speed, Age

• Discrete/Categorical data
▪ Variable that has finite possible values
▪ Ex : Gender, Country, Class

BMSCE - ME
MCL - Python
| PA G E 11
Algorithm
Types

DSU - ME
BMSCE
AI&ML
MCL - Python
| PA G E 12
Machine Learning Algorithms
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
• Rrecommender Systems

BMSCE - ME
MCL - Python
| PA G E 13
Super vised
Learning

DSU - ME
BMSCE
AI&ML
MCL - Python
| PA G E 14
Area vs Price (Basavanagudi houses)
Housing Price Prediction
900

800

700

600
PRICE (INRs 1000)

500

400

300

200

100

0
400 600 800 1000 1200 1400 1600 1800 2000 2200
1300

AREA ( Sq Ft)
What might be the price of a house with 1300 Sq. ft area ?
What might be the price of a house with 2200 Sq. ft?
Supervised Learning: “right answers” given
Regression: Predict continuous valued output| PA G E 15
(price) BMSCE - ME
MCL - Python
Average Temperature in Bengaluru
27.5

27

26.5

26

25.5

25

24.5

24
1970 1975 1980 1985 1990 1995 2000 2005 2010 2015 2020

What would be the average temperature in Bengaluru in 2020 ?

BMSCE - ME
MCL - Python
| PA G E 16
REGRESSION
• Technique for predicting : Continuous Targets
• Curve fitting
• 𝑇𝑎𝑟𝑔𝑒𝑡 ~ 𝑓 𝑓𝑒𝑎𝑡𝑢𝑟𝑒𝑠 : Target ~ m * Feature + C
• Algorithms :
• Simple Linear Regression
• Multiple Linear Regression
• Polynomial Regression
• Ridge, Lasso, Piecewise Regression
• SVM, CARTs, Random Forest

BMSCE - ME
MCL - Python | PA G E 17
REGRESSION

• Predict house price based on area of the house

• Predict house price based on area, number of rooms and


locality of the house

• Predict mileage of vehicle based on engine displacement

BMSCE - ME
MCL - Python | PA G E 18
Breast Cancer (malignant,benign)

Classification:
Discrete valued output
(0 or 1)

BMSCE - ME
MCL - Python
| PA G E 19
Breast Cancer (malignant,benign)

• Clump thickness
• Uniformity of cell size
• Uniformity of cell shape
•…

BMSCE - ME
MCL - Python
| PA G E 20
CLASSIFICATION
• Technique for predicting : Discrete Targets (classes)
• Decision Boundaries
• Algorithms :
• Logistic Regression
• Support Vector Machines
• Decision Trees
• Random Forest
• Artificial Neural Networks
• Boosting, KNN, LDA, QDA etc

BMSCE - ME
MCL - Python | PA G E 23
CLASSIFICATION

• Predict spam emails based on email features

• Predict breast cancer (malignant or benign) based on


various test results

• Predict face in a photograph based on pixels intensity

BMSCE - ME
MCL - Python | PA G E 24
Supervised Learning

BMSCE - ME
MCL - Python
| PA G E 25
Unsupervised Learning

BMSCE - ME
MCL - Python
| PA G E 26
Can you group these items ?

BMSCE - ME
MCL - Python
| PA G E 27
Unsupervised Learning

BMSCE - ME
MCL - Python
| PA G E 28
Unsupervised Learning

Market Segmentation Social Network Analysis

BMSCE - ME
MCL - Python
| PA G E 29
CLUSTERING

• Technique for predicting : Groups (not exact labels)


• Based on similarity and dissimilarity of data points
• Algorithms :
• Hierarchical Clustering
• K-means clustering
• DB Scan
• Spectral Clustering

BMSCE - ME
MCL - Python | PA G E 30
CLUSTERING

• Group news articles based on similar words in google news

• Optimum placement of security forces, amenities in smart


cities

• Detect various regions of a brain from a MRI image

BMSCE - ME
MCL - Python | PA G E 31
Features, Targets and Model
• Features (Independent variables)
• Type of movie / Genre
• Budget of the movie
• Hero/Heroine
• Music director
• Pace and length of the movie
• Awards won by the movie
• Target (Dependent variables)
• Who is the director of the movie
• Model
• Algorithm that takes features and gives target

BMSCE - ME
MCL - Python | PA G E 32
Training

• Who is this ?

• And this ?

BMSCE - ME
MCL - Python
| PA G E 33
Training

Mithali Raj Harmanpreet Kaur Veda Krishnamurthy

BMSCE - ME
MCL - Python
| PA G E 34
Training

• Who is this ?

• And this ?

BMSCE - ME
MCL - Python
| PA G E 35
Data set
age work_class education_num race gender hours_per_week country Salary (in $)
39 State-gov 13 White Male 40 United-States 40227
50 Self-emp-not-inc 13 White Male 13 United-States 28759
38 Private 9 White Male 40 United-States 41933
53 Private 7 Black Male 40 United-States 41763
28 Private 13 Black Female 40 Cuba 34185
37 Private 14 White Female 40 United-States 45563
49 Private 5 Black Female 16 Jamaica 48308
52 Self-emp-not-inc 9 White Male 45 United-States 44831
31 Private 14 White Female 50 United-States 31312
42 Private 13 White Male 40 United-States 34395
37 Private 10 Black Male 80 United-States 21073
30 State-gov 13 Asian-Pac-Islander Male 40 India 40924
23 Private 13 White Female 30 United-States 42108
32 Private 12 Black Male 50 United-States 49058
40 Private 11 Asian-Pac-Islander Male 40 ? 45885
34 Private 4 Amer-Indian-Eskimo Male 45 Mexico 43478
25 Self-emp-not-inc 9 White Male 35 United-States 30762

BMSCE - ME
MCL - Python
| PA G E 36
Data set
age work_class education_num race gender hours_per_week country Salary
39 State-gov 13 White Male 40 United-States <=50K
50 Self-emp-not-inc 13 White Male 13 United-States <=50K
38 Private 9 White Male 40 United-States <=50K
53 Private 7 Black Male 40 United-States <=50K
28 Private 13 Black Female 40 Cuba <=50K
37 Private 14 White Female 40 United-States <=50K
49 Private 5 Black Female 16 Jamaica <=50K
52 Self-emp-not-inc 9 White Male 45 United-States >50K
31 Private 14 White Female 50 United-States >50K
42 Private 13 White Male 40 United-States >50K
37 Private 10 Black Male 80 United-States >50K
30 State-gov 13 Asian-Pac-Islander Male 40 India >50K
23 Private 13 White Female 30 United-States <=50K
32 Private 12 Black Male 50 United-States <=50K
40 Private 11 Asian-Pac-Islander Male 40 ? >50K
34 Private 4 Amer-Indian-Eskimo Male 45 Mexico <=50K
25 Self-emp-not-inc 9 White Male 35 United-States <=50K

BMSCE - ME
MCL - Python
| PA G E 37
TYPES OF MACHINE LEARNING
SUPERVISED LEARNING UNSUPERVISED LEARNING
• Known outcome • Unknown outcome
• Examples • Examples
• Regression • Clustering
• Classification • PCA, SVD
• Algorithms • Algorithms
• Simple Linear Regression • K-means clustering
• Logistic Regression • Hierarchical clustering
• Neural Networks • DBScan
• Principal Component Analysis

BMSCE - ME
MCL - Python
| PA G E 38
Where do we use Data
Science ??
AI Programming / Input
Machine Learning

Program

Output

Input Program Output

Regular Programming

BMSCE - ME
MCL - Python
| PA G E 40
Machine Learning Process

BMSCE - ME
MCL - Python
| PA G E 41
Steps involved in a Machine Learning Project ?

Model
Planning
Data Data Model
Data Cleanup through Validation Productization
Collection Preparation Building
Visualization
/ Statistics

BMSCE - ME
MCL - Python
| PA G E 42
What is
Ar tificial
Intelligence ?

BMSCE - ME
MCL - Python | PA G E 43
Artificial Intelligence (Machine Intelligence)
• Anything that is Artificially Intelligent
➢ AI toy car that changes direction using sensors
AI
➢ AI based electronic devices

➢ AI system that predicts tomorrow’s temperature in Bengaluru

➢ AI system that predicts a fraud credit card transaction

➢ Alexa which takes decisions based on your voice commands

➢ AI based disease prediction using a MRI scan image

➢ AI based self driving cars

BMSCE - ME
MCL - Python
| PA G E 44
Artificial Intelligence (Machine Intelligence)
• Anything that is Artificially Intelligent
➢ AI toy car that changes direction using sensors
AI
➢ AI based electronic devices

➢ AI system that predicts tomorrow’s temperature in Bengaluru


ML
➢ AI system that predicts a fraud credit card transaction

➢ Alexa which takes decisions based on your voice commands

➢ AI based disease prediction using a MRI scan image

➢ AI based self driving cars

BMSCE - ME
MCL - Python
| PA G E 45
Artificial Intelligence (Machine Intelligence)
• Anything that is Artificially Intelligent
➢ AI toy car that changes direction using sensors
AI
➢ AI based electronic devices

➢ AI system that predicts tomorrow’s temperature in Bengaluru


ML
➢ AI system that predicts a fraud credit card transaction

➢ Alexa which takes decisions based on your voice commands DL

➢ AI based disease prediction using a MRI scan image

➢ AI based self driving cars

BMSCE - ME
MCL - Python
| PA G E 46
https://medium.com/edureka/ai-vs-machine-learning-vs-deep-learning-1725e8b30b2e

BMSCE - ME
MCL - Python
| PA G E 47

You might also like