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. (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
Get step-by-step solutions from verified subject matter experts
