Question: This question asks you to write a spectral clustering algorithm using k - means clustering and test your code on a test network. Consider the
This question asks you to write a spectral clustering algorithm using k means clustering and test your
code on a test network. Consider the symmetric graph Laplacian A and the nonsymmetric
random walk matrix
Construct an artificial network consisting of clearly defined communities, each with nodes,
where the probability of connecting within a community is and the probability to connect to
nodes outside the community is Use the NetworkX command plantedpartitiongraph.
Plot the graph.
This is a good test case to test any community finding algorithm. You can play with changing the
interintra connectivity probabilities to consider less welldefined communities and to see how the
routines work.
Write a programme to do spectral clustering as we discussed in the lectures using kmeans use
builtin routines for kmeans; no need to write this routine yourself
Remarks: kmeans requires real inputs. You will need a routine which sets all very small, but
nonzero imaginary parts of the eigenvectors to zero.
Test your programme with the network you generated above in In kmeans you need to specify
the number of clusters Argue by using the spectrum of your respective matrices how you should
be choosing
What are the python codes for this question?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
