Department of Computer and Information Science and Engineering. CAP4770/CAP5771 Fall Midterm Exam. Instructor: Prof.

Similar documents
Machine Learning, Midterm Exam: Spring 2009 SOLUTION

Qualifier: CS 6375 Machine Learning Spring 2015

10-701/ Machine Learning - Midterm Exam, Fall 2010

MIDTERM SOLUTIONS: FALL 2012 CS 6375 INSTRUCTOR: VIBHAV GOGATE

FINAL: CS 6375 (Machine Learning) Fall 2014

Problem #1 #2 #3 #4 #5 #6 Total Points /6 /8 /14 /10 /8 /10 /56

MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October,

Machine Learning, Midterm Exam: Spring 2008 SOLUTIONS. Q Topic Max. Score Score. 1 Short answer questions 20.

Midterm: CS 6375 Spring 2018

CSE 546 Final Exam, Autumn 2013

Introduction to Bayesian Learning. Machine Learning Fall 2018

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Introduction to Machine Learning Midterm Exam

Midterm: CS 6375 Spring 2015 Solutions

Midterm Exam, Spring 2005

The Naïve Bayes Classifier. Machine Learning Fall 2017

Midterm, Fall 2003

Midterm. You may use a calculator, but not any device that can access the Internet or store large amounts of data.

Mark your answers ON THE EXAM ITSELF. If you are not sure of your answer you may wish to provide a brief explanation.

Introduction to Machine Learning Midterm Exam Solutions

Machine Learning, Midterm Exam

Final Exam. December 11 th, This exam booklet contains five problems, out of which you are expected to answer four problems of your choice.

SUPERVISED LEARNING: INTRODUCTION TO CLASSIFICATION

FINAL EXAM: FALL 2013 CS 6375 INSTRUCTOR: VIBHAV GOGATE

Machine Learning Gaussian Naïve Bayes Big Picture

Midterm. Introduction to Machine Learning. CS 189 Spring Please do not open the exam before you are instructed to do so.

Machine Learning, Fall 2009: Midterm

1 Machine Learning Concepts (16 points)

UNIVERSITY of PENNSYLVANIA CIS 520: Machine Learning Final, Fall 2014

452 FINAL- VERSION E Do not open this exam until you are told. Read these instructions:

Department of Computer Science and Engineering CSE 151 University of California, San Diego Fall Midterm Examination

Midterm 2 V1. Introduction to Artificial Intelligence. CS 188 Spring 2015

The exam is closed book, closed notes except your one-page (two sides) or two-page (one side) crib sheet.

Machine Learning Linear Classification. Prof. Matteo Matteucci

Machine Learning Tom M. Mitchell Machine Learning Department Carnegie Mellon University. September 20, 2012

Probabilistic modeling. The slides are closely adapted from Subhransu Maji s slides

Chris Piech CS109 CS109 Final Exam. Fall Quarter Dec 14 th, 2017

Logistic Regression. Machine Learning Fall 2018

Machine Learning Practice Page 2 of 2 10/28/13

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Machine Learning, Fall 2012 Homework 2

Machine Learning

Machine Learning for Signal Processing Bayes Classification

Logistic Regression. Will Monroe CS 109. Lecture Notes #22 August 14, 2017

Introduction to Machine Learning Midterm, Tues April 8

Classification CE-717: Machine Learning Sharif University of Technology. M. Soleymani Fall 2012

Lecture 2: Logistic Regression and Neural Networks

MLE/MAP + Naïve Bayes

Generative Learning. INFO-4604, Applied Machine Learning University of Colorado Boulder. November 29, 2018 Prof. Michael Paul

Midterm. Introduction to Machine Learning. CS 189 Spring You have 1 hour 20 minutes for the exam.

CS534 Machine Learning - Spring Final Exam

Homework 1 Solutions Probability, Maximum Likelihood Estimation (MLE), Bayes Rule, knn

Machine Learning. Regression-Based Classification & Gaussian Discriminant Analysis. Manfred Huber

Midterm 1 practice UCLA: Math 32B, Winter 2017

Bias-Variance Tradeoff

Introduction: MLE, MAP, Bayesian reasoning (28/8/13)

Machine Learning

Final Exam, Spring 2006

Probabilistic classification CE-717: Machine Learning Sharif University of Technology. M. Soleymani Fall 2016

Generative v. Discriminative classifiers Intuition

Machine Learning: Chenhao Tan University of Colorado Boulder LECTURE 9

Name: Student ID: Instructions:

Bayesian Methods: Naïve Bayes

Parts 3-6 are EXAMPLES for cse634

outline Nonlinear transformation Error measures Noisy targets Preambles to the theory

