CSE6040_SP20_Final_Exam_Problem0_Main_solutions 2020.
Problem 0: Click-through Balancing Act (5 points) Version 1.1 This notebook is a (hopefully) simple one about two common data preprocessing issues in practical machine learning, namely, imputing missing values and “balancing” training data. Here, you’ll see these ideas in the context of analyzing advertising click-through data, where you wish to predict when a user will click on an ad using logistic regression. This problem will make use of some basic Python, pandas, and Numpy. The problem is worth a total of 5 points, broken up into 3 exercises. They are independent, so you can complete them in any order. (However, they do build on one another so read them in sequence.) Their points values are as follows. •Exercise 0: 2 points •Exercise 1: 2 points •Exercise 2: 1 point Pro-tips. - If your program behavior seem strange, try resetting the kernel and rerunning ev- erything. - If you mess up this notebook or just want to start from scratch, save copies of all your partial responses and use Actions Reset Assignment to get a fresh, original copy of this notebook. (Resetting will wipe out any answers you’ve written so far, so be sure to stash those somewhere safe if you intend to keep or reuse them!) - If you generate excessive output (e.g., from a ill-placed print statement), causing the notebook to load slowly or not at all, use Actions Clear Notebook Output to get a clean copy. The clean copy will retain your code but remove any generated output. However, it will also rename the notebook to . Since the autograder expects a notebook file with the original name, you’ll need to rename the clean notebook accordingly. Revision history. * Version 1.1 - Added more hints, fixed a missing link [Th Apr 23, 2020] * Version 1.0 - Initial release 1.1Setup Here are some of the basic modules you’ll need for this problem. [2]: * Python version: 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] *Numpy version: 1.18.2 *pandas version 1.0.3 1.2Get to know the dataset: Click-through data The dataset consists of click-through data collected from mobile users about whether they clicked on ads. Run this code cell to load the data into a pandas DataFrame named df_train_0 and inspect a small sample. Reading ./resource/asnlib/publicdata/train-4M.csv … Done! Cleaning… Done cleaning! First five data points (rows): click x_pixels y_pixels dev0 dev1 dev2 dev4 dev5 c1001 c1002 c1005 c1007 c1008 c1010 c1012 0 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 Last five data points (rows): click x_pixels y_pixels dev0 dev1 dev2 dev4 dev5 c1001 c1002 c1005
Document information
- Uploaded on
- December 14, 2022
- Number of pages
- 21
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers