Category "euclidean-distance"

Finding eps value in DBSCAN algorithmn

I am implementing DBSCAN on a dataset. First I sorted the data and then found the distance among its neighbors to find the minimum distance between them and plo

how to calculate Manhattan distance (or L1/ cityblock) for two 2D array?

For 1D vector/array it's easier. For example: array1 = [1, 2, 3] array2 = [1, 1, 1] manhattan distance will be: (0+1+2) which is 3 import numpy as np def city

Similarity of documents function

I am trying to create matrices for cosine and euclidean distances of a document. not too sure how I would approach this question. Any advice would be appreciate