Final Exam, Fall 2002

Machine Learning

Comments. x > w = w > x. Clarification: this course is about getting you to be able to think as a machine learning expert

Machine Learning: Assignment 1

Last Time. Today. Bayesian Learning. The Distributions We Love. CSE 446 Gaussian Naïve Bayes & Logistic Regression

Math 51 Midterm 1 July 6, 2016

CSE 546 Midterm Exam, Fall 2014

UNIVERSITY of PENNSYLVANIA CIS 520: Machine Learning Final, Fall 2013

Announcements Monday, September 18

Generative v. Discriminative classifiers Intuition

Bayes Classifiers. CAP5610 Machine Learning Instructor: Guo-Jun QI

CS446: Machine Learning Fall Final Exam. December 6 th, 2016

One side of each sheet is blank and may be used as scratch paper.

Class 4: Classification. Quaid Morris February 11 th, 2011 ML4Bio

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Midterm Exam Solutions, Spring 2007

CS 498F: Machine Learning Fall 2010

Machine Learning

Week 5: Logistic Regression & Neural Networks

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question.

CS540 ANSWER SHEET

COMP 551 Applied Machine Learning Lecture 19: Bayesian Inference

STAT 516 Midterm Exam 2 Friday, March 7, 2008

Naïve Bayes Introduction to Machine Learning. Matt Gormley Lecture 18 Oct. 31, 2018

Machine learning comes from Bayesian decision theory in statistics. There we want to minimize the expected value of the loss function.

Linear classifiers: Logistic regression

Stochastic Gradient Descent

MLE/MAP + Naïve Bayes

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 2008) Midterm 1. October 7, 2008

Probability and Statistical Decision Theory

CS 6140: Machine Learning Spring What We Learned Last Week 2/26/16

Final Overview. Introduction to ML. Marek Petrik 4/25/2017

Tutorial 2. Fall /21. CPSC 340: Machine Learning and Data Mining

Machine Learning and Pattern Recognition, Tutorial Sheet Number 3 Answers

CSE-4412(M) Midterm. There are five major questions, each worth 10 points, for a total of 50 points. Points for each sub-question are as indicated.

Transcription:

Department of Computer and Information Science and Engineering UNIVERSITY OF FLORIDA CAP4770/CAP5771 Fall 2016 Midterm Exam Instructor: Prof. Daisy Zhe Wang This is a in-class, closed-book exam. This exam contains 5 single-sided sheets of paper (excluding this one). Write all answers on these pages, preferably on the white space in the problem statement. Continue on the draft pages if running out of space but clearly number your answers if doing so. Make sure you attack every problem; partial credit will be awarded for incomplete or partially correct results. THIS IS A CLOSED BOOK, CLOSED NOTES EXAM. Name: UFID: For grading use only: Question: I II III Total Points: 40 30 30 100 Score:

CAP4770/CAP5771, Fall 2016 Midterm Exam Page 1 of 5 I. [40 points] Machine Learning. A set of reasonably clean sample records was extracted by Barry Becker from the 1994 Census database. We are interested in predicting whether a person makes over 50K a year. For simplicity suppose we model the two features with two boolean variables X 1,X 2 {0,1} and label Y {0,1} where Y = 1 indicates a person makes over 50K. In Figure 1 we show three positive samples ( + for Y = 1) and one negative samples ( - for Y = 0). Please complete the following questions. X2 1 + + 0 + - 0 1 X1 1 (6 points). If we train a KNN classifier (K=1) based on data in Figure 1, and then try to classify the same data. Which sample(s) must be misclassified by this classifier? Solution: The (1,0) sample must be misclassified. 2 (6 points). For predicting samples in Figure 1, which model is better: Logistic Regression or Linear Regression. Please explain why. Solution: Logistic Regression. Because Logistic Regression predicts values between 0 and 1, which is consistent with the target space Y, but Linear Regression predicts any values. 3 (7 points). Is there any logistic regression classifier using X 1 and X 2 that can perfectly classify the examples in Figure 1? How about if we change label of point (0,1) from + to -? Solution: Logistic regression forms linear decision surface. Because data points in Figure 1 is linear separable, they can be perfectly classified. But if we make the change, then data points are not linearly separable so no logistic regression classifier can perfectly classify the examples.

