-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A question about 'initial_partition' property. #317
Comments
Hi, the last interpretation is correct. Providing an It seems though as if you want something in between: Nodes assigned a module will not be moved out from that module, but all other nodes are free to move. Is that right? |
Oh, I misunderstood the
That's correct! In my view, it's like a semi-supervised paradigm. That's to say, the assigned nodes always belong to the initial modules (as the prior ground truth label), and other nodes will be moved to the optimal modules after optimization, leading to the good result of community detection (or clustering). So, if I want such effects, I need to modify some source codes to make the modules of assigned nodes remain unchanged, right? |
- Use --free-initial-partition to not move nodes with assigned modules - Modules are freezed if they contain freezed nodes - Nodes (and modules) with no module assignments are free to move See #317
Yes, I think it seems like a useful feature though, so I did a quick implementation. We had a similar concept before that we called "hard partition" which was implemented but lacked api to use it. I added that, One problem with this is that we rebuild the network from the modules and try to move those to be able to move bigger chunks of nodes, so to keep modules assigned with different modules in separate modules, all modules with at least one frozen node are also frozen. I haven't had time to really try it, so please checkout the linked branch and see if any of these options can help you. |
Sorry for the late reply. I have tried to set Also, I found there is no log information which should be print by |
Do you run the cli version or the Python version? Can you show the stdout log you get from running? |
Sorry, I'm not sure what cli version means. What I did is to clone the repo and run After checking the log, I found the reason why it doesn't make difference. That's all my bad. I forgot to add the argument to initialize modules for partial nodes in my test. After adding such argument, I test the performance again with Here is the correct log and the important information has been printed by
For now, in my test, the |
Thanks, the cli version is just the standalone binary you get when running Try limit the number of times the core loops are reapplied on existing modular network to search bigger structures with |
I see. Thank you!. I will try your suggestion. |
I test that wheter to add |
If you read the cluster data from a .tree file the module ids are supposed to match. If you read them from a .clu file they are reindexed to make sure a contiguous set. Do you use a .clu file? If so, are there gaps in the module ids? |
I didn't load cluster data from either .tree or .clu file. Instead, I prepare the data as follows:
Maybe I didn't express the phenomenon clearly. I thinks it doesn't matter whether the module IDs are contiguous. The question is that, after optimization, frozen node1 and node2 that should have the same module ID are assigned with different IDs with each other, spliting them to different modules. |
Aha, I missed the Python case where you can set the initial partition programmatically. In the code that should correspond to the clu case where the module ids are reassigned. But if two nodes belong to the same module in the initial partition they should keep doing so irrespective of recalculated module ids, so they should end up in the same module in the end. Apparently there are something that doesn't work as it should. Can you replicate the issue with a minimal input network that you can share? |
You mean I share you with some data of the input network and you can help me test on that, right? I save the links and weights in Thank you! |
Ok, you can mail them to daniel.edler@umu.se, I will be back later today or tomorrow. |
Hi, I found the issue now and pushed a solution. Before I also found a few merges but now I don't get any. Does the |
Hi, I found that, when some nodes have no links, the So, in my project, I eventually manually added nodes that are not shown in links (e.g., |
Good. You can have non-contiguous node ids without any indexing problem in Infomap, but otherwise use |
For now, Thanks for your kind help and great work! I'm going to close the issue. |
Hi, I'm a little confused about the effect of
initial_partition
of infomap.I set the
initial_partition
for partial nodes folloing the example does in this link and it indeed improves the clustering performance.There is a note in that link, i.e. 'The initial partition is saved between runs. If you want to use an initial partition for one run only, use run(initial_partition=partition)'. In my understanding, if I set initial partition with
im.initial_partition = {1: 0, 2:0}
, the final module ID of node1 and node2 will be kept same, right?However, in my experiment, I found some module ID of nodes, which belongs to the same initial partition, are not same in the final results. For example, providing the initial partitions
1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 1, 7: 1
toim.initial_partition
, the final module ID of1, 2, 3
is123
, while the one of4, 5
is78
(different from123
). Of course, the frequency of such changing is not high.Did I take a wrong way to provide the initial partitions, which results in the inconsistency? Or, maybe the initial_partition property cannot guarantee that the partition does not change?
The text was updated successfully, but these errors were encountered: