SlideShare a Scribd company logo
1 of 21
Courcera - Machine Learning
2 Week
최승완
𝛩0 ≔ 𝛩0 − 𝛼
1
𝑚
𝑖=1
𝑚
{ 𝛩0 + 𝛩1 𝑋𝑖 − 𝑌𝑖}
𝛩1 ≔ 𝛩1 − 𝛼
1
𝑚
𝑖=1
𝑚
{ 𝛩0 + 𝛩1 𝑋𝑖 − 𝑌𝑖} ∗ 𝑋𝑖
Repeat until convergence
{
}
• Hypothesis
• Cost Function
• Gradient Descent
Review
ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥
How do I solve the linear regression problem ?
𝐽 𝛩0, 𝛩1 =
1
2𝑚
𝑖=1
𝑚
{ℎ 𝛩(𝑥 𝑖
) − 𝑦 𝑖
}2
Multiple Feature
What if the number of features increases?
• EX) Changes in House price for various Features.
• Notation
𝑥1 𝑥2 𝑥3 𝑥4 y
𝑥2
=
1416
3
2
40
𝑥1
2
= 1416
Multiple Feature
How do you express the hypothesis?
• Hypothesis
→ X
• Hypothesis for multiple feature
- If the number of features is n.
• EX) Changes in House price for various Features.
ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥
ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥1 + 𝛩2 𝑥2+ 𝛩3 𝑥3+ 𝛩4 𝑥4… 𝛩𝑛 𝑥 𝑛
→ℎ 𝛩 𝑥 = 80 + 0.1𝑥1+ 0.01𝑥2+ 3𝑥3 − 2𝑥4
Let's simply express the hypothesis.
• Hypothesis for multiple feature
For convenience of notation, define 𝑥0 = 1.
※ ℎ 𝛩 𝑥 = 𝛩 𝑇
𝑋 multivariate linear regression
𝑥 =
𝑥0
𝑥1
𝑥2
𝑥 𝑛
Multiple Feature
ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥1 + 𝛩2 𝑥2+ 𝛩3 𝑥3+ 𝛩4 𝑥4… 𝛩𝑛 𝑥 𝑛
…
𝛩 =
𝛩0
𝛩1
𝛩2
𝛩 𝑛
…
Apply to Gradient Descent
• Hypothesis for multiple feature
• Cost function
• Gradient Descent
Gradient Descent
ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥1 + 𝛩2 𝑥2+ 𝛩3 𝑥3+ 𝛩4 𝑥4… 𝛩𝑛 𝑥 𝑛
𝐽 𝛩0, 𝛩1…𝛩𝑛 =
1
2𝑚
𝑖=1
𝑚
{ℎ 𝛩(𝑥 𝑖
) − 𝑦 𝑖
}2
Repeat until convergence
{
}
𝛩𝑗 ≔ 𝛩𝑗 − 𝛼
𝜕
𝜕𝛩𝑗
𝐽 𝛩0, 𝛩1…𝛩𝑛
Repeat until convergence
{
}
𝛩𝑗 ≔ 𝛩𝑗 − 𝛼
1
𝑚
𝑖=1
𝑚
ℎ 𝛩 𝑥 𝑖
− 𝑦 𝑖
∗ 𝑥𝑗
𝑖
Repeat until convergence
{
}
𝛩𝑗 ≔ 𝛩𝑗 − 𝛼
1
𝑚
𝑖=1
𝑚
𝑗=1
𝑛
𝛩𝑗 𝑥𝑗
𝑖
− 𝑦 𝑖
∗ 𝑥𝑗
𝑖
𝐽 𝛩 =
1
2𝑚
𝑖=1
𝑚
𝑗=1
𝑛
𝛩𝑗 𝑥𝑗
𝑖
− 𝑦 𝑖
2
ℎ 𝛩 𝑥 = 𝛩 𝑇
𝑋
Feature Scaling
What is Feature Scaling?
- Make sure features are on a similar scale.
• EX) 𝑥1= size(0-2000𝑓𝑒𝑒𝑡2
)
𝑥2= number of bedrooms(1-5)
𝛩1
𝛩2
𝑥1=
size( 𝑓𝑒𝑒𝑡2)
2000
𝑥2=
number of bedroom 𝑠
5
𝛩1
𝛩2𝐽 𝛩 𝐽 𝛩
Feature Scaling
What is Feature Scaling?
- Make sure features are on a similar scale.
• Get every feature into approximately a -1≤ 𝑥𝑖 ≤1
𝑥0 = 1 Satisfaction -1≤ 𝑥𝑖 ≤1
𝑥1 = size(0−2000𝑓𝑒𝑒𝑡2
) use to 𝑥1=
size( 𝑓𝑒𝑒𝑡2)
2000
𝑥1 0≤ 𝑥𝑖 ≤1 Satisfaction -1≤ 𝑥𝑖 ≤1
𝑥𝑖 −3 ≤ 𝑥𝑖 ≤ 3 → ok , but −1000 ≤ 𝑥𝑖 ≤ 1000→ no
※ Feature Scaling
𝑥 𝑖
=
𝑥 𝑖−μ 𝑖
(𝑀𝐴𝑋−𝑀𝐼𝑁)
(Mean normalization)
• EX) 𝑥 𝑖
= age of house , average =10, age(30≤ 𝑥𝑖 ≤ 50)
𝑥 𝑖
=
age of house−10
(20)
… 1≤ 𝑥𝑖 ≤ 2
Debugging and Alpha
Automatic convergence test
Declare convergence if j(𝛩)
Decreases by less than 10−3
In one iteration
What is Debugging and Alpha?
- Debugging : How to make sure gradient descent is working correctly.
- Alpha : learning rate
• EX ) Gradient Descent working well
Debugging and Alpha
What is Debugging and Alpha?
- Debugging : How to make sure gradient descent is working correctly.
- Alpha : learning rate
• EX ) Gradient Descent not working
As large Alpha
→ Use smaller Alpha
Debugging and Alpha
What is Debugging and Alpha?
- Debugging : How to make sure gradient descent is working correctly.
- Alpha : learning rate
• EX ) Gradient Descent not working
As large Alpha
→ Use smaller Alpha
Debugging and Alpha
What is Debugging and Alpha?
- Debugging : How to make sure gradient descent is working correctly.
- Alpha : learning rate
• EX ) How to choose Alpha, try
- Draw a graph.
…, 0.001, , 0.01, , 0.1, , 1 …
Debugging and Alpha
What is Debugging and Alpha?
- Debugging : How to make sure gradient descent is working correctly.
- Alpha : learning rate
• EX ) How to choose Alpha, try
- Draw a graph.
…, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1 …
Polynomial Regression
What is Polynomial Regression?
- Regression analysis when dependent variable is represented by polynomial of independent variables.
• EX)
Area = x
x= frontage × depth
hΘ x = Θ0 + Θ1x(Area)
Polynomial Regression
What is Polynomial Regression?
- Regression analysis when dependent variable is represented by polynomial of independent variables.
• EX)
hΘ x = Θ0 + Θ1 𝑥+Θ2 𝑥2
Polynomial Regression
What is Polynomial Regression?
- Regression analysis when dependent variable is represented by polynomial of independent variables.
• EX)
※ Use multivariant linear regression
hΘ x = Θ0 + Θ1 𝑥+Θ2 𝑥2
+Θ3 𝑥3
hΘ x = Θ0 + Θ1(𝑠𝑖𝑧𝑒)+Θ2(𝑠𝑖𝑧𝑒)2
+Θ3(𝑠𝑖𝑧𝑒)3
Feature scaling is important.
Size range : 1≤ 𝑠𝑖𝑧𝑒 ≤1000
(𝑠𝑖𝑧𝑒)2
range : 1≤ 𝑠𝑖𝑧𝑒 ≤ (1000)2
(𝑠𝑖𝑧𝑒)3
range : 1≤ 𝑠𝑖𝑧𝑒 ≤ (1000)3
Normal Equation
What is Normal Equation?
- In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ.
EX)
Normal equation
- Method to solve for θ analytically
Normal Equation
What is Normal Equation?
- In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ.
EX)
-1 -0.5 0.5 1 1.5 2 𝛩
𝐽 𝛩
4
3
2
1
𝛩 ∈ 𝑅 𝑛
, 𝐽 𝛩 = 𝑎𝛩2
+ 𝑏𝛩+c
->
𝜕
𝜕𝛩
𝐽 𝛩 = … set 0
Normal Equation
What is Normal Equation?
- In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ.
EX)
𝛩 ∈ 𝑅 𝑛+1
->
𝜕
𝜕𝛩 𝑗
𝐽 𝛩 = … = 0(for every j)
𝐽 𝛩0, 𝛩1 ,… , 𝛩𝑛 =
1
2𝑚
𝑖=1
𝑚
{ℎ 𝛩(𝑥 𝑖
) − 𝑦 𝑖
}2
Normal Equation
What is Normal Equation?
- In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ.
EX)
𝑥 =
1 5 1 45
1 3 2 40
1 3 2 30
1 2 1 36
𝑦 =
460
232
315
178
(m× 𝑛 + 1) (m×1)
θ=((𝑋 𝑇 𝑋)−1 𝑋 𝑇Y)
𝑥0
1
1
1
1
Normal Equation
When do I use it ?
• Gradient Descent
- Need to choose 𝛼.
- Need to many iteration.
- works well even when n is large.
• Normal Equation
- NO need to choose 𝛼.
- Don’t Need to iteration.
- Need to compute (𝑋 𝑇
𝑋)−1
- Slow if n is very large.

