Your first task is to encode a gradient descent algorithm for learning a logistic regression model. Your function should take as input a matrix X, where each row corresponds to a training example,

HW2
Q1
100 Points
Overview and Assignment Goals:
The objectives of this assignment are the following:
— Implement an optimization method (gradient descent) that allows you to train logistic regression models.
— Better understand the relationship between the optimization objective (cross-entropy error), training set error, and test set error, and how these relate to generalization.
— Understand the impact of parameters and design choices on the convergence and performance of the gradient descent algorithm and the learned models.
— Effectively communicate technical results in writing.
Detailed Description:
Your first task is to encode a gradient descent algorithm for learning a logistic regression model. Your function should take as input a matrix X, where each row corresponds to a training example, and a column vector y where each row corresponds to a label, and return the learned weight vector w (which should have one more element than each training example, with the convention that this first element represents the intercept), the cross-entropy error, and the classification (0/1) error it achieved on the training set. Use a learning rate eta = 10A{-5) and automatically terminate the algorithm if the magnitude of each term in the gradient is below 10A{-3} at any step.
Choose Files No file chosen
https://www.gradescope.com/courses/365938/assignments/1860475/submissions/new
1/4
2/26/22, 5:08 PM
Submit HW2 | Gradescope
You will train and test your model on the -Cleveland- dataset, which you can learn more about here: https://archive.ics.uci.edu/ml/datasets/Heart+Disease The dataset is available on Miner.
Run experiments where you learn logistic regression models on the training set when using three different bounds on the maximum number of iterations: ten thousand, one hundred thousand, and one million. In your writeup, report all four of the following: (1) the crossentropy error on the training set (2) the classification error on the training data (3) an estimate of the classification error on the test data obtained using Miner (4) the time it took to train your model. In your report, discuss the generalization properties (the difference between training and test set classification errors) of the model. How does this relate to the cross-entropy error on the training set?
Now train and test a logistic regression model using whichever library you used for Homework 1. Compare the results with the best ones you achieved and also compare the time taken to achieve the results.
Finally, scale each of the features in your training data by subtracting the mean and dividing by the standard deviation for each of the features in advance of calling the training function. Experiment with the learning rate eta (you may want to start by trying different orders of magnitude), this time using a tolerance (how close to zero you need each element of the gradient to be in order to terminate) of 10A{-6}. Report the results in terms of number of iterations until the algorithm terminates, and also the final cross-entropy error. Spend some time discussing and analyzing your results in your writeup.
Rules:
This is an individual assignment. Discussion of broad level strategies is allowed but any copying of prediction files and source codes will result in honor code violation. Feel free to use the programming language of your choice for this assignment. We suggest using Python.
You should submit your code. The TAs should be able to run your Choose FilesjfiQWiSMjfegflSultS.
https://www.gradescope.com/courses/365938/assignments/1860475/submissions/new
2/4
2/26/22, 5:08 PM
Submit HW2 | Gradescope
Deliverables:
Valid submissions to the http://miner2.vsnetgmu.edu website.
Gradescope submission of your report and your source code. Your source code should be submitted as a single zip file called HW2_LastName.zip. It should contain instructions for running your code in a readme file.
You must also submit, as a PDF file, a maximum 2-page, single-spaced report with details about your experimental results and interpretation, as detailed above. You should also include any relevant details you wish about your implementation. Be sure to include your Miner username at the top of your report.
Grading:
Grading for the assignment will be based on the correctness of your implementation (50%), and the contents of your report (50%).
Q1.1 Implementation
50 Points
Submit a zip file with your source code.
Please select file(s) Select file(s)
Save Answer
Q1.2 Report
50 Points
Submit your PDF report here
0 Please select file(s)
Save Answer
Select file(s)
https://www.gradescope.com/courses/365938/assignments/1860475/submissions/new
3/4
2/26/22, 5:08 PM
Submit HW2 | Gradescope
Q1.3 Miner Username
0 Points
Please type your Miner username here.
Enter your answer here
Save Answer
Save All Answers
Submit & View Submission
https://www.gradescope.com/courses/365938/assignments/1860475/submissions/new
4/4

Looking for answers ?

Chat with us at get the answers

Recent Questions

Hello,Please can you give me your best offer for the attached assignment in International Human Resource, and I would like to know if payment via paypal are aaccepted.Waiting for your suport.RegardsChoose…TaskYou are employed in the Finance Division of a large multinational consulting firm. The Director of Foresight has learned that you followed the specialist pathway Carbon Management and Entrepreneurship…EDF5905 Assessment 1: Research paper on literacy and/or numeracyDue date: Friday 1st April 2022 at 11.55pmWord count/equivalent: 4000 words Weighting/Value: 50%Assessment task link to unit learning outcomes:This…i have attacched assessment questions here. 6 assessment. Deadline 20 April 2022.Reaction #2_Power_COM 555.docxASSIGNMENT: Reaction Paper # 2 – Culture and PowerDUE: Thursday, March 4, 2022 AT NOON To provide some context, read one of these articles about power and organizational culture:Organizational…Assessment 1: Case Study – Mrs Kristy Parkes50%1800 wordsReference: APA 7- 15 referenceUsing clinical reasoning cycle and Roper Logan Tierney (RLT) modelto reflects on the case study and answer the questions.Case…Return and Risk (100 points)Complete the following problems:Problem #1:You are the investment consultant for a Saudi Arabian hospital to assess the risk for its future investments.There are three potential…Show All Questions

GET HELP WITH YOUR HOMEWORK PAPERS @ 25% OFF

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

Write My Paper Button

WeCreativez WhatsApp Support
We are here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top