Midterm Exam, Spring 2005

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

CSE 546 Final Exam, Autumn 2013

Midterm Exam Solutions, Spring 2007

Final Exam, Spring 2006

Final Exam, Fall 2002

FINAL: CS 6375 (Machine Learning) Fall 2014

Midterm: CS 6375 Spring 2015 Solutions

Machine Learning, Fall 2009: Midterm

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

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

Machine Learning, Midterm Exam: Spring 2009 SOLUTION

MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October,

Machine Learning

Introduction to Machine Learning Midterm Exam

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

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

Machine Learning

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

Qualifier: CS 6375 Machine Learning Spring 2015

PAC-learning, VC Dimension and Margin-based Bounds

CS534 Machine Learning - Spring Final Exam

Midterm, Fall 2003

MIDTERM SOLUTIONS: FALL 2012 CS 6375 INSTRUCTOR: VIBHAV GOGATE

Announcements - Homework

PAC-learning, VC Dimension and Margin-based Bounds

Name (NetID): (1 Point)

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.

CS446: Machine Learning Spring Problem Set 4

Introduction to Machine Learning Midterm Exam Solutions

Midterm exam CS 189/289, Fall 2015

Midterm: CS 6375 Spring 2018

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

Machine Learning. Lecture 4: Regularization and Bayesian Statistics. Feng Li.

CSE 417T: Introduction to Machine Learning. Final Review. Henry Chai 12/4/18

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

Introduction to Machine Learning Midterm, Tues April 8

EXAM IN STATISTICAL MACHINE LEARNING STATISTISK MASKININLÄRNING

Logistic Regression. Machine Learning Fall 2018

Final Exam, Machine Learning, Spring 2009

Machine Learning, Midterm Exam

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

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

Learning with multiple models. Boosting.

CSCI-567: Machine Learning (Spring 2019)

Qualifying Exam in Machine Learning

EXAM IN STATISTICAL MACHINE LEARNING STATISTISK MASKININLÄRNING

Name (NetID): (1 Point)

9 Classification. 9.1 Linear Classifiers

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

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

1 Machine Learning Concepts (16 points)

Midterm Review CS 6375: Machine Learning. Vibhav Gogate The University of Texas at Dallas

6.867 Machine learning

Midterm Review CS 7301: Advanced Machine Learning. Vibhav Gogate The University of Texas at Dallas

Machine Learning, Fall 2011: Homework 5

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

Introduction to Machine Learning

STA 414/2104, Spring 2014, Practice Problem Set #1

FINAL EXAM: FALL 2013 CS 6375 INSTRUCTOR: VIBHAV GOGATE

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

Linear & nonlinear classifiers

The exam is closed book, closed notes except your one-page cheat sheet.

18.9 SUPPORT VECTOR MACHINES

CIS519: Applied Machine Learning Fall Homework 5. Due: December 10 th, 2018, 11:59 PM

Machine Learning. Lecture 9: Learning Theory. Feng Li.

CSE 546 Midterm Exam, Fall 2014

Final Examination CS540-2: Introduction to Artificial Intelligence

Machine Learning Gaussian Naïve Bayes Big Picture

Holdout and Cross-Validation Methods Overfitting Avoidance

A Decision Stump. Decision Trees, cont. Boosting. Machine Learning 10701/15781 Carlos Guestrin Carnegie Mellon University. October 1 st, 2007

Linear Classifiers: Expressiveness

SVAN 2016 Mini Course: Stochastic Convex Optimization Methods in Machine Learning

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

Computational Learning Theory. CS534 - Machine Learning

10-701/ Machine Learning, Fall

Learning Theory. Machine Learning B Seyoung Kim. Many of these slides are derived from Tom Mitchell, Ziv- Bar Joseph. Thanks!

Introduction to Bayesian Learning. Machine Learning Fall 2018

Review: Support vector machines. Machine learning techniques and image analysis

Machine Learning: Assignment 1

Introduction to Machine Learning. Introduction to ML - TAU 2016/7 1