More Related Content

What's hot

Vectors space definition with axiom classification
Vectors space definition with axiom classificationVectors space definition with axiom classification
Vectors space definition with axiom classificationkishor pokar
 
Rules of Derivative
Rules of Derivative Rules of Derivative
Rules of Derivative Alishba Saeed
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)irjes
 
On Bernstein Polynomials
On Bernstein PolynomialsOn Bernstein Polynomials
On Bernstein PolynomialsIOSR Journals
 
Pearson's correlation coefficient
Pearson's correlation coefficientPearson's correlation coefficient
Pearson's correlation coefficientWaleed Zaghal
 
Linear regression, costs & gradient descent
Linear regression, costs & gradient descentLinear regression, costs & gradient descent
Linear regression, costs & gradient descentRevanth Kumar
 
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepBackpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepAhmed Gad
 
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Solving Poisson Equation using Conjugate Gradient Methodand its implementationSolving Poisson Equation using Conjugate Gradient Methodand its implementation
Solving Poisson Equation using Conjugate Gradient Method and its implementationJongsu "Liam" Kim
 
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix MappingDual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mappinginventionjournals
 
Eighan values and diagonalization
Eighan values and diagonalization Eighan values and diagonalization
Eighan values and diagonalization gandhinagar
 
tezisfuzet_koppanyi_angol
tezisfuzet_koppanyi_angoltezisfuzet_koppanyi_angol
tezisfuzet_koppanyi_angolZolt Kopp
 
