2025-09-18 20:14
Status: adult Tags: Machine Learning, Machine Learning Specialization
3 - Linear Regression Model (Supervised)
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:
House Prices and Sizes Data
| = 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 Process Flow
Training Set -> berisi features & targets
↓
Learning Algorithm
↓
- Input:
- Proses: (Fungsi/Model)
- Output: (“y-hat”)
Fungsi ini juga disebut Hypothesis Function. (Historically, awalnya)
Konsep dan Terminologi
-
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
Representasi Model: Linear Regression
Model yang paling sederhana bisa direpresentasikan dengan fungsi linear.
- = weight (bobot)
- = bias
Jika disederhanakan untuk satu variabel, menjadi:

Garis lurus adalah garis yang mencoba paling “pas” melewati tengah-tengah sebaran data tersebut.
Istilah Penting:
- 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).