Hello everyone :)
I am trying to configure a fixed random seed so that my program can consistently produce the same results for the same data. According to the API, if a fixed random seed is provided, the program should theoretically meet my requirements, but it does not in practice.
I found that in:
|
for node in __randomize(graph.nodes(), random_state): |
the result of graph.nodes() itself is random. In this case, setting a fixed random seed is meaningless; it is still completely random and cannot be controlled.
So, to reach my goal, I have to edit the lib code to remove the random part:
for node in sorted(graph.nodes()):
the result will be almost stable.
Hello everyone :)
I am trying to configure a fixed random seed so that my program can consistently produce the same results for the same data. According to the API, if a fixed random seed is provided, the program should theoretically meet my requirements, but it does not in practice.
I found that in:
python-louvain/community/community_louvain.py
Line 483 in def9179
the result of graph.nodes() itself is random. In this case, setting a fixed random seed is meaningless; it is still completely random and cannot be controlled.
So, to reach my goal, I have to edit the lib code to remove the random part:
the result will be almost stable.