Intro ML
Intro ML
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
BMSCE - ME
MCL - Python
| PA G E 6
Machine Learning Definition
BMSCE - ME
MCL - Python
| PA G E 7
Machine Learning Definition
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
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
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
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
BMSCE - ME
MCL - Python
| PA G E 29
CLUSTERING
BMSCE - ME
MCL - Python | PA G E 30
CLUSTERING
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
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
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
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
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
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