SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
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

Más contenido relacionado

Similar a Fundamental of Machine Learning

27332020002_PC-CS601_Robotics_Debjit Doira.pdf
27332020002_PC-CS601_Robotics_Debjit Doira.pdf27332020002_PC-CS601_Robotics_Debjit Doira.pdf
27332020002_PC-CS601_Robotics_Debjit Doira.pdf
Adharchandsaha
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learning
inovex GmbH
 

Similar a Fundamental of Machine Learning (20)

Uncertainty Awareness in Integrating Machine Learning and Game Theory
Uncertainty Awareness in Integrating Machine Learning and Game TheoryUncertainty Awareness in Integrating Machine Learning and Game Theory
Uncertainty Awareness in Integrating Machine Learning and Game Theory
 
Memory for Lean Reinforcement Learning.pdf
Memory for Lean Reinforcement Learning.pdfMemory for Lean Reinforcement Learning.pdf
Memory for Lean Reinforcement Learning.pdf
 
Artificial Intelligence - Anna Uni -v1.pdf
Artificial Intelligence - Anna Uni -v1.pdfArtificial Intelligence - Anna Uni -v1.pdf
Artificial Intelligence - Anna Uni -v1.pdf
 
27332020002_PC-CS601_Robotics_Debjit Doira.pdf
27332020002_PC-CS601_Robotics_Debjit Doira.pdf27332020002_PC-CS601_Robotics_Debjit Doira.pdf
27332020002_PC-CS601_Robotics_Debjit Doira.pdf
 
Online advertising and large scale model fitting
Online advertising and large scale model fittingOnline advertising and large scale model fitting
Online advertising and large scale model fitting
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
Introduction of Deep Reinforcement Learning
Introduction of Deep Reinforcement LearningIntroduction of Deep Reinforcement Learning
Introduction of Deep Reinforcement Learning
 
L15.pptx
L15.pptxL15.pptx
L15.pptx
 
General introduction to AI ML DL DS
General introduction to AI ML DL DSGeneral introduction to AI ML DL DS
General introduction to AI ML DL DS
 
lecture15-neural-nets (2).pptx
lecture15-neural-nets (2).pptxlecture15-neural-nets (2).pptx
lecture15-neural-nets (2).pptx
 
Jay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AIJay Yagnik at AI Frontiers : A History Lesson on AI
Jay Yagnik at AI Frontiers : A History Lesson on AI
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
 
Pycon 2012 Scikit-Learn
Pycon 2012 Scikit-LearnPycon 2012 Scikit-Learn
Pycon 2012 Scikit-Learn
 
[Eestec] Machine Learning online seminar 1, 12 2016
[Eestec] Machine Learning online seminar 1, 12 2016[Eestec] Machine Learning online seminar 1, 12 2016
[Eestec] Machine Learning online seminar 1, 12 2016
 
SKLearn Workshop.pptx
SKLearn Workshop.pptxSKLearn Workshop.pptx
SKLearn Workshop.pptx
 
Machine Learning in Finance
Machine Learning in FinanceMachine Learning in Finance
Machine Learning in Finance
 
Towards quantum machine learning calogero zarbo - meet up
Towards quantum machine learning  calogero zarbo - meet upTowards quantum machine learning  calogero zarbo - meet up
Towards quantum machine learning calogero zarbo - meet up
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learning
 
Introduction to Machine Learning with Spark
Introduction to Machine Learning with SparkIntroduction to Machine Learning with Spark
Introduction to Machine Learning with Spark
 

Más de SARCCOM

Más de SARCCOM (20)

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

Último

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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