• Home
  • The University of British Columbia
  • Dynamic and waves
  • UBC CPSC 340 2018W1 Midterm Exam

UBC CPSC 340 2018W1 Midterm Exam

UBC CPSC 340 2018W1 MIDTERM EXAM Oct 18th, 2018 Instructors: Mark Schmidt and Mike Gelbart TIME: 80 minutes We are providing a copy of this exam to help you prepare for the style of questions we may ask during the midterm and final. However, the solution file is meant for you alone and we do not give permission to share these solution files with anyone. Both distributing solution files to other people or using solution files provided to you by other people are considered academic misconduct. Please see UBC's policy on this topic if you are not familiar with it: http: //www. calendar . ubc. ca/vancouver/ index. cfm?tree=3, 54, 111, 959 http://www. calendar. ubc. ca/vancouver/ index. cfm?tree=3, 54, 111, 960 · Do not open the exam until you are directed to do so. . Once you open the exam, make sure that it contains this cover page plus 9 pages of exam questions. · One letter-size sheet (both sides) of notes is allowed. No other material or accessories may be used. . You may use either pen or pencil, but exams written in pencil may not be eligible for regrading. . Please be prepared to present, upon request, a student card for identification. . If you need more space, use the blank page at the end of the exam, and clearly indicate that your work continues there. . Most questions require a short answer. Work efficiently and avoid writing lengthy answers. . Unless otherwise stated, n refers to the number of training examples and d is the number of features. · If anything is unclear or seems ambiguous, state your assumptions. Question: 1 2 3 4 5 6 7 8 Total Points: 8 6 6 6 6 6 6 6 50 Score: Midterm Exam CPSC 340 Question 1. 2 pts 2 pts 2 pts (8 points) Answer the questions below using 1-2 short sentences. (a) What are two differences between KNN and k-means? (No more than two, please.) (b) Is it possible to have a machine learning model that makes predictions in O(1) time? If yes, give an example; if no, explain why not. (c) You're working on a machine learning problem and decide you need more data. You collect twice as much training data but end up with the same validation error for your parametric model. Are you likely experiencing underfitting or overfitting? Briefly justify your answer. (d) What is an advantage and a disadvantage of using more folds with cross-validation? 2 pts Page 1 of 9 Midterm Exam CPSC 340 Question 2. 2 pts 2 pts 2 pts (6 points) Answer the questions below using 1-2 short sentences. (a) Assume you have a classifier that takes O(nd) time to train and O(td) time to predict on t examples, like naive Bayes. If you are testing p possible values of a hyper-parameter, what is the cost of choosing the best value of the hyper-parameter using k-fold cross-validation? Express the result in terms of n, d, t, k, and p