Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions