I\'m having trouble understanding a specific use case of the sklearn.cluster.SpectralClustering
class as outlined in the official documentation here. Say I want
Straight from the docs:
If you have an affinity matrix, such as a distance matrix, for which 0 means identical elements, and high values means very dissimilar elements, it can be transformed in a similarity matrix that is well suited for the algorithm by applying the Gaussian (RBF, heat) kernel:
np.exp(- X ** 2 / (2. * delta ** 2))
This goes in your own code, and the result of this can be passed to fit
. For the purpose of this algorithm, affinity means similarity, not distance.