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

  1. Training set = data used to train the model (the table)
  2. = “input” variable / feature / input feature
  3. = “output” variable / “target” variable / true value in data set
  4. = single training example
  5. = ith training example (e.g., 1st, 2nd, 3rd)
  1. (not exponent) (Not power)
  2. i = index

Training Process Flow

Training Set -> berisi features & targetsLearning Algorithm

  • Input:
  • Proses: (Fungsi/Model)
  • Output: (“y-hat”)

Fungsi ini juga disebut Hypothesis Function. (Historically, awalnya)


Konsep dan Terminologi

  • Alur Umum: FeatureModelPrediction

  • Contoh pada Harga Rumah: SizefPrice

    • 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).

References