Quantum fourier transformation
Quantum fourier transformationQuantum fourier transformation
Quantum fourier transformationtakumitano
 
Conic Section - Parabola - Ellipse - Hyperbola
Conic Section - Parabola - Ellipse - HyperbolaConic Section - Parabola - Ellipse - Hyperbola
Conic Section - Parabola - Ellipse - Hyperbolasatish kumar
 
Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)
Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)
Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)Prasanth George
 
3). work & energy (finished)
3). work & energy (finished)3). work & energy (finished)
3). work & energy (finished)PhysicsLover
 

What's hot (20)

Gradient Boosting
Gradient BoostingGradient Boosting
Gradient Boosting
 
Hidden Markov Model
Hidden Markov ModelHidden Markov Model
Hidden Markov Model
 
Vectors space definition with axiom classification
Vectors space definition with axiom classificationVectors space definition with axiom classification
Vectors space definition with axiom classification
 
Rules of Derivative
Rules of Derivative Rules of Derivative
Rules of Derivative
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
 
On Bernstein Polynomials
On Bernstein PolynomialsOn Bernstein Polynomials
On Bernstein Polynomials
 
Pearson's correlation coefficient
Pearson's correlation coefficientPearson's correlation coefficient
Pearson's correlation coefficient
 
Linear regression, costs & gradient descent
Linear regression, costs & gradient descentLinear regression, costs & gradient descent
Linear regression, costs & gradient descent
 
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-StepBackpropagation: Understanding How to Update ANNs Weights Step-by-Step
Backpropagation: Understanding How to Update ANNs Weights Step-by-Step
 
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Solving Poisson Equation using Conjugate Gradient Methodand its implementationSolving Poisson Equation using Conjugate Gradient Methodand its implementation
Solving Poisson Equation using Conjugate Gradient Method and its implementation
 
