Multimedia & Machine Learning Algorithms · Multimedia Algorithms
Linear & Logistic Regression — Mathematical Foundations
Explanation
Linear Regression — Least Squares
Given pairs , approximate (or vectorially ).
Objective function (MSE / RSS):
Derivation of the closed-form solution: differentiate :
provided is invertible (columns of linearly independent).
Geometric interpretation: is the orthogonal projection of onto the column space of . The residual vector is perpendicular to every column of : .
Evaluation Metrics
MSE (Mean Squared Error):
R² (Coefficient of Determination):
(for OLS on training data with intercept): value — perfect fit; value — model no better than predicting . Outside these conditions (test data, no intercept) can be negative.
Logistic Regression — Binary Classification
Problem: predict binary label . The model outputs a probability:
The sigmoid maps .
Binary Cross-Entropy Loss:
Gradient Descent: no closed form — use the gradient. For a single point :
Update: , .
Sigmoid property: — a convenient identity used in deriving the gradient.
Interactive Visualization
Loading visualization
Worked Examples
Practice
Exercise 1 of 6
1
Given: and .
Compute the MSE. Give the exact answer (as a fraction).
★Compute the MSE. Give the exact answer (as a fraction).
Quiz
Test your knowledge from this lesson
A mix of questions from the lesson — each attempt varies slightly
Answer at least 4 out of 5 questions correctly to pass (70%)