SlideShare a Scribd company logo
Some Basics of
Machine Learning
Sidik Soleman
Prosa.ai
Email: sidik.soleman@prosa.ai
1. Machine Learning
2. Linear Regression
3. Logistic Regression
Agenda
2
3
1. Machine Learning
Machine Learning in Everyday Life
Search Engine
Machine Translation
Spelling Checker
Spam Detection
Chatbot
4
Definition of Artificial Intelligence (AI)
1. Acting Humanly
○ The turing test approach
○ Computer should to be able to do
■ Natural language processing
■ Knowledge representation
■ Automated reasoning
■ Machine learning (ML)
● To adapt to new circumstances and to detect and extrapolate patterns.
■ Computer vision
■ Robotics
5
Artificial Intelligence - A Modern Approach by Peter Norvig, Stuart J. Russell
Definition of Artificial Intelligent (AI)
2. Thinking Humanly
○ The cognitive approach
○ Understanding human brain by means
■ Introspection—trying to catch our own thoughts as they go by;
■ Psychological experiments—observing a person in action; and
■ Brain imaging—observing the brain in action
6
Artificial Intelligence - A Modern Approach by Peter Norvig, Stuart J. Russell
Definition of Artificial Intelligent (AI)
3. Thinking Rationally
○ The “law of thought” approach
○ Logic → correct inference
4. Acting Rationally
○ The rational agent approach
○ Act rationally is to reason logically to the conclusion and then to act on that.
○ But, correct inference is not all of rationality; in some situations, there is no
provably correct thing to do, but something must still be done
7
Artificial Intelligence - A Modern Approach by Peter Norvig, Stuart J. Russell
Machine Learning Paradigms
1. Supervised Learning
○ Learning based on experience/examples, e.g. classification task
8
Training Data
Machine (Model)
Input
Cat
Machine Learning Paradigms (Cont’d)
2. Unsupervised Learning
○ Finding hidden pattern from data, e.g. clustering task
9
Data
Machine (Model)
Output
Machine Learning Paradigms (Cont’d)
3. Reinforcement Learning
○ Learning based on the interaction with environment to achieve a goal, e.g. to win chess game
○ Decision will be rewarded or punished
10
Machine (Model)
Environmen
t
(action)
(state, reward)
Machine Learning Algorithms
11
Supervised Learning Unsupervised Learning
Reinforcement
Learning
- Linear Regression
- Logistic Regression
- Support Vector
Machine
- Decision Tree
- Random Forest
- Naive Bayes
- Deep Learning
- K-Means Clustering
- K-Nearest Neighbour
- Apriori Algorithm
- Principal Component
Analysis
- Latent Dirichlet
Allocation
- Deep Learning
- Temporal Difference
Learning
- Monte Carlo
- Q-learning
- Policy Gradients
- Deep Reinforcement
Learning
12
2.Linear Regression
Based on machine learning course in Coursera by Andrew Ng
https://www.coursera.org/learn/machine-learning
Linear Regression
● Predicting the price of house
13
What is the price of a 200m2 house?
Finding the best linear function
f(x) g(x)
h(x)
Linear Regression (Cont’d)
● Predicting the price of house
14
What is the price of a 200m2 house?
The best linear function
●
● Finding the best parameters
so that is close to y
General Setup
● m= # of training examples
● x = input variable/features
● y = output variable/target
● (x, y) = one training example
● (xi, yi) = i-th training example
h(x)
Linear Regression (Cont’d)
● Predicting the price of house
15
What is the price of a 200m2 house?
Finding the best parameter
h(x)
cost function
Gradient Descent: Cost Function Derivation
● Predicting the price of house
16
What is the price of a 200m2 house?
Finding the best parameter
h(x)
Repeat until convergence {
}
Simultaneous Update
Derivation Intuition
17
Positive Slope
Negative Slope
Derivation guide the direction of
should be adjusted.
α is the learning rate to control how big the
movement of
Gradient Descent Algorithm
● Predicting the price of house
18
What is the price of a 200m2 house?
Finding the best parameter
h(x)
Repeat until convergence {
}
Gradient Descent Algorithm
The Answer of the Prediction
● Predicting the price of house
19
What is the price of a 200m2 house?
h(x)
Multivariable Linear Regression
20
Previous linear regression function
●
Multivariable linear regression
● m= # of training examples
● x(i) = input variables/features of i-th
example
● y(i) = output variable of i-th example
● x(i)
j = value of feature j in i-th example
repeat {
}
Cost function
Gradient descent
21
3.Logistic Regression
Based on machine learning course in Coursera by Andrew Ng
https://www.coursera.org/learn/machine-learning
Classification Task
22
● Linear regression issues
○ Prediction score can be more or less than 1
○ Not suitable for classification task
● Solution: logistic regression
Parameter and x
as matrix
1
0.5
Score is also probability
Regression Model
23
Training Set
n parameter
Cost
repeat {
}
Gradient descent
Multi-class Classification
● Binary vs multi-class classification
● Handling multi-class classification
○ One vs Rest /One vs All
■ 4 Class Classification → 4 Classification Model
■ Label with maximum score is the answer
24
Machine Learning Problems
● Overfit
○ Hypothesis fit well with the training data → high performance
○ But fail to make generalization → poor performance on test data
○ High variance
○ Too many features
● Underfit
○ High bias → low performance
○ Fail to make generalization → poor performance on test data
25
Some solution for the problem
● Reduce number of features
○ Select features to keep
○ Model selection
● Regularization
○ Keep all features, but reduce magnitude or values of parameters (theta)
○ Works well when having a lot of features
26
Regularization
27
Regularization
Note:
Lambda high → underfit and high bias
Lambda too small → overfit
Take Home Message
● Machine learning is to adapt to new circumstances and to detect and
extrapolate patterns.
● Linear regression for predicting real continuous values
● Logistic regression for predicting class in classification
28

