SlideShare a Scribd company logo
Introduction to Machine Learning with examples in R
1958
1998
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
&
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝟐

𝜎2
=
1
𝑛
෍
𝑖=1
𝑛
𝑥𝑖 − 𝜇 2
𝜎 = 𝜎2

𝜎2
= 4
𝜎 = 2
𝜎2
= 0.57
𝜎 = 0.75
Introduction to Machine Learning with examples in R
𝒙 𝒚 𝒙𝒊 − ഥ
𝒙 𝒚𝒊 − ഥ
𝒚 (𝒙𝒊 − ഥ
𝒙) ⋅ (𝒚𝒊 − ഥ
𝒚)

ഥ
𝒙
ഥ
𝒚
𝑐𝑜𝑣(𝑋, 𝑌) =
σ𝑖=1
𝑛
𝑥𝑖− ҧ
𝑥 ⋅ 𝑦𝑖− ത
𝑦
𝑛
Introduction to Machine Learning with examples in R
−1 ≤
𝑐𝑜𝑣 𝑥, 𝑦
𝜎𝑥 ⋅ 𝜎𝑦
≤ 1
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝑦𝑖 𝑥𝑖
𝑦𝑖 𝑥𝑖
𝑦𝑖 = 𝛽0 + 𝛽1𝑥i + 𝜖𝑖
𝜷𝟎
𝜷𝟏
ො
𝑦𝑖 = 𝛽0 + 𝛽1𝑥i
𝝐𝒊
ො
𝑦𝑖
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝑦𝑖 ො
𝑦𝑖
𝐚𝐫𝐠 𝒎𝒊𝒏
𝜷𝟎, 𝜷𝟏
෍
𝒊=𝟏
𝒏
𝝐𝒊
𝟐
arg min
𝛽0, 𝛽1
෍
𝑖=1
𝑛
[𝑦𝑖 − (𝛽0 + 𝛽1𝑥𝑖)]2
ො
𝑦𝑖 = 𝛽0 + 𝛽1𝑥𝑖
𝑦𝑖 = ො
𝑦𝑖 + 𝜖𝑖
𝝐𝒊 = 𝒚𝒊 − ෝ
𝒚𝒊
𝜷𝟏 =
𝒄𝒐𝒗 𝒙, 𝒚
𝝈𝒙
𝟐
𝜷𝟎 = ഥ
𝒚 − 𝜷𝟏ഥ
𝒙
⇒
𝒙 𝒚 𝒙𝒊 − ഥ
𝒙 𝒚𝒊 − ഥ
𝒚 (𝒙𝒊 − ഥ
𝒙) ⋅ (𝒚𝒊 − ഥ
𝒚) 𝒙 − ഥ
𝒙 𝟐
ഥ
𝒙 ഥ
𝒚  
𝑟𝑥𝑦 =
−125
246 ⋅ 78
= −0,9 𝛽0 = 22
𝛽1 = −0.71
෍ 𝜖2 = 20.25
ො
𝑦𝑖 = 22 − 0.71 ⋅ 𝑥𝑖
𝛽1 =
𝑐𝑜𝑣 𝑥, 𝑦
𝜎𝑥
=
−125
246
= −0.51
෍ 𝜖2
= 14.48
ො
𝑦𝑖 = 19.1 − 0.51 ⋅ 𝑥𝑖
𝛽0 = ത
𝑦 − 𝛽1 ҧ
𝑥 = 14 + 0.51 ⋅ 10 = 19.1
ෝ
𝒚 = 𝟐𝟓𝟕𝟗𝟐 + 𝟗𝟒𝟓𝟎 ⋅ 𝒀𝒆𝒂𝒓𝒔𝑬𝒙𝒑𝒆𝒓𝒊𝒆𝒏𝒄𝒆
Introduction to Machine Learning with examples in R
෍
𝑖=1
𝑛
𝑦𝑖 − ത
𝑦 2 ෍
𝑖=1
𝑛
ො
𝑦𝑖 − ത
𝑦 2 ෍
𝑖=1
𝑛
𝑦𝑖 − ො
𝑦 2
𝑅2
𝑹𝟐 𝒓𝟐
0 ≤ 𝑅2
≤ 1
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝑥− ҧ
𝑥
𝜎𝑥
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝛽1
𝛽1
𝛽1 𝛽1 ≠ 0 𝛽1
𝛽1 ≠ 0
𝑯𝟎: 𝛽1 = 0
𝑯𝟏: 𝛽1 ≠ 0
ො
𝑦𝑖 = 𝛽0
ො
𝑦𝑖 = 𝛽0 + 𝛽1𝑋
𝛽𝑖−0
𝑆𝐸(𝛽𝑖)
𝜷𝟎
𝜷𝟏
𝛽𝑖−0
𝑆𝐸(𝛽𝑖)
𝐸𝑆𝑆
𝑅𝑆𝑆
Introduction to Machine Learning with examples in R
𝑦 = 𝛽0 + 𝛽1𝑥1 + ⋯ + 𝛽𝑝𝑥𝑝 + 𝜖𝑖
ො
𝑦𝑖
𝛽𝑗 𝑥𝑖
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝑯𝟎: 𝛽1 = 𝛽2 = ⋯ = 𝛽𝑝 = 0
𝛽𝑗 ≠ 0
𝑯𝟏: ∃𝑗: 𝛽𝑗≠ 0
ො
𝑦 = 𝛽0
ො
𝑦 = 𝛽0 + 𝛽𝑖𝑋𝑖 + … + 𝛽𝑗𝑋𝑗
≫ 𝐻0
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
2𝑝
𝟏. 𝟐𝟔𝟕. 𝟔𝟓𝟎. 𝟔𝟎𝟎. 𝟐𝟐𝟖. 𝟐𝟐𝟗. 𝟒𝟎𝟏. 𝟒𝟗𝟔. 𝟕𝟎𝟑. 𝟐𝟎𝟓. 𝟑𝟕𝟔
𝑦 = 𝛽0
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
෣
𝑝𝑟𝑖𝑐𝑒 = −22.02 + 0.13 ⋅ 𝐻𝑜𝑟𝑠𝑒𝑝𝑜𝑤𝑒𝑟 + 0.22 ⋅ 𝑊ℎ𝑒𝑒𝑙𝑏𝑎𝑠𝑒
𝛽1 ⋅ 𝑥1 𝛽2 ⋅ 𝑥2
𝑦 = 𝛽0 + 𝛽1𝑥1 + ⋯ + 𝛽𝑝𝑥𝑝
෣
𝑝𝑟𝑖𝑐𝑒 = −22.02 + 0.13 ⋅ 𝐻𝑜𝑟𝑠𝑒𝑝𝑜𝑤𝑒𝑟 + 0.22 ⋅ 𝑊ℎ𝑒𝑒𝑙𝑏𝑎𝑠𝑒
𝛽1 ⋅ 𝑥1 𝛽2 ⋅ 𝑥2
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝑥𝑖 = ቊ
1 𝑖𝑓 𝑖 𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑓𝑒𝑚𝑎𝑙𝑒
2 𝑖𝑓 𝑖 𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑚𝑎𝑙𝑒
ො
𝑦𝑖 = ቊ
𝛽0 + 𝛽1 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑓𝑒𝑚𝑎𝑙𝑒
𝛽0 + 2𝛽1 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑚𝑎𝑙𝑒
𝑥𝑖1 = ቊ
1 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑎𝑓𝑟𝑖𝑐𝑎𝑛
0 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑛𝑜𝑡 𝑎𝑓𝑟𝑖𝑐𝑎𝑛
ො
𝑦𝑖 = 𝛽0 + 𝛽1𝑥𝑖1 + 𝛽2𝑥𝑖2 = ቐ
𝜷𝟎 + 𝜷𝟏 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑎𝑓𝑟𝑖𝑐𝑎𝑛
𝜷𝟎 + 𝜷𝟐 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑎𝑠𝑖𝑎𝑡𝑖𝑐
𝜷𝟎 𝑖𝑓 𝑡ℎ𝑒 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑐𝑎𝑢𝑐𝑎𝑠𝑖𝑐
𝑥𝑖2 = ቊ
1 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑎𝑠𝑖𝑎𝑡𝑖𝑐
0 𝑖𝑓 𝑖𝑡ℎ 𝑖𝑛𝑑𝑖𝑣𝑖𝑑𝑢𝑎𝑙 𝑖𝑠 𝑛𝑜𝑡 𝑎𝑠𝑖𝑎𝑡𝑖𝑐
Introduction to Machine Learning with examples in R
𝑦 = 𝛽0 + 𝛽1𝑥1 + 𝛽2𝑥1
𝑛
+ ⋯ + 𝜖𝑖
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
𝑝 𝑋 =
𝑒𝛽0+𝛽1𝑋
1 + 𝑒𝛽0+𝛽1𝑋
Introduction to Machine Learning with examples in R
𝑝 𝑋 =
𝑒𝛽0+𝛽1𝑋1+⋯+𝛽𝑝𝑋𝑝
1 + 𝑒𝛽0+𝛽1𝑋1+⋯+𝛽𝑝𝑋𝑝
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
መ
𝛿𝑘 𝑥 = 𝑥 ⋅
Ƹ
𝜇𝑘
ො
𝜎2
−
Ƹ
𝜇2
2 ො
𝜎2
+ 𝑙𝑜𝑔( ො
𝜋𝑘)
ෝ
𝝅𝒌
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
•
•
•
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
FEW CLUSTERS
No
distinctions
between
observations
Too many distinctions between
observations
TOO MANY CLUSTERS
Find the best balance between
information and homogenity
of data associated to each cluster
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R

