-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Adjusted Mean Ranking Index metric for Link Prediction (#1061)
*Issue #, if available:* *Description of changes:* * Add Adjust Mean Rank Index LP metric. This metric is normalized by the candidate list size, allowing for easier comparison between datasets/models and negative edge sample counts. * To get the list sizes we modify `run_lp_mini_batch_predict` and `lp_mini_batch_predict` to _conditionally_ return a tuple of `rankings, lengths` that allows us to calculate AMRI in the cases where it's needed. The return type is determined by a new argument added, with a default value, so the changes are backwards compatible, existing calls to the two functions will function as before. * Add `LinkPredictionTestScoreInterface` as a common ancestor to `LinkPredictNoParamDecoder` and `LinkPredictLearnableDecoder`, this way we can ensure at runtime that the decoder should implement the `calc_test_scores` function that is used by the LP evaluator. * Modify the `GSgnnLPRankingEvalInterface` `evaluate` function to add optional `**kwargs`. In cases where we want to calculate a metric that needs the candidate list lengths we use these kwargs to pass the information. * Modify the `def compute_score(self, rankings, train=True, **kwargs):` to add optional kwargs, currently only used during AMRI calculation. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: xiang song(charlie.song) <[email protected]>
- Loading branch information
1 parent
ed0f698
commit 993a71f
Showing
20 changed files
with
571 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.