Lab-6 n824g389 Bsan

You might also like

You are on page 1of 6

Y X step 2 step 1

Spend Coffee Drinks Age Type Rank Euclidean Distance


$5 47 Regular Coffee 10 $ 15.56
$27 22 Lattes 13 $ 17.80
$23 35 Chai 2 $ 7.07
$14 50 Regular Coffee 8 $ 14.14
$10 44 Regular Coffee 4 $ 10.00
$29 32 Chai 7 $ 13.60
$21 32 Lattes 1 $ 6.40
$3 48 Regular Coffee 12 $ 17.69
$30 39 Chai 9 $ 14.32
$36 30 Chai 14 $ 20.88
$26 37 Chai 5 $ 10.05
$16 24 Lattes 6 $ 12.00
$32 29 Lattes 11 $ 17.46
$12 70 Regular Coffee 15 $ 34.23
$12 28 Lattes 3 $ 8.94

New purchase, need to classify what


customer bought
Dollars spent $16.00
Age 36
Type of Coffee

$40

$35 Chai
Lattes
$30 Chai Chai
Lattes Chai
$25
Money spent

Chai
$20 Lattes

$15 Lattes
Regular Coffee
$10 Regular Coffee

$5 Regular Coffee
Regular Coffee
$0
18 28 38 48 58
Age
step 3

label k label
Regular Coffee 1 Lattes
Lattes 2 Chai
Chai 3 Lattes
Regular Coffee 4 Regular Coffee
Regular Coffee 5 Chai
Chai 6 Lattes
Lattes 7 Chai
Regular Coffee 8 Regular Coffee
Chai 9 Chai
Chai 10 Regular Coffee
Chai
Lattes
Lattes
Regular Coffee
Lattes

Regular Coffee
Regular Coffee
gular Coffee

Regular Coffee
Regular Coffee

48 58 68 78
Age
Hemanth Reddy
F282U975
lab-7
STEP 1: Data Set Observation STEP 2: Rank & Distance
Calc 2 Calc 1
Observations IV DV Distance to
(labels) Age Spend Coffee Drinks Neighbor Rank neighbors
1 32 $5
2 46 $27
3 51 $23
4 47 $14
5 25 $10
6 54 $29
7 20 $21
8 59 $3
9 58 $30
10 33 $36
11 43 $26
12 27 $16
13 41 $32
14 18 $12
15 22 $12

IV Descriptives
Lower Limit 18 New Observation
Upper Limit 59
STEP 2: Rank & Distance Calculations STEP 3: label and value ordering by k, average calculation

DV
Observations IV Spend Coffee DV sorted
(labels) Age Drinks k labels sorted by label
1 #N/A #N/A
2 #N/A #N/A
3 #N/A #N/A
4 #N/A #N/A
5 #N/A #N/A
6 #N/A #N/A
7 #N/A #N/A
8 #N/A #N/A
9 #N/A #N/A
10 #N/A #N/A
11 #N/A #N/A
12 #N/A #N/A
13 #N/A #N/A
14 #N/A #N/A
15 #N/A #N/A

Observation 28 Amount Spent?


ing by k, average calculation

kNN Average of kNN


#N/A $0
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A
#N/A #N/A

You might also like