CS 446 Machine Learning Fall 2016 Nov 01, Bayesian Learning

CS 6375: Machine Learning Computational Learning Theory

Machine Learning And Applications: Supervised Learning-SVM

Stochastic Gradient Descent

Computational Learning Theory

Machine Learning (CS 567) Lecture 3

6.034 Quiz 4. 3 December Josh Blum Elisa Castañer Pedro Cattori. Martin Gale Malcom Gilbert Dylan Holmes. Jessica Noss Duncan Townsend Siyao Xu

6.867 Machine Learning

Linear classifiers selecting hyperplane maximizing separation margin between classes (large margin classifiers)

Machine Learning (CS 567) Lecture 2

CPSC 340: Machine Learning and Data Mining. MLE and MAP Fall 2017

Support Vector Machines

ESS2222. Lecture 4 Linear model

Stat 502X Exam 2 Spring 2014

CPSC 340: Machine Learning and Data Mining

Chapter 6 Classification and Prediction (2)

Computational Learning Theory

9/26/17. Ridge regression. What our model needs to do. Ridge Regression: L2 penalty. Ridge coefficients. Ridge coefficients

Day 3: Classification, logistic regression

Transcription:

10-701 Midterm Exam, Spring 2005 1. Write your name and your email address below. Name: Email address: 2. There should be 15 numbered pages in this exam (including this cover sheet). 3. Write your name at the top of EVERY page in the exam. 4. You may use any and all books, papers, and notes that you brought to the exam, but not materials brought by nearby students. No laptops, PDs, or Internet access. 5. If you need more room to work out your answer to a question, use the back of the page and clearly mark on the front of the page if we are to look at what s on the back. 6. Work efficiently. Some questions are easier, some more difficult. e sure to give yourself time to answer all of the easy ones, and avoid getting bogged down in the more difficult ones before you have answered the easier ones. 7. Note there is one extra-credit question. The grade curve will be made without considering students extra credit points. The extra credit will then be used to try to bump your grade up without affecting anyone else s grade. 8. You have 80 minutes. 9. Good luck! Question Number of points Score 1. ig Picture 10 2. Short Questions 15 3. Learning lgorithms 16 4. Decision Trees 16 5. Loss Fns. and SVMs 23 6. Learning Theory 20 Total 100 Extra credit 7. ias-variance Trade-off 18 1

1 [10 points] ig Picture Following the example given, add 10 edges to Figure 1 relating the pair of algorithms. Each edge should be labeled with one characteristic the methods share, and one difference. These labels should be short and address basic concepts, such as types of learning problems, loss functions, and hypothesis spaces. Naïve ayes oosting SVM regression Logistic regression H-space: both linear Log-loss v. Hinge-loss SVMs kernel regression Instance-based Learning Neural Nets Decision trees linear regression Figure 1: ig picture. 2

One solution is shown below, there are many others. Figure 2: ig picture solutions. 3

2 [15 points] Short Questions (a) [3 points] riefly describe the difference between a maximum likelihood hypothesis and a maximum a posteriori hypothesis. ML: maximize the data likelihood given the model, i.e., arg max P (Data W ) W MP: arg max P (W Data) W (b) [4 points] onsider a naive ayes classifier with 3 boolean input variables, X 1, X 2 and X 3, and one boolean output, Y. How many parameters must be estimated to train such a naive ayes classifier? (you need not list them unless you wish to, just give the total) For a naive ayes classifier, we need to estimate P(Y=1), P (X1 = 1 y = 0), P (X2 = 1 y = 0), P (X3 = 1 y = 0), P (X1 = 1 y = 1), P (X2 = 1 y = 1), P (X3 = 1 y = 1). Other probabilities can be obtained with the constraint that the probabilities sum up to 1. So we need to estimate 7 parameters. How many parameters would have to be estimated to learn the above classifier if we do not make the naive ayes conditional independence assumption? Without the conditional independence assumption, we still need to estimate P(Y=1). For Y=1, we need to know all the enumerations of (X1,X2,X3), i.e., 2 3 of possible (X1,X2,X3). onsider the constraint that the probabilities sum up to 1, we need to estimate 2 3 1 = 7 parameters for Y=1. Therefore the total number of parameters is 1 + 2(2 3 1) = 15. 4