More Related Content

PPTX
support vector machine
PDF
Data Science Cheatsheet.pdf
PDF
Huong dan cu the svm
PDF
PDF
A Simple Review on SVM
PDF
Avoid Overfitting with Regularization
DOC
ASCE_ChingHuei_Rev00..
DOC
ASCE_ChingHuei_Rev00..
support vector machine
Data Science Cheatsheet.pdf
Huong dan cu the svm
A Simple Review on SVM
Avoid Overfitting with Regularization
ASCE_ChingHuei_Rev00..
ASCE_ChingHuei_Rev00..

Similar to Introduction to Machine Learning with examples in R (20)

PDF
Some Equations for MAchine LEarning
PDF
Lecture5 kernel svm
DOCX
Measures and Strengths of AssociationRemember that while w.docx
PPT
Statistical Machine________ Learning.ppt
PDF
Bayesian solutions to high-dimensional challenges using hybrid search
PDF
Petrini - MSc Thesis
PDF
Machine Learning.pdf
PDF
A practical Introduction to Machine(s) Learning
PPTX
Support Vector Machines Simply
PDF
Explore ml day 2
PDF
Epsrcws08 campbell isvm_01
PDF
BlUP and BLUE- REML of linear mixed model
PDF
Lecture3 linear svm_with_slack
PDF
Probability and Statistics Cookbook
DOCX
Data mining BY Zubair Yaseen
PDF
Statistical Regression With Python
DOCX
Optimization Of Fuzzy Bexa Using Nm
PDF
Machine learning
PDF
PDF
lec5_annotated.pdf ml csci 567 vatsal sharan
Some Equations for MAchine LEarning
Lecture5 kernel svm
Measures and Strengths of AssociationRemember that while w.docx
Statistical Machine________ Learning.ppt
Bayesian solutions to high-dimensional challenges using hybrid search
Petrini - MSc Thesis
Machine Learning.pdf
A practical Introduction to Machine(s) Learning
Support Vector Machines Simply
Explore ml day 2
Epsrcws08 campbell isvm_01
BlUP and BLUE- REML of linear mixed model
Lecture3 linear svm_with_slack
Probability and Statistics Cookbook
Data mining BY Zubair Yaseen
Statistical Regression With Python
Optimization Of Fuzzy Bexa Using Nm
Machine learning
lec5_annotated.pdf ml csci 567 vatsal sharan
Ad

