[scikit-learn] Custom Distance Metric / Distance Matrix with K-means?

Shane Grigsby shane.grigsby at colorado.edu
Tue Nov 14 18:27:12 EST 2017


Hello,
I'd like to be able to cluster data using either k-means or
mini-batch-kmeans for a toroidal geometry. I know that if I was using
DBSCAN I could pass in a pre-computed distance matrix to do this; if I
was using OPTICS I could pass in a 'metric' keyword for distance and
specify a custom distance metric. Is this possible for K-means /
minibatch-kmeans? I don't see distance metrics documented as possible
keyword arguments... but perhaps they're allowed as **kwargs that pass
to the underlying distance calculation call?
Thanks,
Shane

-- 
*PhD candidate & Research Assistant*
*Cooperative Institute for Research in Environmental Sciences (CIRES)*
*University of Colorado at Boulder*


More information about the scikit-learn mailing list