More Related Content

PPTX
Multi Agent Path Finding (MAPF)
PDF
Skiena algorithm 2007 lecture19 introduction to np complete
PDF
Algorithms - A Sneak Peek
PDF
Memory-based Reinforcement Learning
PDF
An introduction to deep reinforcement learning
PDF
Introduction to machine learning and applications (1)
PDF
How to easily find the optimal solution without exhaustive search using Genet...
PDF
A step towards machine learning at accionlabs
Multi Agent Path Finding (MAPF)
Skiena algorithm 2007 lecture19 introduction to np complete
Algorithms - A Sneak Peek
Memory-based Reinforcement Learning
An introduction to deep reinforcement learning
Introduction to machine learning and applications (1)
How to easily find the optimal solution without exhaustive search using Genet...
A step towards machine learning at accionlabs

Similar to Fundamental of Machine Learning (20)

PDF
Uncertainty Awareness in Integrating Machine Learning and Game Theory
PPTX
Introduction to Machine Learningg
PDF
Memory for Lean Reinforcement Learning.pdf
PDF
Artificial Intelligence - Anna Uni -v1.pdf
PDF
27332020002_PC-CS601_Robotics_Debjit Doira.pdf
PPTX
Unit - 1 - Introduction of the machine learning
ODP
Online advertising and large scale model fitting
PPTX
Reinforcement Learning
PDF
Reinforcement learning
PDF
Introduction of Deep Reinforcement Learning
PPTX
L15.pptx
PDF
General introduction to AI ML DL DS
PPTX
lecture15-neural-nets (2).pptx
PPTX
Jay Yagnik at AI Frontiers : A History Lesson on AI
PPTX
Keynote at IWLS 2017
PDF
Brief History and Overview of LLM Agents
PDF
Pycon 2012 Scikit-Learn
PDF
[Eestec] Machine Learning online seminar 1, 12 2016
PPTX
SKLearn Workshop.pptx
PPTX
Machine Learning in Finance
Uncertainty Awareness in Integrating Machine Learning and Game Theory
Introduction to Machine Learningg
Memory for Lean Reinforcement Learning.pdf
Artificial Intelligence - Anna Uni -v1.pdf
27332020002_PC-CS601_Robotics_Debjit Doira.pdf
Unit - 1 - Introduction of the machine learning
Online advertising and large scale model fitting
Reinforcement Learning
Reinforcement learning
Introduction of Deep Reinforcement Learning
L15.pptx
General introduction to AI ML DL DS
lecture15-neural-nets (2).pptx
Jay Yagnik at AI Frontiers : A History Lesson on AI
Keynote at IWLS 2017
Brief History and Overview of LLM Agents
Pycon 2012 Scikit-Learn
[Eestec] Machine Learning online seminar 1, 12 2016
SKLearn Workshop.pptx
Machine Learning in Finance
Ad

