Lecture 1 - Introduction & Linear Regression

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

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:21 PM on 9/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

39 Terms

1
New cards

Explain the aim of both supervised and unsupervised machine learning

Supervised Learning: aims to discover the relationship between an output variable y (e.g. the price of a house) and an input variable x (e.g. the size of the house) from a set of examples.

Unsupervised learning: there is no output variable y, we aim to find some structure in the x variable (e.g. we want to cluster customers in different groups depending on their characteristics).

2
New cards

State both the model and real-world supervised learning equations, and explain the objective of supervised learning in relation to these equations.


<p></p>
3
New cards

In general in supervised learning, how do we find the model function f-hat?

We first define a loss function that measures the error in predicted vs. realised outcome across the examples in our data set. We then select the f-hat function that minimises this loss function. Different supervised machine learning algorithms use different loss functions and strategies to find f-hat.

4
New cards

When people refer to ‘training’ a supervised machine learning model, what do they mean?

Training a supervised machine learning model refers to the finding of the f-hat function that results in the y-hat predicted outcomes that are closest to the true outcomes, using a set of examples.

5
New cards

What data must be used to test the performance of a supervised machine learning model?

The performance of the model must be evaluated on new data that have not been used to train the model.

6
New cards

State and explain the two types of supervised machine learning problems

knowt flashcard image
7
New cards

What is a linear regression problem?

knowt flashcard image
8
New cards

What is the goal of linear regression?

The goal of linear regression is to find the best linear relationship between the input and the output.

9
New cards

In what form does the function f-hat take in a linear regression model?

knowt flashcard image
10
New cards

State and write the f-hat form for the measure of the error used in linear regression.

knowt flashcard image
11
New cards

State and write the intermediate beta-hat form for the measure of the error used in linear regression.


<p></p>
12
New cards

State and write the final beta-hat form for the measure of the error used in linear regression.

knowt flashcard image
13
New cards

What do we we want to do with the measure of the error in linear regression?

knowt flashcard image
14
New cards

State the steps to compute an estimate beta-hat for the parameter beta.

  1. Derive the RSS with respect to the parameters.

  2. Set it equal to zero.

  3. Re-arrange so that everything is equal to y

  4. Convert to matrix form.

  5. Isolate beta by inverting the matrix.


15
New cards
<p>Compute an estimate beta-hat for this linear model in matrix form.</p>

Compute an estimate beta-hat for this linear model in matrix form.

knowt flashcard image
16
New cards

Name and give the formula for a measure of how well the linear regression model performs on the training data.

knowt flashcard image
17
New cards

Give another name for the coefficient of determination, explain what it measures and state the formula to calculate it.

Another name for the coefficient of determination is R-squared, which measures the fraction of variance of the training data that is explained by the model.

<p>Another name for the coefficient of determination is R-squared, which measures the fraction of variance of the training data that is explained by the model.</p>
18
New cards

Give the formula for the total sum of squares (TSS)

knowt flashcard image
19
New cards

If we have a “perfect” model, what will the RSS and R2 measurements be.

The RSS will be equal to 0, and the R2 will be equal to 1.

20
New cards

If we have the worst possible model, what will the RSS and R2 measurements be.

The RSS will be equal to the TSS, and the R2 will be equal to 0.

21
New cards

How do you interpret the R2 number?

The better the model, the closer R2 is to 1.

22
New cards

Name and give a formula for a good metric to measure the test (out-of-sample) performance of the linear model with.

knowt flashcard image
23
New cards

What is the vectoral expression for y in a linear regression model

knowt flashcard image
24
New cards

Does ordinary least squares provide an unbiased estimate of the beta parameters?

knowt flashcard image
25
New cards

Compute the expected value of the parameters / prove that E[Bhat] provides an unbiased estimate of B.

knowt flashcard image
26
New cards

State the cov[Bhat] in term of Bhat

knowt flashcard image
27
New cards

State the cov[Bhat] in matrix form

knowt flashcard image
28
New cards

Derive the cov[Bhat] in matrix form from the cov[Bhat) in term of Bhat form.

knowt flashcard image
29
New cards

State the formula for an unbiased estimator of σ2

knowt flashcard image
30
New cards

State the full expanded matrix formula for cov[Bhat]

knowt flashcard image
31
New cards

What is the form of a linear estimator of a parameter?

knowt flashcard image
32
New cards

When is an estimator betahat unbiased?

knowt flashcard image
33
New cards

State the Gauss-Markov theorem.

The Gauss-Markov theorem states that among all linear unbiased estimators, the least square estimator has the smallest variance.

34
New cards

Explain how gradient descent approaches optimisation

  • We want to find the minimum of the function (the red point in the figure).

  • We start from an initial guess, which can be any point (the black point in the figure).

  • We take a small step in the direction along which the function decreases the most and find our new guess (the orange point in the figure).

  • We start from the new guess and take a further step in the direction along which the function decreases the most.

  • We keep going until we reach convergence (e.g. the change in the objective function between two subsequent steps is smaller than a given threshold).


<ul><li><p>We want to find the minimum of the function (the red point in the figure).</p></li><li><p>We start from an initial guess, which can be any point (the black point in the figure).</p></li><li><p>We take a small step in the direction along which the function decreases the most and find our new guess (the orange point in the figure).</p></li><li><p>We start from the new guess and take a further step in the direction along which the function decreases the most.</p></li><li><p>We keep going until we reach convergence (e.g. the change in the objective function between two subsequent steps is smaller than a given threshold).</p></li></ul><p></p>
35
New cards

Explain what the gradient of a function is.

The gradient of a function is a vector whose components are the partial derivatives of the function along the coordinates. The gradient identifies the direction along which the function increases the most.

36
New cards

State the formula for the gradient of a linear regression.

knowt flashcard image
37
New cards

For linear regression, state the formula for the k-th component of the gradient.

knowt flashcard image
38
New cards

In relation to gradient descent, what does the parameter α do

α is the learning rate: a real positive parameter that we use to tune the length of the step that we take along the direction identified by the gradient.

39
New cards

For linear regression gradient descent, state the formula for the update to the ‘best guess’ betahatk

knowt flashcard image