def distance(self, x, y):

        if scipy.sparse.issparse(x):
            x = x.toarray().ravel()
            y = y.toarray().ravel()
        return 1.0 - numpy.dot(x, y)
Computes distance measure between vectors x and y. Returns float.
dataset/ETHPy150Open pixelogik/NearPy/nearpy/distances/cosine.py/CosineDistance.distance