Usually, you should be able to pass an affinity matrix with -1 to indicate that a connection cannot be made, and two observations cannot be put in the same cluster.
But, because of the way sklearn.manifold.spectral_embedding works, it computes a normalized laplacian, so any negative weights become nan.
Usually, you should be able to pass an affinity matrix with
-1to indicate that a connection cannot be made, and two observations cannot be put in the same cluster.But, because of the way
sklearn.manifold.spectral_embeddingworks, it computes a normalized laplacian, so any negative weights becomenan.