Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi, please help me with these questions Question 1. [3 marks] Consider the problem of predicting the amount of rainfall that will take place on

image text in transcribedimage text in transcribedimage text in transcribed

hi, please help me with these questions

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Question 1. [3 marks] Consider the problem of predicting the amount of rainfall that will take place on a given day using linear regression [not logistic regression) based on two features: the average rainfall of the past seven days [271) and the average temperature of the past seven days [32). We've obtained a piece of data as shown in the table below: Feature :rl Feature 1'; Output y 1.5 1.8 1.9 2.9 3.2 3.3 1.0 We've randomly initialized the parameters 9 = 0.2 . We intend to use regularized linear 3.U regression with a value of A = 1.7 to create a predictive model for this problem. For now, we now want to compute the regularized cost corresponding to these initial 8 parameters. As a reminder, the expression for computing the regularized cost Jugs) for linear regression is given by: in date) = i Z (haliml mg + i Z a; 1:1 3:1 Your task in this question is to compute the cost using the expression above. Please note that this question is about LINEAR REGRESSION and not logis~ tic regression. Show your working fully and note that you should end up with a single value which is the cost. If necessary, round off your interiln values and nal answer to two decilnal places if and when need be. Question 3. [6 marks] Following on from the problem of predicting whether or not rainfall will take place using logistic regression on a given day based on two features: the average rainfall of the past seven days (331] and the average temperature of the past seven days (1'2), as well as one extra higherorder feature 933 which is taken to be the square of the average temperature of the past seven days i.e. (32]2. By running gradient descent, youlve managed to train a logistic regression model ha [3} with the following optimal :9 parameters: 2.87 0.27 0.3 El'.'i'8 9: You task in this question is to now make an actual prediction of either rainfall (y = 1} or no rainfall (y = 0) by computing hats), given the following feature values: I1 = 1.1, $2 = U.Q. If necessary, round o' your values to two decimal places, either for your nal answer or as you carry out your working e.g. assume that 81 = 2.72 and 1 e = 0.37 etc. For your own sake {not for marks), rst ll in the following vector X with the values of all of the features {and don't forget; if need be, round off to two decimal places): We've decided to use a one-vs-one multi-class classification strategy: we train one classifier for each pair of classes. Later, we're trying to predict the acceptance status of a new paper represented by sample Test; we pass the sample into each of the models to obtain the value of he( Itest ) for each model. The table below (on the top of the next page) summarizes the pair of classes recognized by each of the 10 models, as well as the predicted value ho( Itest ) obtained by each model on the input Itest: Your task in this question is to use the information provided to determine which of the five classes Ttest belongs to. Show your working clearly e.g. show how you compute the probability of each class and how you deduce which class is the correct one. Finally, clearly indicate your final predicted class. Page 3 Model Classes Predicted Value ho( Itest) 1 Accept (y = 1) Weak Reject (y = 0) 0.57 2 Weak Reject (y = 1) 0.57 No Judgement (y = 0) 3 Accept (y = 1) Weak Accept (y = 0) 0.74 4 Weak Reject (y = 1) Reject (y = 0) 0.58 5 Weak Accept (y = 1) Reject (y = 0) 0.71 6 Weak Accept (y = 1) Weak Reject (y = 0) 0.5 7 Accept (y = 1) Reject (y = 0) 0.18 8 Accept (y = 1) No Judgement (y = 0) 0.3 9 Reject (y = 1) No Judgement (y = 0) 0.79 10 Weak Accept (y = 1) No Judgement (y = 0) 0.9uestion 5. [6 marks] Given the confusion matrix below that displays the results of a given logistic regression classifier. Your task in this question is to compute the accuracy, precision, recall and F1 score of the classifier that produced these results. Give your answers to the metrics as percentages. Show your workings. If necessary, round off your final answers to 1 decimal place. predicted 0 404 225 actually 0 388 64Question 6. [8 marks] We've used a training set Atrain to train a logistic regression model to predicts whether or not rainfall will take place on a given day based on a given set of features. Now, we wish to evaluate the model on the testing set Xtest to determine how well it works (by computing various classification metrics), and to do this, we first need to populate a confusion matrix. Each of the samples in the test set were passed to the trained classifier. The following table summarizes the actual class of each sample, as well as the predicted class of the classifier on each sample, where a class of 1 indicates y = 1 which means "rainfall", and a class of 0 indicates y =0 which means "no rainfall". Note that, because the table was long, I decided to put it into two columns to save space; the table starts on the left and continues on the right as clearly indicated. Actual Predicted Actual Predicted Sample Class Class Sample Class Class No y ho ( I) No he (I) (continued from the left)- 14 15 16 17 18 HOHOOOOF 23 13 24 25 (continued on the right) 26 Your task in this question is to use the information provided in the table above to determine how many true and false positive predictions, and how many true and false negative predictions were made and then fill in the correct values into a confusion matrix. I've provided an empty confusion matrix below which you can either use (and take a picture of ) or re-draw; if you choose to re-draw it, take care to re-draw it correctly and not change the format of the matrix in any way. predicted 0 actually 0 DONE X P -Re W

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Precalculus With Limits

Authors: Ron Larson

3rd Edition

1285607163, 9781285607160

More Books

Students also viewed these Mathematics questions

Question

69. In the match problem, say that (i, j),i Answered: 1 week ago

Answered: 1 week ago