More from Stefano Dalla Palma (11)

PDF
Design for Testability
PDF
Introduction to Mutation Testing
PDF
Artificial Neural Networks
PDF
Decision Tree learning
PDF
Introduction to Machine Learning concepts
PDF
Apache Mahout Architecture Overview
PDF
An Empirical Study on Bounded Model Checking
PDF
UML, ER and Dimensional Modelling
PDF
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
PPTX
Detecting controversy in microposts: an approach based on word similarity wit...
PDF
Prolog in a nutshell
Design for Testability
Introduction to Mutation Testing
Artificial Neural Networks
Decision Tree learning
Introduction to Machine Learning concepts
Apache Mahout Architecture Overview
An Empirical Study on Bounded Model Checking
UML, ER and Dimensional Modelling
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
Detecting controversy in microposts: an approach based on word similarity wit...
Prolog in a nutshell
Ad

Recently uploaded (20)

PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
Computer network topology notes for revision
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
Mega Projects Data Mega Projects Data
PPTX
Introduction to Knowledge Engineering Part 1
PDF
annual-report-2024-2025 original latest.
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
Supervised vs unsupervised machine learning algorithms
PPT
Quality review (1)_presentation of this 21
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PPTX
IB Computer Science - Internal Assessment.pptx
ISS -ESG Data flows What is ESG and HowHow
Computer network topology notes for revision
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Fluorescence-microscope_Botany_detailed content
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Mega Projects Data Mega Projects Data
Introduction to Knowledge Engineering Part 1
annual-report-2024-2025 original latest.
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
Supervised vs unsupervised machine learning algorithms
Quality review (1)_presentation of this 21
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
1_Introduction to advance data techniques.pptx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Data_Analytics_and_PowerBI_Presentation.pptx
.pdf is not working space design for the following data for the following dat...
IB Computer Science - Internal Assessment.pptx

Introduction to Machine Learning with examples in R