$30
11. Find the distance between objects 1 and 3. Notice that we have mixed type of
attributes.
The following python code has will find the distance between any two objects for this dataset.
We can see that the distance between object 1 and object 3 is 0.651 .
42. Write a program in any language which can compute Manhattan and Euclidean
distances between any two given vectors with any length. You can pass the length
to your function, but please don’t limit the dimension to 2. You can test your
function on vectors you fill in your code without asking user input. (25 points)
The following python code has independent functions that will find the Manhattan and
Euclidean distance between any two given numpy vectors.
84. In R, there is a built-in data frame called mtcars. Please calculate the
correlation between mpg and wt attributes of mtcars by using cor() function.
Then generate scatter plot based on these two attributes.
We can see that the correlation between vehicle miles per gallon and vehicle weight in
the mtcars dataset is rmpg,weight = −0.868 . What this explains is that as one variable
mpg