关键词 > Python代写

Assignment 2 – Classification

发布时间:2021-11-20

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Assignment 2 – Classification


For Students Taking Machine Learning and Intelligent Data Analysis (Extended)


1 Gradient Descent (3 marks)

Carefully read the code provided in the Jupyter notebook build-logistic-regression-model.ipynb to work out what it is doing. Then, run the statement below to produce a Logistic Regression model for a problem where input variables can assume values in [0, 1]:

gradientDescent([[1,0.3,0.1],[1,0.3,0.2],[1,0.6,0.7], [1,0.8,0.2]], [0,0,1,1], 5, 0.1, 1000)

Is the resulting model appropriate for the task being learned? Justify your answer.

● Discuss one positive and one negative point regarding the choice of ar-guments in the Python statement above in the context of the problem being solved. Your discussion should be supported by evidence whenever possible.


Instructions:

● It is part of the question to think about what evidence you could provide to support your discussion.

You may add additional functions or lines of code to the Jupyter notebook to gather evidence to help you with answering this question.

If you do so, please submit the modified Jupyter notebook as part of your assignment, with Python comments explicitly showing which lines of code or functions you have added.

You must not use any external libraries, except for numpy, matplotlib, math and sys.


2 Newton-Raphson Weight Update Rule (3 marks)

Consider a problem where the following function is to be minimised:

E(x) = x4 − 5x − 3.

        Would the iterative application of the Newton-Raphson rule be likely to work well to find the optimum value of x for this problem? Justify your answer.


3 Multiclass Logistic Regression (4 marks)

We have learned in Lecture 7e one way to use Logistic Regression to deal with multi-class problems. Section 4.3.4 of Chris Bishop’s book on Pattern Recogni-tion and Machine Learning shows a different way. Briefly explain with your own words your understanding of how this method works and how it differs from the one learned in Lecture 7e.


Instructions:

You may use up to 400 words. Any text beyond 400 words will be consid-ered as not being part of the answer.

You do not need to type any equations – you can reference the equations of the book if you wish.

You do not need to explain Newton-Raphson or Iterative Reweighted Least Squares for this question. Reading until the calculation of the gradient in Eq. 4.109 is enough for the purpose of this question.

Note that Bishop’s book makes use of a different notation, where yn repre-sents the probability p1 for example n and tn represents the output value for example n. For the purpose of this assignment, you can also interpret φn as the vector of input values of example n.