ISYE 6740 Homework 7 (Last Homework) Total 100 points. As usual, please submit a report with su_cient explanation of your answers to each the questions, together with your code, in a zip folder. 1 Random forrest for email spam classi_er (30 points) Your task for this question is to build a spam classi_er using the UCR email spma dataset https://archive. ics.uci.edu/ml/datasets/Spambase came from the postmaster and individuals who had _led spam. The collection of non-spam e-mails came from _led work and personal e-mails, and hence the word george and the area code 650 are indicators of

ISYE 6740 Homework 7 (Last Homework) Total 100 points. As usual, please submit a report with su_cient explanation of your answers to each the questions, together with your code, in a zip folder. 1 Random forrest for email spam classi_er (30 points) Your task for this question is to build a spam classi_er using the UCR email spma dataset https://archive. ics.uci.edu/ml/datasets/Spambase came from the postmaster and individuals who had _led spam. The collection of non-spam e-mails came from _led work and personal e-mails, and hence the word george and the area code 650 are indicators of non-spam. These are useful when constructing a personalized spam _lter. One would either have to blind such non-spam indicators or get a very wide collection of non-spam to generate a general purpose spam _lter. Load the data. 1. (5 points) How many instances of spam versus regular emails are there in the data? How many data points there are? How many features there are? Note: there may be some missing values, you can just _ll in zero. 2. (10 points) Build a classi_cation tree model (also known as the CART model). In Python, this can be done using sklearn.tree.DecisionTreeClassi_er. In our answer, you should report the tree models _tted similar to what is shown in the Random forest lecture, Page 16, the tree plot. In Python, getting this plot can be done using sklearn.tree.plot tree function. 3. (15 points) Also build a random forrest model. In Python, this can be done using sklearn.ensemble.RandomForestClassi_er. Now partition the data to use the _rst 80% for training and the remaining 20% for testing. Your task is to compare and report the AUC for your classi_cation tree and random forest models on testing data, respectively. To report your results, please try di_erent tree sizes. Plot the curve of AUC versus Tree Size, similar to Page 15 of the Lecture Slides on Random Forest. Background information: In classi_cation problem, we use AUC (Area Under The Curve) as a performance measure. It is one of the most important evaluation metrics for checking any classi_cation model?s performance. ROC (Receiver Operating Characteristics) curve measures classi_cation accuracy at various thresholds settings. AUC measures the total area under the ROC curve. Higher the AUC, better the model is at distinguishing the two classes. If you want to read a bit more about AUC curve, check out this link https://towardsdatascience.com/understanding-auc-roc-curve-68b2303cc9c5 For instance, in Python, this can be done using sklearn.metrics.roc auc score and you will have to _gure out the details. 2 Nonlinear regression and cross-validation (30 points) The coe_cient of thermal expansion y changes with temperature x. An experiment to relate y to x was done. Temperature was measured in degrees Kelvin. (The Kelvin temperature is the Celcius temperature 1 plus 273.15). The raw data _le is copper-new.txt. 0 200 400 600 800 1000 temperature 0 5 10 15 20 25 coefficient of thermal expansion 1. (10 points) Perform linear regression on the data. Report the _tted model and the _tting error. 2. (10 points) Perform nonlinear regression with polynomial regression function up to degree n = 10 and use ridge regression (see Lecture Slides for Bias-Variance Tradeo_). Write down your formulation and strategy for doing this, the form of the ridge regression. 3. (5 points) Use 5 fold cross validation to select the optimal regularization parameter _. Plot the cross validation curve and report the optimal _. 4. (5 points) Predict the coe_cient at 400 degree Kelvin using both models. Comment on how would you compare the accuracy of predictions. 3 Regression, bias-variance tradeo_ (40 points) Consider a dataset with n data points (xi,yi), xi _Rp, drawn from the following linear model: y = xT__ + , where is a Gaussian noise and the star sign is used to di_erentiate the true parameter from the estimators that will be introduced later. Consider the regularized linear regression as follows: _(_) = argmin _ (1 n n X i=1 (yi _xT i _)2 + _k_k2 2), where _ _ 0 is the regularized parameter. Let X _Rn_ denote the matrix obtained by stacking xT i in each row. 1. (10 points) Find the closed form solution for _(_) and its distribution. 2. (10 points) Calculate the bias E[xT _(_)]_xT__ as a function of _ and some _xed test point x. 2 3. (10 points) Calculate the variance term ExT _(_)_E[xT _(_)]2. 4. (10 points) Use the results from parts (b) and (c) and the bias-variance decomposition to analyze the impact of _ in the squared error. Speci_cally, which term dominates when _ is small, and large, respectively? (Hint.) Properties of an a_ne transformation of a Gaussian random variable will be useful throughout this problem.

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.