In the logistic regression, for an intercept $$\beta_0\in R$$,parameter vector $$\beta=\left(\beta_0,\beta_1,...,\beta_p\right)\in R^p$$ , target $$y_i\in\left\{0,1\right\}$$, and feature vector $$x_i=\left(x_{i1},x_{i2},...,x_{ip}\right)^T\in R^p$$ for i = 1, . . . , n, the (l2-regularized) log-loss that we will work with is: $$L\left(\beta_{0,}\beta\right)=\frac{1}{2}\beta^T\beta+\frac{\lambda}{n}\Sigma\left[y_i\ln\left(\frac{1}{\sigma\left(\beta_0+\beta^Tx_i\right)}\right)+\left(1-y_i\right)\ln\left(\frac{1}{1-\sigma\left(\beta_0+\beta^Tx_i\right)}\right)\right]$$ where $$\sigma\left(z\right)=\left(1+e^{-z}\right)^{-1}$$ How to calculate the gradient?
Asked
Active
Viewed 87 times
2
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 05 '22 at 04:49