Power method
Power methodPower method
Power method
 
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix MappingDual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
Dual Spaces of Generalized Cesaro Sequence Space and Related Matrix Mapping
 
Eighan values and diagonalization
Eighan values and diagonalization Eighan values and diagonalization
Eighan values and diagonalization
 
tezisfuzet_koppanyi_angol
tezisfuzet_koppanyi_angoltezisfuzet_koppanyi_angol
tezisfuzet_koppanyi_angol
 
Quantum fourier transformation
Quantum fourier transformationQuantum fourier transformation
Quantum fourier transformation
 
Conic Section - Parabola - Ellipse - Hyperbola
Conic Section - Parabola - Ellipse - HyperbolaConic Section - Parabola - Ellipse - Hyperbola
Conic Section - Parabola - Ellipse - Hyperbola
 
Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)
Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)
Eigenvalues and Eigenvectors (Tacoma Narrows Bridge video included)
 
3). work & energy (finished)
3). work & energy (finished)3). work & energy (finished)
3). work & energy (finished)
 
PRODUCT RULES
PRODUCT RULESPRODUCT RULES
PRODUCT RULES
 
Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...
Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...
Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...
 

Similar to Coursera 2week

Chapter 1 - What is a Function.pdf
Chapter 1 - What is a Function.pdfChapter 1 - What is a Function.pdf
Chapter 1 - What is a Function.pdfManarKareem1
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsSantiagoGarridoBulln
 
Calculus Review Session Brian Prest Duke University Nicholas School of the En...
Calculus Review Session Brian Prest Duke University Nicholas School of the En...Calculus Review Session Brian Prest Duke University Nicholas School of the En...
Calculus Review Session Brian Prest Duke University Nicholas School of the En...rofiho9697
 
Gen Math topic 1.pptx
Gen Math topic 1.pptxGen Math topic 1.pptx
Gen Math topic 1.pptxAngeloReyes58
 
Applied Algorithms and Structures week999
Applied Algorithms and Structures week999Applied Algorithms and Structures week999
Applied Algorithms and Structures week999fashiontrendzz20
 
Stochastic optimal control & rl
Stochastic optimal control & rlStochastic optimal control & rl
Stochastic optimal control & rlChoiJinwon3
 
Tavas and pashmaks
Tavas and pashmaksTavas and pashmaks
Tavas and pashmaksminsu kim
 
equivalence and countability
equivalence and countabilityequivalence and countability
equivalence and countabilityROHAN GAIKWAD
 
Learning group em - 20171025 - copy
Learning group   em - 20171025 - copyLearning group   em - 20171025 - copy
Learning group em - 20171025 - copyShuai Zhang
 
01 Functions and their Graphs.pptx
01 Functions and their Graphs.pptx01 Functions and their Graphs.pptx
01 Functions and their Graphs.pptxEljon02
 
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptxGrade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptxErlenaMirador1
 
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptxGrade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptxErlenaMirador1
 
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]Asafak Husain
 
07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processing07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processingJordanJohmMallillin
 
Higher order differential equation
Higher order differential equationHigher order differential equation
Higher order differential equationSooraj Maurya
 
Inverse Function.pptx
Inverse Function.pptxInverse Function.pptx
Inverse Function.pptxSerGeo5
 

