Given the following data for a binary classification problem (including a "ones column" pre-pended to the data): and ini
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Given the following data for a binary classification problem (including a "ones column" pre-pended to the data): and ini
Part 2:
Given the following data for a binary classification problem (including a "ones column" pre-pended to the data): and initial weights for a logistic regression: answer the following questions. 20 1 -1 1 1 1 #1 x2 2 IN -3 0 -3 1 -1 1 Wo W1 W2 Y 3 -2 1 -3 1 1 2
Assuming a threshold of 0.5, compute zi, P(y₁ = 1x₁), and ŷ; (0 or 1) for each sample, then indicate whether the output of the classifier is correct or not. 20 1 x1 x2 Y 1 -1 1 0 -3 1 -1 1 -3 -2 1 1 -3 1 1 Z number (2 number (2 number (2 number (2 P(y = 1|x) number (2 number (2 number (2 number (2 ŷ (0 or 1) integer integer integer integer Correct? O Yes O No O Yes O No O Yes No O Yes O No
The logistic regression learns the coefficient vector w to minimize the binary cross-entropy loss function n L(w) = -(y, log- 1 1+e-(w,z₁) i=1 Then, to minimize this loss function, the gradient descent update rule is n Wk+1 = Wk + a[yi- the new weight vector if a = 0.2: wo + (1 - y₁) log number (2) For the data and initial weight vector given above, compute the binary cross-entry loss: L = number (3 digits after decimal) W1 1 1+e-(wki) number (2) e-(w,zi) 1+e-(w,zi) and the binary cross-entropy loss for this new weight vector: L = number (3 digits after decimal) W2 Xi number (2)