Question: We are using python and panda is allowed. Problem 1. (20 points) Define a distance function, called dist(l,j), that returns the L1 distance between any

 We are using python and panda is allowed. Problem 1. (20points) Define a distance function, called dist(l,j), that returns the L1 distance

We are using python and panda is allowed.

Problem 1. (20 points) Define a distance function, called dist(l,j), that returns the L1 distance between any two given students in the survey data. For quantitative columns, use z-score normalized data. For categorical columns, use the Hamming distance (0 -same, 1--different). Do not include the Name column in the distance metric. You must write your own code for this metric, you cannot use a library method that computes distances. Parameters i & j are indices of rows in the original table. Returns a float. For example, the dist between the two people named 'Jonathan' is 26.067858. Return your distance function in Answer1. Answerl-dist Answer1 Problem 1. (20 points) Define a distance function, called dist(l,j), that returns the L1 distance between any two given students in the survey data. For quantitative columns, use z-score normalized data. For categorical columns, use the Hamming distance (0 -same, 1--different). Do not include the Name column in the distance metric. You must write your own code for this metric, you cannot use a library method that computes distances. Parameters i & j are indices of rows in the original table. Returns a float. For example, the dist between the two people named 'Jonathan' is 26.067858. Return your distance function in Answer1. Answerl-dist Answer1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!