Similar to Coursera 2week (20)

Chapter 1 - What is a Function.pdf
Chapter 1 - What is a Function.pdfChapter 1 - What is a Function.pdf
Chapter 1 - What is a Function.pdf
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methods
 
Calculus Review Session Brian Prest Duke University Nicholas School of the En...
Calculus Review Session Brian Prest Duke University Nicholas School of the En...Calculus Review Session Brian Prest Duke University Nicholas School of the En...
Calculus Review Session Brian Prest Duke University Nicholas School of the En...
 
Gen Math topic 1.pptx
Gen Math topic 1.pptxGen Math topic 1.pptx
Gen Math topic 1.pptx
 
Basic calculus (i)
Basic calculus (i)Basic calculus (i)
Basic calculus (i)
 
Applied Algorithms and Structures week999
Applied Algorithms and Structures week999Applied Algorithms and Structures week999
Applied Algorithms and Structures week999
 
Stochastic optimal control & rl
Stochastic optimal control & rlStochastic optimal control & rl
Stochastic optimal control & rl
 
Tavas and pashmaks
Tavas and pashmaksTavas and pashmaks
Tavas and pashmaks
 
equivalence and countability
equivalence and countabilityequivalence and countability
equivalence and countability
 
Learning group em - 20171025 - copy
Learning group   em - 20171025 - copyLearning group   em - 20171025 - copy
Learning group em - 20171025 - copy
 
Lec05.pptx
Lec05.pptxLec05.pptx
Lec05.pptx
 
Gcse Maths Resources
Gcse Maths ResourcesGcse Maths Resources
Gcse Maths Resources
 
01 Functions and their Graphs.pptx
01 Functions and their Graphs.pptx01 Functions and their Graphs.pptx
01 Functions and their Graphs.pptx
 
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptxGrade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
 
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptxGrade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
Grade 10_Math-Lesson 2-3 Graphs of Polynomial Functions .pptx
 
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]
 
07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processing07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processing
 
Higher order differential equation
Higher order differential equationHigher order differential equation
Higher order differential equation
 
Inverse Function.pptx
Inverse Function.pptxInverse Function.pptx
Inverse Function.pptx
 
Fourier series
Fourier series Fourier series
Fourier series
 

Recently uploaded

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

