Show that the gradient Descent algorithm for logistic regression: Gradient Descent $J(\theta) = -\frac{1}{m} \sum_{i=1}^{m} [y^{(i)} \log h_{\theta}(x^{(i)}) + (1 - y^{(i)}) \log (1 - h_{\theta}(x^{(i)}))]$ Want $min_{\theta} J(\theta)$: Repeat {$\theta_j := \theta_j - \alpha \frac{\partial}{\partial \theta_j} J(\theta)$ } (simultaneously update all $\theta_j$) Looks identical to linear regression: Repeat {$\theta_j := \theta_j - \alpha \sum_{i=1}^{m} (h_{\theta}(x^{(i)}) - y^{(i)})x_j^{(i)}$ } (simultaneously update all $\theta_j$)
Added by Nicholas L.
Close
Step 1
J(θ) = -1/m [∑(i=1 to m) y^(i) log hθ(x^(i)) + (1-y^(i)) log(1-hθ(x^(i)))] where hθ(x^(i)) is the hypothesis function for logistic regression: hθ(x^(i)) = 1/(1+e^(-θᵀx^(i))) Show more…
Show all steps
Your feedback will help us improve your experience
Wei Yang and 70 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
The first formula is the loss function of the linear regression model. L(w,b) = ̑ (y(i) - h(x(i)))^2 where h(x) = wx + b. The loss function of the logistic regression model is: L(w,b) = ̑ y(i) log(h(z(i))) + (1 - y(i)) log(1 - h(z(i))) . (2) i=1 where h(z) = 1 / (1 + e^(-z)). Please prove that although both models have different loss functions, their optimizations are the same since they have the same derivatives: ∂L(w,b) / ∂w = 2̑ (h(x(i)) - y(i))x(i) and ∂L(w,b) / ∂b = 2̑ (h(x(i)) - y(i)).
Sri K.
Show, in the case of a least squares fit to the simple linear regression model $$ Y_{i}=\beta_{0}+\beta_{1} x_{i}+\epsilon_{i}, \quad i=1,2, \ldots, n $$ that $\sum_{i=1}^{n}\left(y_{i}-\hat{y}_{i}\right)=\sum_{i=1}^{n} e_{i}=0 .$
Simple Linear Regression and Correlation
Correlation
Show that in the case of a least squares fit to the simple linear regression model $Y_{i}=a+\beta x_{i}+\epsilon_{i}, \quad i=1,2 \ldots . \mathrm{n}$ that $\sum_{i=1}^{4}\left(y_{i}-\hat{y}_{i}\right)=\sum_{i=1}^{\infty} e_{i}=0$
Prediction
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD