We should add an average utility function which would work as below:
average(X, metric="euclidean") => return mean
average(X, metric="mahattan") => return median
This will be useful in nearest-centroid or in k-means as the averaging operator used in these algorithms depends on the metric used (K-means with manhattan distance is called "k-medians").
We should add an
averageutility function which would work as below:average(X, metric="euclidean") => return meanaverage(X, metric="mahattan") => return medianThis will be useful in nearest-centroid or in k-means as the averaging operator used in these algorithms depends on the metric used (K-means with manhattan distance is called "k-medians").