Comments (7)
Hi Hai,
The MCL algorithm treats the edge weights as similarities.
The absolute magnitude of the edge weights is not important, but the relative magnitude is.
If the graph has an edge (a, b) with a weight 2, and another edge (c, d) with weight 20, then c and d are considered 10x more similar than (a,b).
Your graph, where a higher edge weight indicates a shorter distance should work.
Hope that helps
Guy
from markov_clustering.
Hello, How about a network with negative and positive weights ? My network models ecological interactions between species, but these interactions can be conflicting (negative weights) or benefical (positive weight).
from markov_clustering.
The idea behind MCL is to simulate a random walk ad infinitum and than looking where the random walker starting as some node 'i' will tend to go more often. This way groups of strongly connected nodes tend to be in the same cluster after you run MCL.
The weights on the edges can then be thought of (once normalized) as transition probabilities from node 'i' to node 'j', and probabilities can't be negative. So right of the bat you break some basic assumption the algorithm makes by allowing negative values.
If you input an adjacency matrix with negative values to the algorithm, the normalization step will make it so that the sum of the absolute values of any column will add up to one, and not the actual values, which again is breaking a very core assumption the algorithm makes.
You can give it a try but the results would be either nonsensical (which is my guess) or need a brand new interpretation under the new assumptions you've made (and that's if you rework the code to accommodate pruning negative values and stuff like that).
I'd go for the easiest work around and softmax the values of your matrix. You juste have to exponentiate the weights and the algorithm will normalize them for you so less work! That way the negative weights will correspond to very small transition probabilities and MCL would be perfectly usable.
from markov_clustering.
@Moonire OK so I have to deal with that.
- My edges values are [-1;1] ; what if I add +1 to each of them in order to have [0;2] ?
- Or I could work on a subgraph containing only positive edges ; in my case, it actually doesn't cause a lot of trouble for future interpretations of the clusters.
from markov_clustering.
@Mataivic Simply adding 1 to all weights would be a bad idea (it deletes a -1 weighted edge from the graph).
But if you can work in the positif subset only, then I guess it would solve the problem.
Although I'd like to say having negative weights in the 1st place is an indicator that MCL isn't really what you'er looking for. This got a little far from the topic of this issue so if you want to discuss it in further depth I invite you to email me directly.
from markov_clustering.
@Moonire Yes, I had some doubts so I already started to do a review of various clustering algorithms to find the most suited to my case. I'll keep you in touch if you want.
from markov_clustering.
Yeah absolutely ! I'd love to know what solution you find and discuss the problem in further detail.
from markov_clustering.
Related Issues (20)
- Network Graph from SciPy Hierarchical Clustering HOT 1
- Some nodes belong to more than one clusters. HOT 20
- markov_clustering not works with scipy 1.3.0 HOT 2
- What does the format of input data look like?
- ValueError: shape mismatch in assignment. HOT 3
- How to find a new sample belongs to which cluster?
- Shape mismatch in assignment
- conda-forge support HOT 3
- markov_clustering, possible error in instructions for computing of modularity Q HOT 3
- Hyperparameter Tunning
- markov_cluster.modularity errors when 1st arg is an np.ndarray
- module 'markov_clustering' has no attribute 'draw_graph' HOT 1
- RuntimeError: nnz of the result is too large
- How should I cite this package?
- Draw edge Labels
- Draw multiple graphs on different figures without closing the first ones
- Error when using inflation argument with a value different than pre-defined HOT 1
- Overlapping clusters HOT 1
- no matches found: markov_clustering[drawing]
- Two issues: "nx.to_scipy_sparse_matrix" not exist and the inflation hyperparameter not working?
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 markov_clustering.