[8 points] True or False? If true, explain why in at most two sentences. If false, explain why or give a brief counterexample in at most two sentences. (True or False?) The error of a hypothesis measured over its training set provides a pessimistically biased estimate of the true error of the hypothesis. False. The training error is optimisticly biased since it s biased while usually smaller than the true error. (True or False?) If you are given m data points, and use half for training and half for testing, the difference between training error and test error decreases as m increases. True. s we have more and more data, training error increases and testing error decreases. nd they all converge to the true error. (True or False?) Overfitting is more likely when the set of training data is small True. With small training dataset, it s easier to find a hypothesis to fit the training data exactly,i.e., overfit. (True or False?) Overfitting is more likely when the hypothesis space is small False. We can see this from the bias-variance trade-off. When hypothesis space is small, it s more biased with less variance. So with a small hypothesis space, it s less likely to find a hypothesis to fit the data very well,i.e., overfit. 5

3 [16 points] Learning lgorithms onsider learning a target function of the form f : R 2 {,, } that is, a function with 3 discrete values defined over the 2-dimensional plane. onsider the following learning algorithms: Decision trees Logistic regression Support Vector Machine 1-nearest neighbor Note each of these algorithms can be used to learn our target function f, though doing so might require a common extension (e.g., in the case of decision trees, we need to utilize the usual method for handling real-valued input attributes). For each of these algorithms,. Describe any assumptions you are making about the variant of the algorithm you would use. Draw in the decision surface that would be learned given this training data (and describing any ambiguities in your decision surface). ircle any examples that would be misclassified in a leave-one-out evaluation of this algorithm with this data. That is, if you were to repeatedly train on n-1 of these examples, and use the learned classifier to label the left out example, will it be misclassified? the assuptions are as follows: Decision trees: Handle real valued attributes by discretizing; Logistic regression: Handle non-binary classification; SVM: Use one against all approach and a linear kernel; 1-NN: x-axis features and y-axis features are non-weighted. Please see the figures on the right for decision surface and misclassified examples by leave-one-out evaluation. Decision trees 6

Logistic regression Support Vector Machine 1-nearest neighbor 7

4 [16 points] Decision Trees NS wants to be able to discriminate between Martians (M) and Humans (H) based on the following characteristics: Green {N, Y }, Legs {2, 3}, Height {S, T }, Smelly {N, Y }. Our available training data is as follows: Species Green Legs Height Smelly 1) M N 3 S Y 2) M Y 2 T N 3) M Y 3 T N 4) M N 2 S Y 5) M Y 3 T N 6) H N 2 T Y 7) H N 2 S N 8) H N 2 T N 9) H Y 2 S N 10) H N 2 T Y a)[8 points] Greedily learn a decision tree using the ID3 algorithm and draw the tree. See the following figure for the ID3 decision tree: 8

b) i) [3 points] Write the learned concept for Martian as a set of conjunctive rules (e.g., if (green=y and legs=2 and height=t and smelly=n), then Martian; else if... then Martian;...; else Human). Only the disjunction of conjunctions for Martians was required. (Legs=3) (Legs=2 Green=Yes Height=Tall) (Legs=2 Green=No Height=Short Smelly=Yes) ii) [5 points] The solution of part b)i) above uses up to 4 attributes in each conjunction. Find a set of conjunctive rules using only 2 attributes per conjunction that still results in zero error in the training set. an this simpler hypothesis be represented by a decision tree of depth 2? Justify. We allowed a little variation on this one because the question could be interpreted as allowing conjunctions with up to two terms. In fact, only two two-term conjunctions are necessary: (Green=Yes Height=Tall) (Smelly=Yes Height=Short) These conjunctive rules share the height term, so a depth-2 tree is possible. See the figure below. Notice how ID3 finds a tree that is much longer than the optimal tree. This is due to the greediness of the ID3 algorithm. 9

