  Community detection in weighted networks has been a popular topic in recent
years. However, while there exist several flexible methods for estimating
communities in weighted networks, these methods usually assume that the number
of communities is known. It is usually unclear how to determine the exact
number of communities one should use. Here, to estimate the number of
communities for weighted networks generated from arbitrary distribution under
the degree-corrected distribution-free model, we propose one approach that
combines weighted modularity with spectral clustering. This approach allows a
weighted network to have negative edge weights and it also works for signed
networks. We compare the proposed method to several existing methods and show
that our method is more accurate for estimating the number of communities both
numerically and empirically.