CAP4770/CAP5771, Fall 2016 Midterm Exam Page 2 of 5 4 (7 points). Suppose we have trained a linear regression model y = ax + b where a = 0.5 and b = 1.0, on a set of training data points D = {(1.0,1.6),(1.5,1.5),(3.0,2.4)}. Please calculate the mean squared errors of this model on D. Solution: MSE = 0.12 +0.25 2 +0.1 2 3 = 0.0275 5 (7 points). Suppose we learn a Naive Bayes classifier from the examples in Figure 1, using MLE (maximum likelihood estimation) as the training rule. Write down the prior probabilities P(Y ), and conditional probabilities P(X i Y = 1). Note: both P(Y ) and P(X i Y ) should be Bernoulli distributions. Solution: P(Y = 0) = 0.25,P(Y = 1) = 0.75 P(X 1 = 0 Y = 1) = 2 3 P(X 1 = 1 Y = 1) = 1 3 P(X 2 = 0 Y = 1) = 1 3 P(X 2 = 1 Y = 1) = 2 3 6 (7 points). If we train a classifier based on data in Figure 1, and then we apply that classifier on a testing dataset. The testing confusion matrix is given by: + - + 9 9-1 5 What is the precision and recall of that classifier? Solution: precision: 9/(9+1) = 0.9 recall: 9/(9+9) = 0.5

CAP4770/CAP5771, Fall 2016 Midterm Exam Page 3 of 5 II. [30 points] Map-Reduce. For each of the following problems describe how you would solve it using map-reduce. You should explain how the input is mapped into (key, value) pairs by the map stage, i.e., specify what is the key and what is the associated value in each pair, and, if needed, how the key(s) and value(s) are computed. Then you should explain how the (key, value) pairs produced by the map stage are processed by the reduce stage to get the final answer(s). If the job cannot be done in a single map-reduce pass, describe how it would be structured into two or more map-reduce jobs with the output of the first job becoming input to the next one(s). You should just describe your solution algorithm. You should not translate the solution into detailed programming language. For each of the following question please describe: (1) The input and output of MapReduce program; (2) How the Map step works; (3) how you reduce the key-value pairs in the Reduce step. 1 (15 points). The input is a list of housing data where each input record contains information about a single house: (address, city, state, zip, value). The output should be the average house value in each zip code. Solution: (1) Input: (address, city, state, zip, value), Output: (zip, value). (2) Map Stage: Read and input and generate key-value pairs as output: key - zip, value - value (3) Reduce Stage: merge pairs of the same key by adding the value. 2 (15 points). The input contains two lists. One list gives voter information for every registered voter: (voter-id, name, age, zip). The other list gives disease information: (zip, age, disease). For each unique pair of age and zip values, the output should give a list of names and a list of diseases for people in that zip code with that age. If a particular age/zip pair appears in one input list but not the other, then that age/zip pair can appear in the output with an empty list of names or diseases, or you can omit it from the output entirely, depending on which is easier. (Hint: the keys in a map/reduce step do not need to be single atomic values.) Solution: (1) Input: (voter-id, name, age, zip) and (zip, age, disease), Output: ((age, zip), [[values],[diseases]]). (2) Read and input and generate key-value pairs as output: key - (age, zip), value - [[name],[]] for the first list, key - (age, zip), value - [[],[disease]] for the second list. (3) Reduce Stage: merge pairs of the same key by merging two sublists of values.

CAP4770/CAP5771, Fall 2016 Midterm Exam Page 4 of 5 III. [30 points] Hypothesis Testing. A research group made a poll of 1029 US residents to estimate the satisfaction level (0 10) to the US President. The average satisfaction level of that 1029 samples was Y = 7.1. Now we randomly select a group of elder people of n = 25 from that samples. Please establish a t-test to show if the average satisfaction level of 8.1 with standard deviation s = 2.0 from the selected group of elder people is sinificantly (α = 0.05) different from the samples. Hint: t critical = 1.711 for one-tails t-test with d f = 24 and α = 0.05 t critical = 2.064 for two-tails t-test with d f = 24 and α = 0.05 t critical = 1.708 for one-tails t-test with d f = 25 and α = 0.05 t critical = 2.060 for two-tails t-test with d f = 25 and α = 0.05 1. (6 points) Write down H 0 /H 1. Solution: H 0 : Y = 7.1 H 1 : Y 7.1 2. (6 points) Estimate standard error of the mean. Solution: S M = s n = 2.0 25 = 0.4 3. (6 points) Calculate the t-statistic. Solution: t = M Y s M = 8.1 7.1 0.4 = 2.5 4. (6 points) Sketch the critical regions. Solution: 5. (6 points) Explain if the difference is significant. Solution: Because t critical = 2.064 for two-tails with d f = 24 and α = 0.05. Thus we should reject H 0. The difference is significant under α = 0.05.

CAP4770/CAP5771, Fall 2016 Midterm Exam Page 5 of 5 (This page is intentionally left blank)