5 [23 points] Loss functions and support vector machines In homework 2, you found a relationship between ridge regression and the maximum a posteriori (MP) approximation for ayesian learning in a particular probabilistic model. In this question, you will explore this relationship further, finally obtaining a relationship between SVM regression and MP estimation. (a) Ridge regression usually optimizes the squared (L 2 ) norm: ŵ L2 = arg min w N j=1(t j i w i h i (x j )) 2 + λ i w 2 i. (1) The L 2 norm minimizes the squared residual (t j i w ih i (x j )) 2, thus significantly weighing outlier points. (n outlier is a data point that falls far away from the prediction i w ih i (x j ).) n alternative that is less susceptible to outliers is to minimize the sum of absolute values (L 1 ) norm: ŵ L1 = arg min w N t j i j=1 w i h i (x j ) + λ i w 2 i. (2) (i)[2 points] Plot a sketch of the L 1 loss function, do not include the regularization term in your plot. (The x-axis should be the residual t j i w ih i (x j ) and the y-axis is the loss function.) loss residual Figure 3: L 1 loss. (ii)[2 points] Give an example of a case where outliers can hurt a learning algorithm. Want Get Figure 4: Outlier example. 10

(iii)[2 points] Why do you think L 1 is less susceptible to outliers than L 2? L 2 penalizes the square of the residual, so an outlier with residual r will have a loss of r 2. On the other hand, L 1 will have a loss of only r. Therefore, if r > 1, this outlier will have a larger influence on the L 2 loss than L 1, and, thus, a greater effect on the solution. (vi)[2 points] re outliers always bad and we should always ignore them? Why? (Give one short reason for ignoring outliers, and one short reason against.) Outliers are often bad data, caused by faulty sensors or errors entering values; in such cases, the outliers are not part of the function we want to learn and should be ignore. On the other hand, an outlier could be just an unlikely sample from the true distribution of the function of interest; in these cases, the data point is just another sample and should not be ignored. (v)[4 points] s with ridge regression in Equation 1, the regularized L 1 regression in Equation 2 can also be viewed a MP estimator. Explain why by describing the prior P (w) and the likelihood function P (t x, w) for this ayesian learning problem. Hint: The p.d.f. of the Laplace distribution is: P (x) = 1 2b e x µ /b. s with ridge regression, the prior over each parameter is zero-mean Gaussian with variance 1/λ: P (w i ) N (0; 1/λ). The parameters have independent priors: P (w) = i P (w i ). The likelihood function is Laplacian with mean x w: P (t x, w) = 1 2 e t x w. 11

