Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Answer1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started