Comments (4)
Use np.argmax over the embedding matrix at the bottle neck.
from karateclub.
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.
from karateclub.
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)
- Estimator _check_graph method
- g2vec_model.infer([test_graph]) returns different embeddings each time I call it HOT 2
- IGE Laplacian Issue for small graphs HOT 1
- Dependency update HOT 16
- gl2vec doc’s may be inconsistent with the code HOT 4
- Does GraRep change the input graph ? HOT 3
- How are ego-nets created
- cannot import name '_rename_parameter' from 'scipy._lib._util' HOT 6
- Inductive Node Embedding Algorithms in KarateClub HOT 2
- numpy version error HOT 10
- How to retrieve the mapping between nodes and embeddings with get_embedding() ? HOT 1
- Seed and random results for embeddings HOT 1
- Add set_params to Estimator base class
- Pandas version
- AssertionError: The node indexing is wrong. HOT 4
- [Graph2Vec] the right way to build the attributed graph... HOT 1
- Graph2Vec—— how the attributed nodes are transformed to subgraph and word?
- GLEE - the sign of embedding values changes for repeat fits
- Feather-Graph with attributed graphs
- Cut new release 1.3.4 [or 1.4.0?] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karateclub.