guilhem-depop opened a new pull request, #42207:
URL: https://github.com/apache/spark/pull/42207

   ### What changes were proposed in this pull request?
   
   This PR fixes the condition to raise the following warning in MLLib's 
RankingMetrics ndcgAk function: "# of ground truth set and # of relevance value 
set should be equal, check input data"
   
   The logic for raising warnings is faulty at the moment: it raises a warning 
if the `rel` input is empty and `lab.size` and `rel.size` are not equal.
   
   The logic should be to raise a warning if `rel` input is **not empty** and 
`lab.size` and `rel.size` are not equal.
   
   
   ### Why are the changes needed?
   
   With the current logic, RankingMetrics will:
   - raise incorrect warning when a user is using it in the "binary" mode (i.e. 
no relevance values in the input)
   - not raise warning (that could be necessary) when the user is using it in 
the "non-binary" model (i.e. with relevance values in the input)
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   No change made to the test suite for RankingMetrics: 
https://github.com/uchiiii/spark/blob/a172172329cc78b50f716924f2a344517deb71fc/mllib/src/test/scala/org/apache/spark/mllib/evaluation/RankingMetricsSuite.scala
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to