Sparse implementations of distance computations in python / scikit-learn

后端 未结 1 1182
终归单人心
终归单人心 2021-01-13 09:25

I have a large (100K by 30K) and (very) sparse dataset in svmlight format which I load as follows:

import numpy as np
from scipy.cluster.vq import kmeans2
f         


        
相关标签:
1条回答
  • 2021-01-13 09:43

    In scikit-learn there is a sklearn.metrics.euclidean_distances function that works both for sparse matrices and dense numpy arrays. See the reference documentation.

    However non-euclidean distances are not yet implemented for sparse matrices.

    0 讨论(0)
提交回复
热议问题