Machine Learning Part 1 - Regression
Machine Learning Part 1 - Regression
1
Vocabulary
Regression
Classification
Loss Function
Continous
Discrete
2
Machine Learning Part 1
3
Types of Supervised Learning
အေမး။ ။ မနက်ြဖန်ရာသီဥတု
ဘယ်လို ရှ ိ မလဲ။
5
Regression: California Housing Price Prediction
https://colab.research.google.com/drive/1WPZgBe2x
AZD3MJVbvsvGntE07h4_dOFv?usp=sharing 6
7
2. Data Understanding
8
3. Data Preprocessing
9
10
Model တစ် ခု ေဆာက်ဖို့
ဘာေတွ လိလ ု ဲ?
11
4. Modeling
12
5. Evaluation
13
Housing Price Housing Price Value for MAE Value for MSE
True/ Original), y Predicted, ypred |y-ypred|
100 150
150 140
Housing Price Housing Price Value for MAE Value for MSE
True/ Original), y Predicted, ypred |y-ypred|
100 100
150 140
14
15
Cont’d
16
Cont’d
17
Contʼd
18
19
20
Simple Linear Regression
y = mx + b
21
Simple Linear Regression
y = b0+b1x
22
Multiple Linear Regression
y = b0 + b1 * x1 + b2 * x2 + …
23
Letʼs see how we evaluate our hypothesis
function (model) in regression!
For Regression
For Regression
For Regression
1. 2.
1. $120K
2. $130K
3. $210K 2 rooms, 25 m2 4 rooms, 34 m2
4. $202K
3. 4.
8 rooms, 45 m2 7 rooms, 40 m2
Step 1
The machine calculates the overall cost of the model.
1. 2.
1. $120K
2. $130K
3. $210K $320K $410K
4. $202K
3. 4.
$730K $698K
Step 1 Cost = 8.5
The machine calculates the overall cost of the model.
1. 2.
Cost = 8.5😥
$320K $410K
3. 4.
$730K $698K
Step 1 Cost = 8.5
The machine updates the previous model to minimize the cost.
1. 2.
$320K $410K
3. 4.
$730K $698K
Step 2
The machine gives answers based on the updated model.
1. 2.
1. $200K
2. $280K
3. $490K 2 rooms, 25 m2 4 rooms, 34 m2
4. $478K
3. 4.
8 rooms, 45 m2 7 rooms, 40 m2
Step 2
The machine calculates the overall cost of the model.
1. 2.
1. $200K
2. $280K
3. $490K $320K $410K
4. $478K
3. 4.
$730K $698K
Step 2 Cost = 4
The machine calculates the overall cost of the model.
1. 2.
Cost = 4🤔
$320K $410K
3. 4.
$730K $698K
Step 2 Cost = 4
The machine updates the previous model to minimize the cost.
1. 2.
$320K $410K
3. 4.
$730K $698K
Step 3
The machine gives answers based on the updated model.
1. 2.
1. $300K
2. $369K
3. $695K 2 rooms, 25 m2 4 rooms, 34 m2
4. $675K
3. 4.
8 rooms, 45 m2 7 rooms, 40 m2
Step 3
The machine calculates the overall cost of the model.
1. 2.
1. $300K
2. $369K
3. $695K $320K $410K
4. $675K
3. 4.
$730K $698K
Step 3 Cost = 1.6
The machine calculates the overall cost of the model.
1. 2.
Cost = 1.6😄
$320K $410K
3. 4.
$730K $698K
Now, the machine has reasonable intelligence to predict house
prices even if it is shown new data it has never seen before during
training.
$650K
6 rooms, 38 m2
How Machines Get the Most Optimal Model
5. Go to Step 2 again.
44
No Quiz, But Survey Form For this Month
https://forms.gle/efDdP2LFnkeGir7i9
45
Recall
46
Thank You
47
Linear Regression
https://colab.research.google.com/drive/1PLPSu12QRpNO7WFPjIhlNoy9tj37Oos2?usp=sh
aring (Please write code)
48
Simple Linear Regression
y = b0 + b1 * x
b0 = mean(y) – b1 * mean(x)
49
Hey Let’s Take a Look
50
Cont’d
51
Godlilocks
52
Cont’d
53
Cont’d
54
55
Derivative of Mean Square Error (White Board)
56
Cont’d
57
Simple Linear Regression from Scratch
https://colab.research.google.com/drive/1rQmiJIhJLgNfQBUzhIYPfPEfR1-7A9lo?usp=shari
ng
58
Pre
https://colab.research.google.com/drive/1msrzlXVpyGhET-gHkuEaRjUn7toyDhPM?usp=sh
aring
59
Linear Regression from Scratch
https://colab.research.google.com/drive/1AsYjpUUdUtyYGKPKSs5i7Asrq-5AL0iY?usp=shar
ing
60
Regression
61
Which one is better?
62
Con’t
In machine learning, when are are teaching machines, we are finding rules by giving data and
labels..
63