logistic regression Flashcards

(32 cards)

1
Q

What is the main difference between regression and classification?

A

Regression predicts continuous values; classification predicts discrete labels.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What type of machine learning problem is predicting rainfall?

A

Regression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What type of classification problem has exactly two outcomes?

A

Binary classification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is multi-class classification?

A

Classification with more than two possible categories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is multi-label classification?

A

An input can belong to multiple classes simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Is predicting the number of ducks a classification problem?

A

No, it’s regression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What function is used in logistic regression to produce probabilities?

A

The sigmoid function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the formula for the sigmoid function?

A

g(z) = 1 / (1 + e^-z)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the hypothesis function for logistic regression?

A

hθ(x) = 1 / (1 + e^(-θᵀx))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does hθ(x) represent in logistic regression?

A

The probability that y = 1 given input x.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When do we predict class 1 in logistic regression?

A

When hθ(x) ≥ 0.5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why can’t we use linear regression for classification?

A

Because it can produce outputs outside the [0,1] range.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a decision boundary?

A

The dividing line where the model switches from predicting one class to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What equation defines the decision boundary in logistic regression?

A

θᵀx = 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is true when hθ(x) = 0.5?

A

The model is at the decision boundary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What kind of decision boundary does logistic regression produce?

A

A linear boundary.

17
Q

In the example θ = [-100, 1, 1], when is placement predicted?

A

When x₁ + x₂ ≥ 100

18
Q

What cost function does linear regression use?

A

Mean Squared Error (MSE)

19
Q

Why is MSE not used in logistic regression?

A

It creates a non-convex cost surface with the sigmoid function.

20
Q

What cost function is used in logistic regression?

A

Log-loss or binary cross-entropy.

21
Q

What is the formula for log-loss for a single example?

A

J(θ) = -y log(hθ(x)) - (1 - y) log(1 - hθ(x))

22
Q

Why is log-loss preferred over MSE in logistic regression?

A

Because it is convex and reliable to optimize.

23
Q

What happens to cost when the prediction is confidently wrong?

A

The cost becomes very high.

24
Q

What happens to cost when the prediction is confidently correct?

A

The cost is very low.

25
How does logistic regression handle more than two classes?
Using a One-vs-All (OvA) approach.
26
What does One-vs-All classification mean?
Training one model per class to distinguish it from all others.
27
How do we make a prediction in One-vs-All?
Choose the class with the highest output probability.
28
What is θ in logistic regression?
The vector of model parameters or weights.
29
What does θᵀx mean?
The dot product of the weights and input features.
30
What is a convex cost function?
A function with one global minimum, shaped like a bowl.
31
Why is a convex cost function useful?
Gradient descent can reliably find the global minimum.
32
What is a non-convex cost function?
One with multiple minima and saddle points, harder to optimize.