Logistic Regression
Learning Objectives
Linear Regression for Classification
Classification
Classification
Classification
Classification
Classification
Quiz
Correct: This is an example of binary classification where there are two possible classes (True/False or Yes/No or 1/0).
Classification with Logistic Regression
Logistic Regression
Logistic Regression
Interpretation of Logistic Regression Output
Quiz
Decision Boundary
Non-Linear Decision Boundaries
Non-Linear Decision Boundaries
Quiz
Correct: You would not want to miss a potential tumor, so you will want a low threshold. A specialist will review the output of the algorithm which reduces the possibility of a ‘false positive’. The key point of this question is to note that the threshold value does not need to be 0.5.
Quiz
This task predicts one of two classes, malignant or not malignant.
Quiz
Quiz
Think of g(z) as the probability that the photo is of a cat. When this number is at or above the threshold of 0.5, predict that it is a cat.
Quiz
The decision boundary can also be non-linear, as described in the lectures.
Cost Function for Logistic Regression
Training Set
Squared error cost
Logistic Loss Function
Logistic Loss Function
Cost
Quiz
If using the mean squared error for logistic regression, the cost function is "non-convex", so it's more difficult for gradient descent to find an optimal value for the parameters w and b.
Simplified loss function
Simplified Cost function
Quiz
The second term of the expression is reduced to zero when the target equals 1.
Quiz
LOSS
COST
BOTH LOSS AND COST
NEITHER LOSS AND COST
In these lectures, loss is calculated on a single training example. It is worth noting that this definition is not universal. Other lecture series may have a different definition.
Quiz
Gradient Descent for Logistic Regression
Training Logistic Regression
Gradient Descent
Gradient Descent for Logistic Regression
Quiz
Regularization to overfitting
Regression Example
Classification
�Quiz
Addressing Overfitting
Collect more training examples
Select features to include or exclude
Regularization
Quiz
These methods can help the model generalize better to new examples that are not in the training set.
Intution
Intution
Regularization
Regularization
Quiz
Regularised Linear Regression
Implementing gradient descent
Implementing gradient descent
Implementing gradient descent
Quiz
Regularised Logistic Regression
�Regularised Logistic Function
Quiz
Quiz
Quiz