CMU 15-190 Spring 2017: Topics in Intermediate Programming
Homework 7 (Due Wednesday 29-Mar, at 11:59pm)



  1. Short Answer
    1. Briefly explain how you would extend the code from lecture to recognize 1-9 instead of just "1" and "2".
    2. Explain one data based approach to choosing "k" in k-nearest-neighbors.
    3. Explain how to do k-nearest-neighbors if one of your input variables is categorical.

  2. Programming
    You're working for mastercard and they've decided that they want to approve credit card applications automatically online. For each customer mastercard obtains a credit score and yearly income through an online form, and whether they have had a credit card before.

    You've been tasked with building a classification algorithm for this approval process. Luckily, mastercard has previous applications for credit cards that you can use.

    Ten of them are reproduced here:
    Credit score, had card before, income, approved
    760, yes,100000, approved 
    770, yes,80000, approved
    780, yes,75000, approved
    700, yes, 30000, approved
    600, no, 90000, approved
    500, no,50000, not approved
    400,no, 30000, not approved
    700, no,10000, not approved
    440, no,30000, not approved
    800, yes,15000, approved
    
    Use k-nearest-neighbors to predict whether the following 3 new applications will be approved for a credit card:
    760, yes, 100000
    700, yes,800000
    400, no, 50000
    
    Include your code and the output for these 3 applications in your submission. Do not use any outside modules. Note that you will not need PCA here!

  3. What to Submit
    Each member of the group should submit their own PDF file, 15-190-hw7.pdf, containing this information:
    1. Your name and andrew id
    2. The names and andrew id's of your groupmates
    3. The start/stop times you worked, and the total time you worked.
    4. Your thoughts about this exercise -- useful, interesting, etc? This will help us improve the 15-190 experience as we go.
    5. The solutions from above. Note: one way to create a PDF is to first make a Word file, then export that to PDF.
    You can submit your hw to the 15-190 autolab site here.

Have fun!