Carry out a logistic regression analysis on a (partial) wine data set classification problem. The data can
Question:
Carry out a logistic regression analysis on a (partial) wine data set classification problem. The data can be loaded using the following code.
The model matrix has three features, including the constant feature. Instead of using Newton's method (5.39) to estimate \(\boldsymbol{\beta}\), implement a simple gradient descent procedure \[ \boldsymbol{\beta}_{t}=\boldsymbol{\beta}_{t-1}-\alpha abla r_{\tau}\left(\boldsymbol{\beta}_{t-1}\right) \]
with learning rate \(\alpha=0.0001\), and run it for \(10^{6}\) steps. Your procedure should deliver three coefficients; one for the intercept and the rest for the explanatory variables. Solve the same problem using the Logit method of statsmodels.api and compare the results.
Step by Step Answer:
Data Science And Machine Learning Mathematical And Statistical Methods
ISBN: 9781118710852
1st Edition
Authors: Dirk P. Kroese, Thomas Taimre, Radislav Vaisman, Zdravko Botev