Sem2 Week 3
No description yet. This curated deck is ready for daily study.
Card preview (24)
What is a classification problem?
Assigning an input to one of a finite set of categories
How is a decision boundary represented mathematically (1D case)?
y = 1 if x > t, y = 0 if x ≤ t, where t is a threshold value
How does a decision boundary generalise from 2D to ND?
In 2D it is a line; in 3D a plane; in N dimensions it becomes a hyperplane — an (N−1)-dimensional surface dividing the space
What is a perceptron?
A simple binary classifier that computes a weighted sum of its inputs, adds a bias, and passes the result through a step function to produce a 0 or 1 output. i.e. given some input, it outputs either 0 or 1
Describe the perceptron diagram
Inputs x₁…xₙ each multiplied by weights w₁…wₙ, summed together with a bias b, then passed through an activation function (step function) to give output ŷ
What is the perceptron output equation?
ŷ = f(w·x + b), where f is the step function: f(z) = 1 if z > 0, else 0 (z = w₀ + w₁x₁ + w₂x₂ + … = Σ wᵢxᵢ)
What does each term in the perceptron learning rule represent?
η = learning rate (step size); y = true label; ŷ = predicted label; (y − ŷ) = error signal; xᵢ = input feature
When does the perceptron learning rule make no update?
When ŷ = y (prediction is correct) — the error term (y − ŷ) = 0, so weights are unchanged
What is the limitation of a perceptron’s decision boundary?
It can only represent a linear decision boundary — it cannot classify data that is not linearly separable (e.g. XOR problem)
What is a decision boundary?
The point, line, or surface at which a model changes its output — e.g. in a spam filter, the exact boundary between ‘spam’ and ‘not spam’
How does sigmoid improve on the step function?
The step function gives a hard 0 or 1 with no gradient; sigmoid gives a smooth curve between 0 and 1, making it differentiable and suitable for learning
How can non-linearly separable data be made separable?
By engineering new features — e.g. squaring inputs for circular clusters, taking products x₁x₂ for multiple features, or using log transforms for exponentially distributed data
How many decision boundaries does a perceptron define given a fixed set of weights?
Exactly one — a specific set of weights corresponds to exactly one decision boundary
How many sets of weights can produce a given decision boundary?
Infinitely many DB exists when output = 0 Rearranging equation shows two pairs of linearly dependant weights give the same boundary e.g. w₀=4, w₁=2 and w₀=2, w₁=1 both place the boundary at x₁ > -2; any positive scalar multiple works
What happens to the classification labels if you negate all weights of a perceptron?
The decision boundary stays in the same position but the labels flip — what was class 1 becomes class 0 and vice versa
What is the perceptron learning problem?
Given labelled observations of x and y, find a set of weights such that the perceptron correctly classifies all data points
What is the general form of the perceptron weight update rule?
w_new = w_old + Δw, where weights are adjusted iteratively until the perceptron classifies correctly
Why is Δwᵢ = error alone insufficient as a weight update rule?
It only accounts for the sign of the error but ignores the sign and magnitude of the input xᵢ, so updates can move weights in the wrong direction
Why does the perceptron update rule multiply error by xᵢ?
To account for the sign and magnitude of the input — if xᵢ is negative, decreasing wᵢ increases the weighted sum, which multiplying by xᵢ handles automatically
What is the role of the learning rate η in the perceptron update rule?
It is a constant that scales the size of each weight change, controlling how aggressively the perceptron updates its weights each step
Write the full perceptron update rule
Δwᵢ = η(y_true − y_predicted)xᵢ
When does the perceptron update rule make no change to a weight?
When y_true = y_predicted — the error term is zero so Δwᵢ = 0 and the weight is unchanged
What is the convergence guarantee of the perceptron learning rule?
It is guaranteed to converge to a correct solution for any linearly separable n-dimensional dataset — but makes no guarantee if the data is not linearly separable
2 solutions to nonlinear separable datasets
manipulate data, or get more perceptrons