Coursera 2week

  • 1. Courcera - Machine Learning 2 Week 최승완
  • 2. 𝛩0 ≔ 𝛩0 − 𝛼 1 𝑚 𝑖=1 𝑚 { 𝛩0 + 𝛩1 𝑋𝑖 − 𝑌𝑖} 𝛩1 ≔ 𝛩1 − 𝛼 1 𝑚 𝑖=1 𝑚 { 𝛩0 + 𝛩1 𝑋𝑖 − 𝑌𝑖} ∗ 𝑋𝑖 Repeat until convergence { } • Hypothesis • Cost Function • Gradient Descent Review ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥 How do I solve the linear regression problem ? 𝐽 𝛩0, 𝛩1 = 1 2𝑚 𝑖=1 𝑚 {ℎ 𝛩(𝑥 𝑖 ) − 𝑦 𝑖 }2
  • 3. Multiple Feature What if the number of features increases? • EX) Changes in House price for various Features. • Notation 𝑥1 𝑥2 𝑥3 𝑥4 y 𝑥2 = 1416 3 2 40 𝑥1 2 = 1416
  • 4. Multiple Feature How do you express the hypothesis? • Hypothesis → X • Hypothesis for multiple feature - If the number of features is n. • EX) Changes in House price for various Features. ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥 ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥1 + 𝛩2 𝑥2+ 𝛩3 𝑥3+ 𝛩4 𝑥4… 𝛩𝑛 𝑥 𝑛 →ℎ 𝛩 𝑥 = 80 + 0.1𝑥1+ 0.01𝑥2+ 3𝑥3 − 2𝑥4
  • 5. Let's simply express the hypothesis. • Hypothesis for multiple feature For convenience of notation, define 𝑥0 = 1. ※ ℎ 𝛩 𝑥 = 𝛩 𝑇 𝑋 multivariate linear regression 𝑥 = 𝑥0 𝑥1 𝑥2 𝑥 𝑛 Multiple Feature ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥1 + 𝛩2 𝑥2+ 𝛩3 𝑥3+ 𝛩4 𝑥4… 𝛩𝑛 𝑥 𝑛 … 𝛩 = 𝛩0 𝛩1 𝛩2 𝛩 𝑛 …
  • 6. Apply to Gradient Descent • Hypothesis for multiple feature • Cost function • Gradient Descent Gradient Descent ℎ 𝛩 𝑥 = 𝛩0 + 𝛩1 𝑥1 + 𝛩2 𝑥2+ 𝛩3 𝑥3+ 𝛩4 𝑥4… 𝛩𝑛 𝑥 𝑛 𝐽 𝛩0, 𝛩1…𝛩𝑛 = 1 2𝑚 𝑖=1 𝑚 {ℎ 𝛩(𝑥 𝑖 ) − 𝑦 𝑖 }2 Repeat until convergence { } 𝛩𝑗 ≔ 𝛩𝑗 − 𝛼 𝜕 𝜕𝛩𝑗 𝐽 𝛩0, 𝛩1…𝛩𝑛 Repeat until convergence { } 𝛩𝑗 ≔ 𝛩𝑗 − 𝛼 1 𝑚 𝑖=1 𝑚 ℎ 𝛩 𝑥 𝑖 − 𝑦 𝑖 ∗ 𝑥𝑗 𝑖 Repeat until convergence { } 𝛩𝑗 ≔ 𝛩𝑗 − 𝛼 1 𝑚 𝑖=1 𝑚 𝑗=1 𝑛 𝛩𝑗 𝑥𝑗 𝑖 − 𝑦 𝑖 ∗ 𝑥𝑗 𝑖 𝐽 𝛩 = 1 2𝑚 𝑖=1 𝑚 𝑗=1 𝑛 𝛩𝑗 𝑥𝑗 𝑖 − 𝑦 𝑖 2 ℎ 𝛩 𝑥 = 𝛩 𝑇 𝑋
  • 7. Feature Scaling What is Feature Scaling? - Make sure features are on a similar scale. • EX) 𝑥1= size(0-2000𝑓𝑒𝑒𝑡2 ) 𝑥2= number of bedrooms(1-5) 𝛩1 𝛩2 𝑥1= size( 𝑓𝑒𝑒𝑡2) 2000 𝑥2= number of bedroom 𝑠 5 𝛩1 𝛩2𝐽 𝛩 𝐽 𝛩
  • 8. Feature Scaling What is Feature Scaling? - Make sure features are on a similar scale. • Get every feature into approximately a -1≤ 𝑥𝑖 ≤1 𝑥0 = 1 Satisfaction -1≤ 𝑥𝑖 ≤1 𝑥1 = size(0−2000𝑓𝑒𝑒𝑡2 ) use to 𝑥1= size( 𝑓𝑒𝑒𝑡2) 2000 𝑥1 0≤ 𝑥𝑖 ≤1 Satisfaction -1≤ 𝑥𝑖 ≤1 𝑥𝑖 −3 ≤ 𝑥𝑖 ≤ 3 → ok , but −1000 ≤ 𝑥𝑖 ≤ 1000→ no ※ Feature Scaling 𝑥 𝑖 = 𝑥 𝑖−μ 𝑖 (𝑀𝐴𝑋−𝑀𝐼𝑁) (Mean normalization) • EX) 𝑥 𝑖 = age of house , average =10, age(30≤ 𝑥𝑖 ≤ 50) 𝑥 𝑖 = age of house−10 (20) … 1≤ 𝑥𝑖 ≤ 2
  • 9. Debugging and Alpha Automatic convergence test Declare convergence if j(𝛩) Decreases by less than 10−3 In one iteration What is Debugging and Alpha? - Debugging : How to make sure gradient descent is working correctly. - Alpha : learning rate • EX ) Gradient Descent working well
  • 10. Debugging and Alpha What is Debugging and Alpha? - Debugging : How to make sure gradient descent is working correctly. - Alpha : learning rate • EX ) Gradient Descent not working As large Alpha → Use smaller Alpha
  • 11. Debugging and Alpha What is Debugging and Alpha? - Debugging : How to make sure gradient descent is working correctly. - Alpha : learning rate • EX ) Gradient Descent not working As large Alpha → Use smaller Alpha
  • 12. Debugging and Alpha What is Debugging and Alpha? - Debugging : How to make sure gradient descent is working correctly. - Alpha : learning rate • EX ) How to choose Alpha, try - Draw a graph. …, 0.001, , 0.01, , 0.1, , 1 …
  • 13. Debugging and Alpha What is Debugging and Alpha? - Debugging : How to make sure gradient descent is working correctly. - Alpha : learning rate • EX ) How to choose Alpha, try - Draw a graph. …, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1 …
  • 14. Polynomial Regression What is Polynomial Regression? - Regression analysis when dependent variable is represented by polynomial of independent variables. • EX) Area = x x= frontage × depth hΘ x = Θ0 + Θ1x(Area)
  • 15. Polynomial Regression What is Polynomial Regression? - Regression analysis when dependent variable is represented by polynomial of independent variables. • EX) hΘ x = Θ0 + Θ1 𝑥+Θ2 𝑥2
  • 16. Polynomial Regression What is Polynomial Regression? - Regression analysis when dependent variable is represented by polynomial of independent variables. • EX) ※ Use multivariant linear regression hΘ x = Θ0 + Θ1 𝑥+Θ2 𝑥2 +Θ3 𝑥3 hΘ x = Θ0 + Θ1(𝑠𝑖𝑧𝑒)+Θ2(𝑠𝑖𝑧𝑒)2 +Θ3(𝑠𝑖𝑧𝑒)3 Feature scaling is important. Size range : 1≤ 𝑠𝑖𝑧𝑒 ≤1000 (𝑠𝑖𝑧𝑒)2 range : 1≤ 𝑠𝑖𝑧𝑒 ≤ (1000)2 (𝑠𝑖𝑧𝑒)3 range : 1≤ 𝑠𝑖𝑧𝑒 ≤ (1000)3
  • 17. Normal Equation What is Normal Equation? - In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ. EX) Normal equation - Method to solve for θ analytically
  • 18. Normal Equation What is Normal Equation? - In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ. EX) -1 -0.5 0.5 1 1.5 2 𝛩 𝐽 𝛩 4 3 2 1 𝛩 ∈ 𝑅 𝑛 , 𝐽 𝛩 = 𝑎𝛩2 + 𝑏𝛩+c -> 𝜕 𝜕𝛩 𝐽 𝛩 = … set 0
  • 19. Normal Equation What is Normal Equation? - In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ. EX) 𝛩 ∈ 𝑅 𝑛+1 -> 𝜕 𝜕𝛩 𝑗 𝐽 𝛩 = … = 0(for every j) 𝐽 𝛩0, 𝛩1 ,… , 𝛩𝑛 = 1 2𝑚 𝑖=1 𝑚 {ℎ 𝛩(𝑥 𝑖 ) − 𝑦 𝑖 }2
  • 20. Normal Equation What is Normal Equation? - In certain linear regression problems, it is an effective way to find the optimal value of the parameter θ. EX) 𝑥 = 1 5 1 45 1 3 2 40 1 3 2 30 1 2 1 36 𝑦 = 460 232 315 178 (m× 𝑛 + 1) (m×1) θ=((𝑋 𝑇 𝑋)−1 𝑋 𝑇Y) 𝑥0 1 1 1 1
  • 21. Normal Equation When do I use it ? • Gradient Descent - Need to choose 𝛼. - Need to many iteration. - works well even when n is large. • Normal Equation - NO need to choose 𝛼. - Don’t Need to iteration. - Need to compute (𝑋 𝑇 𝑋)−1 - Slow if n is very large.

Editor's Notes

  1. 머신러닝 설명