
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Task: classify a credit card holder as a likely responder to an offer (or not) and also predict his/her average monthly balance (in $) based on:
Training data for 4 credit card holders:
Gender Age Salary Response Balance Anne F^25 50 No^300 Bob M^22 55 No^600 Carrie F^23 55 Yes^400 Doug M^26 40 Yes^500
Distances Gender Age Std. Age Salary Std. Salary Manhattan Euclidean Anne 1 1 0.5 5 0.5 2.0 (2=) 1.22 (2) Bob 0 2 1.0 10 1.0 2.0 (2=) 1.41 (3) Carrie 1 1 0.5 10 1.0 2.5 (4) 1.50 (4) Doug 0 2 1.0 5 0.5 1.5 (1) 1.12 (1) Maximum 2 10
Gender distances are 0 for a match, 1 for a mismatch. Standardized distances for quantitative variables are the absolute difference divided by the maximum absolute difference. Manhattan distance is G + A + S. Euclidean distance is √(G 2 + A 2 + S^2 ).
Neighbors (k) Manhattan classification Manhattan prediction Euclidean classification Euclidean prediction 1 1 Y, so classify Y $500 1 Y, so classify Y $ 2 1 Y, 2 N, so classify N (500+300+600)/3=$467 1 Y, 1 N, so classify? (500+300)/2=$ 3 1 Y, 2 N, so classify N (500+300+600)/3=$467 1 Y, 2 N, so classify N (500+300+600)/3=$
Distances Gender Age Std. Age Salary Std. Salary Manhattan Euclidean Anne^0 3 0.75^0 0.0^ 0.75 (1=)^ 0.75 (2) Bob^1 0 0.00^5 0.5^ 1.50 (3)^ 1.12 (3) Carrie^0 1 0.25^5 0.5^ 0.75 (1=)^ 0.56 (1) Doug^1 4 1.00^10 1.0^ 3.00 (4)^ 1.73 (4) Maximum^4
Neighbors (k) Manhattan classification Manhattan prediction Euclidean classification Euclidean prediction 1 1 Y, 1 N, so classify?^ (400+300)/2=$350^ 1 Y, so classify Y^ $ 2 1 Y, 1 N, so classify?^ (400+300)/2=$350^ 1 Y, 1 N, so classify?^ (400+300)/2=$ 3 1 Y, 2 N, so classify N^ (400+300+600)/3=$433^ 1 Y, 2 N, so classify N^ (400+300+600)/3=$