3 - Linear Regression Model (Supervised)
2025-09-18 20:14
Status: #adult Tags: Machine Learning, Machine Learning Specialization
In essence, the Linear Regression Model is predicting an infinite number from many possible outputs.
Say, we want to predict house prices based on house sizes. See this data table:
| = Size (m2) | = Price ($1000) |
|---|---|
| 2104 (1) | 4000 (1) |
| 1416 (2) | 252 (2) |
| … | … |
| 3210 (47) | 870 (47) |
Notation
- Training set = data used to train the model (the table)
- = “input” variable / feature / input feature
- = “output” variable / “target” variable / true value in data set
- = single training example
- = ith training example (e.g., 1st, 2nd, 3rd)
- (not exponent) (Not power)
- i = index
Training Set -> berisi features & targets
↓
Learning Algorithm
↓
- Input:
- Proses: (Fungsi/Model)
- Output: (“y-hat”)
Fungsi ini juga disebut Hypothesis Function. (Historically, awalnya)
-
Alur Umum:
Feature→Model→Prediction -
Contoh pada Harga Rumah:
Size→f→Price- Input (feature): Ukuran rumah
- Output (prediction): Estimasi harga rumah
- Target: Harga rumah asli (true value) di training set
Model yang paling sederhana bisa direpresentasikan dengan fungsi linear.
- = weight (bobot)
- = bias
Jika disederhanakan untuk satu variabel, menjadi:
Pasted image 20250918212504.png
Garis lurus adalah garis yang mencoba paling “pas” melewati tengah-tengah sebaran data tersebut.
- Linear: Karena modelnya berbentuk garis lurus (bukan kurva/parabola).
- Linear Regression: Proses menemukan garis lurus terbaik untuk data.
- Univariate Linear Regression: Sebutan spesifik ketika kita hanya menggunakan satu variabel input (x) untuk melakukan prediksi. (Uni dalam bahasa Latin artinya satu).