GithubHelp home page GithubHelp logo

Comments (4)

benedekrozemberczki avatar benedekrozemberczki commented on July 3, 2024

Use np.argmax over the embedding matrix at the bottle neck.

from karateclub.

kkonevets avatar kkonevets commented on July 3, 2024

But if I use np.argmax it will give me only one label for a node, I need more. Can I use some kind of a threshold to select clusters? Something like this:

splitter = DANMF()
splitter.fit(g)
membership = []
for row in splitter._P:
    membership.append(np.where(row > threshold)[0])

If so, how can I choose a threshold? I gues _P matrix is not a probability matrix?

from karateclub.

benedekrozemberczki avatar benedekrozemberczki commented on July 3, 2024

from karateclub.

mamintoosi avatar mamintoosi commented on July 3, 2024

Hi Dear Konevets,
In the following code, after normalizing P, max_in_row is the membership score of the winner cluster in which the node i is belongs to this cluster. Other clusters in which their memberships are above some threshold (related to winner cluster's membership score) will be assigned to this node, as overlapping clusters.

           P = normalize(model._P, axis=1)
           membership_closeness = 0.25
           near_clusters = []
            for i in range(P.shape[0]):
                row = P[i]
                max_in_row = np.max(row)
                npw = np.where(row >= (max_in_row*membership_closeness))
                tmp = npw[0].tolist()
                near_clusters.append(tmp)

Note that we have some problems with empty clusters.
I hope it be correct.

from karateclub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.