Monash University · FACULTY OF COMPUTER SCIENCE

ECE5179 Chap.1 Learning Types and Linear Regression

- one subject, every graph, every model, every mark
7 Chapters6-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 1 of 12 · ECE5179

Learning Types and Linear Regression

Week 1 sets out the kinds of learning problem, from supervised to self-supervised, traces the artificial neuron back to the McCulloch-Pitts model, and then develops linear regression as the first trainable model.

The chapter derives the closed-form least-squares line from the covariance and variance of the data, extends it to many features through the normal equations, and explains how the bias, the residuals and the shape of the data matrix decide which solution applies.

In this chapter

What this chapter covers

  • 01

    Supervised, unsupervised, semi-supervised and self-supervised learning

  • 02

    Regression versus classification targets

  • 03

    The McCulloch-Pitts neuron and the modern artificial neuron

  • 04

    Residuals and the mean squared error

  • 05

    Closed-form slope and intercept from covariance and variance

  • 06

    Normal equations, the pseudoinverse and bias augmentation

  • 07

    Overdetermined and underdetermined systems

Worked example · free

Fit a least-squares line to five points

Q [6 marks]. Fit ŷ = wx + b to the points (1, 2.1), (2, 2.9), (3, 4.2), (4, 4.8) and (5, 6.0), then find the residuals and the mean squared error. The mark allocation here is our own study weighting, not a University assessment scheme.
The fitted line and its residuals.The fitted line and its residuals. Black points are the data, the blue line is the least-squares fit, and each red segment is one residual; the third point has the largest gap.fit: w=0.97, b=1.09red: residualsinput xtarget y
The fitted line and its residuals. Black points are the data, the blue line is the least-squares fit, and each red segment is one residual; the third point has the largest gap.
  • 1Means: x̄ = 3 and ȳ = 4.0.
  • 1Covariance term: the products of deviations add to 9.7, so σ̂xy = 9.7/5 = 1.94.
  • 1Variance term: squared x deviations add to 10, so σ̂xx = 2.
  • 1Slope w = 1.94/2 = 0.97 and intercept b = 4.0 − 3 × 0.97 = 1.09.
  • 1Predictions 2.06, 3.03, 4.00, 4.97, 5.94 give residuals −0.04, +0.13, −0.20, +0.17, −0.06.
  • 1Squared residuals sum to 0.091, so the mean squared error is 0.0182.
The fitted line is ŷ = 0.97x + 1.09 with mean squared error 0.0182. The residuals sum to zero and the line passes through the mean point (3, 4.0), both of which confirm the arithmetic.
Sia tip — Before anything else, check that your line passes through (x̄, ȳ); if it does not, the intercept is wrong.
Glossary

Key terms

Supervised learning
Supervised learning fits a model to inputs that each come with a known target label.
Residual
A residual is the difference between a model's prediction and the true target for one sample.
Normal equations
The normal equations XᵀXw = Xᵀy are the conditions that the least-squares weights must satisfy.
Bias augmentation
Bias augmentation prepends a constant 1 to each input so the intercept becomes an ordinary weight.
FAQ

Learning Types and Linear Regression FAQ

Why does the least-squares line pass through the mean point?

Setting the derivative of the mean squared error with respect to the intercept to zero forces the residuals to average zero. That condition gives b = ȳ − w x̄, and substituting x̄ into the line returns ȳ exactly. Checking this property is a quick way to catch an arithmetic slip in a hand-fitted line.

When can I not use the normal-equation formula?

The formula needs XᵀX to be invertible, which fails when features outnumber samples or when some features are exact combinations of others. With more features than samples the lecture notes switch to the minimum-norm solution, which fits the data exactly while keeping the weights as small as possible.

Does a large regression weight mean a feature causes the target?

No. A weight measures how the prediction changes with a feature while the others stay fixed, and that only compares fairly across features after standardising them. Even then it describes association in the fitted model, not causation, which the lecture notes stress explicitly.

How is self-supervised learning different from unsupervised learning?

Both start without human labels, but self-supervised learning creates a prediction target from the data itself, for example hiding part of an input and predicting it. That turns the problem into a supervised one with automatically generated labels, which is the idea later used to pre-train large language models and encoders such as BERT.

What did the McCulloch-Pitts neuron contribute?

Proposed in 1943, it modelled a neuron as a unit with binary inputs that fires when enough excitatory inputs are active and no inhibitory input vetoes it. Networks of such units can realise AND, OR and NOT and therefore any logical function, the starting point for the weighted-sum-and-activation neurons used today.

Study strategy

Exam move

Fit at least one small data set completely by hand: means, deviations, covariance, variance, slope, intercept, residuals and error, keeping every intermediate sum visible. Then redo it from summary statistics alone, which is how studio questions often present the data.

For the matrix form, practise stating the shape of every object, X, Y, XᵀX and W, for a few made-up sizes before touching any formula, and decide each time whether the system is over- or underdetermined. Finish by explaining in one sentence what the slope means in the units of the problem.

A useful self-test is to change one data point and predict, before recomputing, whether the slope rises or falls; the sign of that point's deviation product tells you. When the notes switch to matrices, translate each scalar step into its matrix counterpart: means become column averages, the covariance ratio becomes XᵀX and Xᵀy, and the intercept becomes the weight on the augmented column of ones.

Working through Learning Types and Linear Regression in ECE5179? Sia is AskSia’s AI Computer Science tutor — ask any ECE5179 Learning Types and Linear Regression question and get a clear, step-by-step explanation grounded in how ECE5179 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 161 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your ECE5179 tutor, unlimited, worked the way the exam marks it
The full 6-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
ECE5179 · Neural networks and deep learning - independent study guide on the AskSia Library. More Monash University subjects · Microeconomics across all universities