(b) s mentioned in class, SVM regression is a margin-based regression algorithm that takes two parameters, ɛ > 0 and 0, as input. In SVM regression, there is no penalty for points that are within ɛ of the hyperplane. Points that are further than ɛ are penalized using the hinge loss. Formally, the SVM regression QP is: ŵ SV M = min w,ξ, ξ s.t. 1 2 w.w + m j=1 (ξ j + ξ j ) t j i w ih i (x j ) ɛ + ξ j i w ih i (x j ) t j ɛ + ξ j ξ j 0, ξj 0, j (i)[4 points] Plot a sketch of the loss function function used by SVM regression. gain, the x-axis should be the residual t j i w ih i (x j ) and the y-axis the loss function. However, do not include the 1 2w.w term in this plot of the loss function. loss ε 0 ε residual Figure 5: Margin loss. (ii)[2 points] ompared to L 2 and L 1, how do you think SVM regression will behave in the presence of outliers? The margin loss is very similar to L 1, so the margin loss will be less susceptible to outliers than L 2. When compared to L 1, the margin loss has an small region ([ ɛ, ɛ]) with zero penalty, thus, seemingly, margin loss should be less susceptible to outliers than L 1. However, ɛ is usually much smaller than the outlier residual, thus, L 1 and the margin loss will usually have very similar behavior. (iii)[5 points] SVM regression can also be view as a MP estimator. What is the prior and the likelihood function for this case? s with ridge regression, the prior over each parameter is zero-mean Gaussian, but now with variance 2: P (w i ) N (0; 2). The parameters have independent priors: P (w) = i P (w i ). The likelihood function is constant in [ ɛ, ɛ] and Laplacian with mean x w elsewhere: { 1 2+2ɛ, for t x w ɛ; P (t x, w) = 1 e ( t x w ɛ) 2+2ɛ, for t x w > ɛ. 12

6 [20 points] Learning Theory This question asks you to consider the relationship between the V dimension of a hypothesis space H and the number of queries the learner must make (in the worst case) to assure that it exactly learns an arbitrary target concept in H. More precisely, we have a learner with a hypothesis space H containing hypotheses of the form h : X {0, 1}. The target function c : X {0, 1} is one of the hypotheses in H. Training examples are generated by the learner posing a query instance x i X, and the teacher then providing its label c(x i ). The learner continues posing query instances until it has determined exactly which one of its hypothesis in H is the target concept c. Show that in the worst case (i.e., if an adversary gets to choose c H based on the learner s queries thus far, and wishes to maximize the number of queries), then the number of queries needed by the learner will be at least V(H), the V dimension of H. Put more formally, let M inqueries(c, H) be the minimum number of queries needed to guarantee learning target concept c exactly, when considering hypothesis space H. We are interested in the worst case number of queries, W orstq(h), where You are being asked to prove that You will break this down into two steps: W orstq(h) = max c H [MinQueries(c, H)] W orstq(h) V (H) (a) [8 points] onsider the largest subset of instances S X that can be shattered by H. Show that regardless of its learning algorithm, in the worst case the learner will be forced to pose each instance x S as a separate query. ecause S is shattered by H, there will be at least one subset H H, where each h H assigns one of the 2 S possible labelings to S. Suppose the adversary chooses a target function c such that c H. The problem statement says the learner must pose queries until it determines exactly which one of its hypothesis in H is the target concept. Let us assume the learner poses fewer than S queries. We will show the learner cannot in this case have converged to just a single consistent candidate hypothesis. Let x i S be one of the instances from S it has not used as a query, and let S be the set of all instances from S the learner has queried. ecause H shatters S there are at least two hypotheses h 1 H and h 2 H such that both h 1 and h 2 label correctly, but for which h 1 (x i ) h 2 (x i ). Therefore, the learner will not have determined which one of the hypotheses in H (or even in H ) is the target cocept. (b) [5 points] Use the above to argue that W orstq(h) V (H). We just showed in part (a) that W orstq(h) S. y definition, V (H) = S. Therefore, W orstq(h) V (H). 13

(c) [7 points] Is there a better case? In other words, if the learner knows that a friend (not an adversary) will be choosing c H, and that the friend wishes to minimize the number of learning queries, is it possible for the friend to choose a c that allows the learner to avoid querying all of the points in S? More formally, if we define then is the following statement true or false? Justify your answer. estq(h) = min c H [MinQueries(c, H)] estq(h) V (H) False. In fact, the answer will depend on the exact X and H, and is therefore false in general. To see why, consider the figure below, where X contains exactly 6 instances, and H contains exactly 5 hypotheses. In this diagram,the circle associated with each h indicates which members of X it labels positive. Notice V(H)=2 in this figure, because the four hypotheses in the lower left of H shatter points x1 and x2. Suppose here that the learner first asks for the label of x3, and the teacher/friend responds that the label of x3 is positive. There is only one hypothesis in H that labels x3 positive, so the learner has exactly learned the target function from one example, despite the fact that V (H) = 2. Notice an adversary could, in this case, respond that the label of x3 is negative, thereby forcing the learner to continue to consider the 4 hypotheses that shatter x1 and x2. While estq(h) V (H) does not hold for this X and H, it will hold in other cases. For example, if we add hypotheses to H in this example so that it shatters the entire instance space X, then we will have estq(h) = V (H). X H x3 + x1 x2 14