'Yellowbrick: is it possible to pass in different pairwise distance metrics for scoring methods
sklearn defines a large number of pairwise distance metrics for something like silhouette score: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise_distances.html
For e.g. it can be initiated with any of these distance metrics:
[‘cityblock’, ‘cosine’, ‘euclidean’, ‘l1’, ‘l2’, ‘manhattan’]
However, say I go to use KElbowVisualizer
from yellowbrick. I can pass in silhouette as the metric as follows:
KElbowVisualizer(KMeans(), k=(4, 12), metric='silhouette')
Which I assume uses the silhouette score default distance metric, 'euclidean'. Is it possible to run KElbowVisualizer
using a different distance metric than the default?
Solution 1:[1]
This functionality was recently added to the development branch and should be released in v1.5.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | larrywgray |