1 ModuleEcontent - Session5
1 ModuleEcontent - Session5
1 ModuleEcontent - Session5
03 Regression
Fitting Function to Data Point
Y= F(x)
X Model y
F(x)
Given a data set D = {(xi, yi)} the objective is to learn the relationship
between features and the target.
Its a supervised machine learning technique.
Classification Example:
Binary
Classification
𝐶𝑅
𝑩 𝑹
𝐶𝐵
?
d(x, 𝑪𝑩 ) d(x, 𝑪𝑹 )
𝒙
Binary
Classification d(x, 𝑪𝑩 ) > d(x, 𝑪𝑹 ) => 𝑹
𝐶𝑅
d(x, 𝑪𝑩 ) < d(x, 𝑪𝑹 ) => 𝑩
𝑩 𝑹
d(x, 𝑪𝑩 ) d(x, 𝑪𝑹 )
--------- ---------
𝐶𝐵 ? 𝑥 σ σ
Binary
Classification σ 𝒌
(𝑿 𝑹
𝒊 − µ 𝑹 )𝟐
σ𝟐 = 𝒊=𝟏
𝐶𝑅 𝒌
σ𝒌𝒊=𝟏 𝑿𝑹
𝒊
µ=
𝒌
P( = ) = 0.6
P( = ) = 0.4
When h=0 ; P= 1/ (1+exp^(-h)) =1/2 =0.5
h is large +ve value exp^(-h) is very small = 1/1= thus probability of getting a Blue is
100%
h is large -ve value exp^(-h) is very large thus probability =0 for getting a Blue is 0%
𝑆𝑜𝑓𝑡 𝐶𝑙𝑎𝑠𝑠𝑖𝑓𝑖𝑐𝑎𝑡𝑖𝑜𝑛
?
𝒙
1
P( = ) =
1+exp(−ℎ)
ℎ = 𝑋2 - m𝑋1 - C
Neural Networks
ℎ = 𝑤1 𝑥1 + 𝑤2 𝑥2 + 𝑐
v=𝜎 ℎ
x1 ℎ′ = 𝑤′1 𝑥1 + 𝑤′2 𝑥2 + 𝑐’
∗ ∗
ℎ∗ = 𝑤1 𝑣 + 𝑤2 𝑣 ′ + … . . +c
∗
∗ ∗
v′ = 𝜎 ℎ′ v =𝜎 ℎ
x2
ℎ𝑚 = 𝑤𝑚1 𝑥1 + 𝑤𝑚2 𝑥2 + 𝑐m
v𝑚 = 𝜎 ℎ𝑚
Regression
Polynomial Curve Fitting
Polynomial Curve Fitting
Polynomial Curve Fitting
+ 𝒘𝟑 𝒙𝟑
Polynomial Curve Fitting
Polynomial Curve Fitting
Over Fitting
References
[1] STTP on ‘Basics of IoT and AI’ course Material, IIT, Kanpur
[2] Christopher M Bishop: Pattern Recognition & Machine Leaning, Springer, pp. 362,
2006
[3]http://playground.tensorflow.org/#activation=tanh&batchSize=10&dataset=circle®
Dataset=regplane&learningRate=0.03®ularizationRate=0&noise=0&networkShape=4,
2&seed=0.58088&showTestData=false&discretize=false&percTrainData=50&x=true&y=tr
ue&xTimesY=false&xSquared=false&ySquared=false&cosX=false&sinX=false&cosY=fal
se&sinY=false&collectStats=false&problem=classification&initZero=false&hideText=fal
se