I'm new to scikit.
I can't find an example using a precomputed distance matrix in Scikit KMeans.
Could anybody shed a light now this, better with an example?
How to use a precomputed distance matrix in Scikit KMeans?
Asked Answered
Wrong site for an open-ended question like this. Please review our help files to see what kinds of questions are wanted and unwanted here. –
Seeger
You can't unless you hack up the code. K-means is tied to Euclidean distances for speed reasons. –
Slipperwort
Scikit-learn does not allow you to pass in a custom (precomputed) distance matrix. It can precompute Euclidean distance matrix to speed-up the process, but there's no way to use your own one without hacking the source.
© 2022 - 2024 — McMap. All rights reserved.