Module III – Linear Regression, Regularization, and Cross Validation

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:55 PM on 10/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

Machine learning taxonomy

knowt flashcard image
2
New cards

Regression

  • kind of supervised learning

  • y = f(x,ϕ)


3
New cards

y

  • target variable

  • output variable, dependent variable, labels

  • scalar (i.e., a number)

  • can be continuous or discrete


4
New cards

x

  • input variable

  • aka descriptors, features, independent variables

  • can be continuous or discrete

  • vector (i.e., can be many values for each instance


5
New cards

f

model → typically choose linear model

6
New cards

ϕ

  • model parameters

  • often also called w or β

  • vector (i.e., can be many)


7
New cards

Types of Regression Models

knowt flashcard image
8
New cards

Assumptions of Linear Regression

knowt flashcard image
9
New cards

Linearity

  • relationship between independent and dependent variables is linear

  • change between each is proportional


<ul><li><p>relationship between independent and dependent variables is linear</p></li><li><p>change between each is proportional</p></li></ul><p></p>
10
New cards

Homoscedasticity

  • spread of errors should be relatively uniform, regardless of predictor value

  • residuals maintain constant variance across all independent variables


<ul><li><p>spread of errors should be relatively uniform, regardless of predictor value</p></li><li><p>residuals maintain constant variance across all independent variables</p></li></ul><p></p>
11
New cards

Linear Regression Model Form ****

knowt flashcard image
12
New cards

Human learning

  • guessing

  • trying diff combos of phi0 and phi1 to find line of fit


<ul><li><p>guessing</p></li><li><p>trying diff combos of phi0 and phi1 to find line of fit</p></li></ul><p></p>
13
New cards

Loss Function

  • optimal parameters phi are those that minimize L(phi)

  • best model has minimal loss

  • sum of square error loss


<ul><li><p>optimal parameters phi are those that minimize L(phi)</p></li><li><p>best model has <strong>minimal loss</strong></p></li><li><p>sum of square error loss</p></li></ul><p></p>
14
New cards

gradient descent

  • optimization algorithm used to train machine learning models by minimizing errors by playing w phi0 and phi1 to map out loss surface

  • We ask the model to search for the values of phi that minimize L(phi)

  • One way to do this is by gradient descent on the loss surface.


<ul><li><p>optimization algorithm used to train machine learning models<span> by minimizing errors by playing w phi0 and phi1 to map out loss surface</span></p></li><li><p>We ask the model to search for the values of phi that minimize L(phi)</p></li><li><p>One way to do this is by gradient descent on the loss surface.</p></li></ul><p></p>
15
New cards

linear regression w/ nonlinear features

knowt flashcard image
16
New cards

choosing what features to use

  • Select features based on the data or the physics (e.g., a harmonic spring needs a quadratic term)

  • Try many features and pare down to those that decrease the loss the most

  • Trade-off model accuracy (low loss) and complexity (more features)

  • Check performance on new data to see how model performs? Use regularization or cross validation!


17
New cards

regularization

  • encourages a complex model to avoids over-fitting and find simpler solutions in the Goldilocks Zone

  • popular method is adding penalty term to cost function to punish large or non-zero coefficients


18
New cards

under-fitting

  • too simple to capture underlying pattern in data


<ul><li><p>too simple to capture underlying pattern in data</p></li></ul><p></p>
19
New cards

optimal-fitting

  • just right number of parameters needed


<ul><li><p>just right number of parameters needed</p></li></ul><p></p>
20
New cards

over-fitting

  • model is too complex relative to training data available

  • high accuracy on training data but low accuracy on test data

  • train loss (MSE) low but validation loss (MSE) high!


<ul><li><p>model is too complex relative to training data available</p></li><li><p>high accuracy on training data but low accuracy on test data</p></li><li><p>train loss (MSE) low but validation loss (MSE) high!</p></li></ul><p></p>
21
New cards

regularized linear regression loss function

  • lamda (hyperparameter) is the strength of regularization (or punish the model)

  • view the regularized linear regression loss function as a generalization of our standard linear regression loss function

  • lamda controls the trade-off between fitting the data well (first term) and minimizing the size of the coefficients (second term)

  • For lamda =0 we recover the standard linear regression least squares loss. For lamda > 0 we apply a penalty that tends to shrink the coefficients to zero.


<ul><li><p>lamda (hyperparameter) is the <strong>strength</strong> of regularization (or punish the model)</p></li><li><p>view the regularized linear regression loss function as a generalization of our standard linear regression loss function</p></li><li><p>lamda controls the trade-off between fitting the data well (first term) and minimizing the size of the coefficients (second term)</p></li><li><p>For lamda =0 we recover the standard linear regression least squares loss. For lamda &gt; 0 we apply a penalty that tends to shrink the coefficients to zero.</p></li></ul><p></p>