Repository navigation
Link prediction algorithms - #1117
Conversation
|
This is looking great, and definitely a welcome contribution. There's been some interest in this too (mailing list). |
|
Yes, definitely interesting. And A+ for writing more code for tests than the algorithms :-). |
|
Thanks for your warm comments :) First probably I want to hear your opinion about what I have in mind:
Those issues are what I could think of right now. Please let me know what you think. As for the tests, I am thinking of adding more tests actually. 😉 |
|
…nd cleaned test codes
|
I have coded so that link prediction only available to simple undirected graph and used the generator approach as you suggested. The generator will yield tuple (u, v, p). I have also coded some community-based link prediction algorithms. However, there are two issues:
Please let me know what you think. |
|
An algorithm should not return a generator. A generator creates an invisible dependency on the graph that lingers even after the algorithm has ended. An inadvertent user will be surprised when the generator raises an exception after he/she modifies the graph. |
There was a problem hiding this comment.
There is no need to litter the code with this check everywhere. Just put @not_implemented_for('undirected') from networkx.utils on the entry points.
There was a problem hiding this comment.
How about "within- and inter-cluster common neighbors"? Also consider adding hyphens to "within" and "inter" where appropriate below.
|
Done. Thanks for the corrections @ysitu. Any other things need to be fixed? |
|
Ready to merge, I think. |
|
Looks good to me. |
|
Need to add documentation to HTML/PDF references. |
|
What kind of documentation is needed? I looked at the HTML/PDF references and it seems that the documentation was generated automatically from the docstring. |
|
It seems that the functions added in this PR are not included in the documentation. Typically the Sphinx source files need to be manually edited to include newly added functions. |
|
I see. But the thing is, I am not familiar with Sphinx and how it is used here. If you could tell me specifically what to do that would be very much appreciated. I already looked at .rst files in doc/source but I think it is not enough. |
|
No worry. Those are trivial changes and are covered in #1148. |
|
Nice :-) Btw, what do you say about implementing other basic link prediction algorithms? In the original paper, there are some algorithms that haven't been implemented in this PR. I could initiate another PR to code some of them. |
|
That is outside my area of expertise. Maybe other maintainers can chime in. |
|
I'd say go for it (in another PR). Is this and #1148 ready to be merged? Update: Hahah, I had merged this already! |
I tried to implement some simple link prediction algorithms which I am going to use in my work. Complete list of well-known algorithms can be found here. Some link prediction algorithms based on cluster information are emerging recently (here and here) so I am thinking of implementing some of them too.
This request is NOT ready to be merged. Many improvements are still needed. Please let me know if you're interested by leaving any comments.