Question: Please answer all these - as per standard practice you can answer 4 and all are related. Please answer all or ignore. Do not provide

Please answer all these - as per standard practice you can answer 4 and all are related. Please answer all or ignore. Do not provide partial or wrong / copy answers.
Answer in Python Code - use basic packages - Matlab, pyplot , Panda, NumPy and etc
Thanks in advance.
Make a KNN program that can use data with an arbitrary number of features (1 or more). To test this, you can use sklearn.datasets.make_blobs(n_features=3) to generate test data with 3 features, for example. Make your KNN program able to classify an arbitrary number of classes (2 or more). Adapt your KNN program to use Manhattan distance. Are the results different? If so, what is different? Advanced: Do the same with Mahalanobis distance. Note: you will need to calculate the co- variance matrix (you can use np.cov(X_train, rowvar=False)). How can we adapt our algorithm to use KNN for regression
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