More from SARCCOM (20)

PDF
Week 3 Deep Learning And POS Tagging Hands-On
PDF
Week 2 Sentiment Analysis Using Machine Learning
PDF
Week 1 Natural Language Processing Introduction
PDF
The Secret of Most Wanted Geek
PDF
Data Warehousing Tools on Data Ecosystem
PDF
Startup Engineering Culture
PDF
Menggapai Paripurna Rekayasa
PPTX
Requirement Gathering Jump Start
PDF
Legacy code - Taming The Beast
PPTX
The Role of IT Architect in Enterprise Company (Garuda Indonesia)
PDF
The Role of IT Architect in Startup Company
PDF
Blibli Web Application Security Policy Enforcement Point
PDF
Implement OpenSAMM on blibli.com
PDF
Architecting for Huper Growth and Great Engineering Culture
PPTX
Software Architecture Introduction
PPTX
Software Architecture Fundamentals Part-1 Architecture soft skill
PDF
Telco Business & Technology
PDF
Best Practice In Software Development
PDF
The Evolution of Software for a Startup
PPTX
Is your code SOLID enough?
Week 3 Deep Learning And POS Tagging Hands-On
Week 2 Sentiment Analysis Using Machine Learning
Week 1 Natural Language Processing Introduction
The Secret of Most Wanted Geek
Data Warehousing Tools on Data Ecosystem
Startup Engineering Culture
Menggapai Paripurna Rekayasa
Requirement Gathering Jump Start
Legacy code - Taming The Beast
The Role of IT Architect in Enterprise Company (Garuda Indonesia)
The Role of IT Architect in Startup Company
Blibli Web Application Security Policy Enforcement Point
Implement OpenSAMM on blibli.com
Architecting for Huper Growth and Great Engineering Culture
Software Architecture Introduction
Software Architecture Fundamentals Part-1 Architecture soft skill
Telco Business & Technology
Best Practice In Software Development
The Evolution of Software for a Startup
Is your code SOLID enough?
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PDF
Modernizing your data center with Dell and AMD
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
Modernizing your data center with Dell and AMD
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
A Presentation on Artificial Intelligence
Encapsulation_ Review paper, used for researhc scholars
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Fundamental of Machine Learning

  • 1. Some Basics of Machine Learning Sidik Soleman Prosa.ai Email: sidik.soleman@prosa.ai
  • 2. 1. Machine Learning 2. Linear Regression 3. Logistic Regression Agenda 2
  • 4. Machine Learning in Everyday Life Search Engine Machine Translation Spelling Checker Spam Detection Chatbot 4
  • 5. Definition of Artificial Intelligence (AI) 1. Acting Humanly ○ The turing test approach ○ Computer should to be able to do ■ Natural language processing ■ Knowledge representation ■ Automated reasoning ■ Machine learning (ML) ● To adapt to new circumstances and to detect and extrapolate patterns. ■ Computer vision ■ Robotics 5 Artificial Intelligence - A Modern Approach by Peter Norvig, Stuart J. Russell
  • 6. Definition of Artificial Intelligent (AI) 2. Thinking Humanly ○ The cognitive approach ○ Understanding human brain by means ■ Introspection—trying to catch our own thoughts as they go by; ■ Psychological experiments—observing a person in action; and ■ Brain imaging—observing the brain in action 6 Artificial Intelligence - A Modern Approach by Peter Norvig, Stuart J. Russell
  • 7. Definition of Artificial Intelligent (AI) 3. Thinking Rationally ○ The “law of thought” approach ○ Logic → correct inference 4. Acting Rationally ○ The rational agent approach ○ Act rationally is to reason logically to the conclusion and then to act on that. ○ But, correct inference is not all of rationality; in some situations, there is no provably correct thing to do, but something must still be done 7 Artificial Intelligence - A Modern Approach by Peter Norvig, Stuart J. Russell
  • 8. Machine Learning Paradigms 1. Supervised Learning ○ Learning based on experience/examples, e.g. classification task 8 Training Data Machine (Model) Input Cat
  • 9. Machine Learning Paradigms (Cont’d) 2. Unsupervised Learning ○ Finding hidden pattern from data, e.g. clustering task 9 Data Machine (Model) Output
  • 10. Machine Learning Paradigms (Cont’d) 3. Reinforcement Learning ○ Learning based on the interaction with environment to achieve a goal, e.g. to win chess game ○ Decision will be rewarded or punished 10 Machine (Model) Environmen t (action) (state, reward)
  • 11. Machine Learning Algorithms 11 Supervised Learning Unsupervised Learning Reinforcement Learning - Linear Regression - Logistic Regression - Support Vector Machine - Decision Tree - Random Forest - Naive Bayes - Deep Learning - K-Means Clustering - K-Nearest Neighbour - Apriori Algorithm - Principal Component Analysis - Latent Dirichlet Allocation - Deep Learning - Temporal Difference Learning - Monte Carlo - Q-learning - Policy Gradients - Deep Reinforcement Learning
  • 12. 12 2.Linear Regression Based on machine learning course in Coursera by Andrew Ng https://www.coursera.org/learn/machine-learning
  • 13. Linear Regression ● Predicting the price of house 13 What is the price of a 200m2 house? Finding the best linear function f(x) g(x) h(x)
  • 14. Linear Regression (Cont’d) ● Predicting the price of house 14 What is the price of a 200m2 house? The best linear function ● ● Finding the best parameters so that is close to y General Setup ● m= # of training examples ● x = input variable/features ● y = output variable/target ● (x, y) = one training example ● (xi, yi) = i-th training example h(x)
  • 15. Linear Regression (Cont’d) ● Predicting the price of house 15 What is the price of a 200m2 house? Finding the best parameter h(x) cost function
  • 16. Gradient Descent: Cost Function Derivation ● Predicting the price of house 16 What is the price of a 200m2 house? Finding the best parameter h(x) Repeat until convergence { } Simultaneous Update
  • 17. Derivation Intuition 17 Positive Slope Negative Slope Derivation guide the direction of should be adjusted. α is the learning rate to control how big the movement of
  • 18. Gradient Descent Algorithm ● Predicting the price of house 18 What is the price of a 200m2 house? Finding the best parameter h(x) Repeat until convergence { } Gradient Descent Algorithm
  • 19. The Answer of the Prediction ● Predicting the price of house 19 What is the price of a 200m2 house? h(x)
  • 20. Multivariable Linear Regression 20 Previous linear regression function ● Multivariable linear regression ● m= # of training examples ● x(i) = input variables/features of i-th example ● y(i) = output variable of i-th example ● x(i) j = value of feature j in i-th example repeat { } Cost function Gradient descent
  • 21. 21 3.Logistic Regression Based on machine learning course in Coursera by Andrew Ng https://www.coursera.org/learn/machine-learning
  • 22. Classification Task 22 ● Linear regression issues ○ Prediction score can be more or less than 1 ○ Not suitable for classification task ● Solution: logistic regression Parameter and x as matrix 1 0.5 Score is also probability
  • 23. Regression Model 23 Training Set n parameter Cost repeat { } Gradient descent
  • 24. Multi-class Classification ● Binary vs multi-class classification ● Handling multi-class classification ○ One vs Rest /One vs All ■ 4 Class Classification → 4 Classification Model ■ Label with maximum score is the answer 24
  • 25. Machine Learning Problems ● Overfit ○ Hypothesis fit well with the training data → high performance ○ But fail to make generalization → poor performance on test data ○ High variance ○ Too many features ● Underfit ○ High bias → low performance ○ Fail to make generalization → poor performance on test data 25
  • 26. Some solution for the problem ● Reduce number of features ○ Select features to keep ○ Model selection ● Regularization ○ Keep all features, but reduce magnitude or values of parameters (theta) ○ Works well when having a lot of features 26
  • 27. Regularization 27 Regularization Note: Lambda high → underfit and high bias Lambda too small → overfit
  • 28. Take Home Message ● Machine learning is to adapt to new circumstances and to detect and extrapolate patterns. ● Linear regression for predicting real continuous values ● Logistic regression for predicting class in classification 28