**150**wrote:

Dear all,

I'm using spectral clustering method in order to cluster a biological dense graph of around 6021 genes. When i run the code starts working and after that shows this warning:

Calinski-Harabasz Score with gamma= 1 n_clusters= 12 score: 29.6079084919

Calinski-Harabasz Score with gamma= 1 n_clusters= 13 score: 28.0773430337

Calinski-Harabasz Score with gamma= 1 n_clusters= 14 score: 29.2831696856

Calinski-Harabasz Score with gamma= 1 n_clusters= 15 score: 28.8945479231

**UserWarning: Graph is not fully connected, spectral embedding may not work as expected. warnings.warn("Graph is not fully connected, spectral embedding"**

Note: my input is a symmetric adjacency matrix with 1'0 and 0's, what's this warning mean?

I have read that spectral clustering can work better with a similarity matrix, if so could anyone tell me how to turn this adjacency matrix to a similarity matrix.

I Appreciate any help.

Thanks,

**19k**• written 2.1 years ago by Chaimaa •

**150**

Apparently your graph is not connected and IMO the warning is because spectral algorithms for layouts are not optimal for not connected graphs.

140@Rodrigo, what I have to do so? any suggestions!

150Well, depends on what format you're using for your graph (edgelist, csv, etc) but a couple of possibilities are, you can download

`gephi`

which is a software for displaying graphs in a beautiful way and you can also apply some cluster algorithms (spectral included) and see how the nodes mode while it's clustering (this would be helpful for you to see why not connected graphs don't go well with spectral clustering). Here is the link to gephi's home page.Another option if you know your way around python at least a bit, would be to use the package

`networx`

where you can apply different kinds of layouts and display your graph. Here is networkx home page.Let me know if you need any more help.

140Spectral clustering is a graph partitioning algorithm, not a graph layout algorithm.

19k