Home / Expert Answers / Computer Science / implement-logistic-regression-for-binary-input-output-data-specifically-you-should-implement-the-g-pa823

(Solved): Implement Logistic Regression for binary input/output data. Specifically, you should implement the g ...



student submitted image, transcription available below

Implement Logistic Regression for binary input/output data. Specifically, you should implement the gradient ascent algorithm described in class.

Note that you will need to use an exponential function, e^x to implement Logistic Regression. In Python, you will find the function exp to be helpful:

import math
x = 5
math.exp(x)
# returns 148.4131591025766


Train your algorithm on the data file simple-train.csv. Use learning rate
?=0.0001 and 1,000 training steps. Test your algorithm on the data file simple-test.csv. You should be able to achieve 100% classification accuracy on the testing data.

simple_train.csv:

simple_test.csv:

student submitted image, transcription available below

Implement Logistic Regression for binary input/output data. Specifically, you should implement the gradient ascent algorithm described in class. Note that you will need to use an exponential function, to implement Logistic Regression. In Python, you will find the function exp to be helpful: import math math. \# returns 148.4131591025766 Train your algorithm on the data file simple-train.csv. Use learning rate 0.0001 and 1,000 training steps. Test your algorithm on the data file simpletest.csv. You should be able to achieve classification accuracy on the testing data. Answer Editor Python: 1 " " " 2 Write your code on your local computer and paste it here when you are ready 3 "" " \begin{tabular}{|c|c|c|c|} \hline & A & B & C \\ \hline 1 & & & Label \\ \hline 2 & 0 & 0 & 0 \\ \hline 3 & 0 & 1 & 0 \\ \hline 4 & 1 & 0 & 1 \\ \hline 5 & 1 & 1 & 1 \\ \hline 6 & & & \\ \hline 7 & & & \\ \hline \end{tabular}


We have an Answer from Expert

View Expert Answer

Expert Answer






We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe