Join at slido.com�#2060756
The Slido app must be installed on every computer you’re presenting from
Do not edit�How to change the design
2060756
Linear Regression (1)
Lecture 6
Model, error function, normal equations, geometry, evaluation, and regularization
EECS 189/289, Fall 2026 @ UC Berkeley
Joseph E. Gonzalez and Narges Norouzi
Fitting a Straight Line to Non-Linear Data
2060756
Roadmap
2060756
Linear Regression
2060756
Linear Regression Outline
L
LEARNING PROBLEM
M
MODEL DESIGN
O
OPTIMIZATION
P
PREDICT & EVALUATE
L
M
P
O
Supervised learning of scalar target values
2060756
Learning Problem
L
LEARNING PROBLEM
L
Supervised learning of scalar target values
2060756
Regression
Domain
Model
2060756
Model Design
L
LEARNING PROBLEM
M
MODEL DESIGN
L
M
Supervised learning of scalar target values
2060756
Supervised Linear Regression
2060756
The Simplest Linear Regression Model
Slope (rate of change)
Intercept (shift)
Predicted output
2060756
The Simplest Linear Regression Model
Predicted output
2060756
Which of the following is a linear regression model?
The Slido app must be installed on every computer you’re presenting from
Do not edit�How to change the design
2060756
Basis Functions
2060756
Linear Functions From Slido
These are all linear models with different basis functions.
We will now see what basis functions are…
2060756
What Does It Mean To Be a Linear Model?
In what sense are the previous plots linearly modeled?
Are linear models linear in the
2060756
Are linear models linear in the ...
The Slido app must be installed on every computer you’re presenting from
Do not edit�How to change the design
2060756
What Does It Mean To Be a Linear Model?
In what sense are the previous plots linearly modeled?
Are linear models linear in the
Feature Functions
Linear in the Parameters
2060756
Basis Functions
2060756
More on Basis Function
2060756
Comparing Basis Function Families
2060756
Vectorizing Calculations
2060756
Vectorizing Calculations
2060756
Vectorizing Calculations
2060756
Matrix Notation
2060756
Matrix Notation
Design matrix
2060756
Error Function
2060756
Optimization
L
LEARNING PROBLEM
M
MODEL DESIGN
O
OPTIMIZATION
L
M
O
Supervised learning of scalar target values
2060756
Error Function Visualization
2060756
Error Function
2060756
Error Function Visualization
2060756
Error Function Minimization
2060756
Error Function Minimization
Finding the optimum solution
2060756
Error Function Minimization
Separating the terms
2060756
Error Function Minimization
Separating the terms
2060756
Error Function Minimization
Separating the terms
2060756
Error Function Minimization
Reordering
2060756
Error Function Minimization
Takeaway
Normal equations for the least squares problem
2060756
Geometric Interpretation
2060756
[Linear Algebra] Span
2060756
[Linear Algebra] Matrix-Vector Multiplication
=
…
=
…
=
+
+
+
…
2060756
Prediction Is a Linear Combination of Columns
2060756
What’s the geometry word for ‘closest point in a subspace’?
The Slido app must be installed on every computer you’re presenting from
Do not edit�How to change the design
2060756
Length of the residual vector
2060756
Geometry of Least Squares in Plotly
2060756
[Linear Algebra] Orthogonality
…
…
=
…
…
2060756
Going Back to Our Error Function
Adding the definition of residual
Moving terms
Normal Equation
2060756
Evaluation
2060756
Predict and Evaluate
L
LEARNING PROBLEM
M
MODEL DESIGN
O
OPTIMIZATION
P
PREDICT & EVALUATE
L
M
P
O
Supervised learning of scalar target values
2060756
Evaluation - Visualization
2060756
Evaluation - Metrics
| |
| |
| |
| |
| |
2060756
Evaluation - Metrics
Mean Squared Error (MSE) | |
| |
| |
| |
| |
2060756
Evaluation - Metrics
Mean Squared Error (MSE) | |
Root Mean Squared Error (RMSE) | |
| |
| |
| |
Moves the metric back to the original unit of the data compared to MSE
2060756
Visualizing the Sum of Squared Error of Regression Model
54
Goal of regression: Make the total area of the boxes as small as possible.
2060756
Visualizing the Sum of Squared Error of Intercept Model
55
2060756
R2: Quality of the Fit Relative to Intercept Model
56
unitless and only compares performance relative to mean baseline
2060756
Linear Regression (1)
Lecture 6
Credit: Joseph E. Gonzalez and Narges Norouzi
Reference Book Chapters: Chapter 1.2, Chapter 4.[1.4-1.6]