hivemall-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myui <...@git.apache.org>
Subject [GitHub] incubator-hivemall pull request #115: [WIP][HIVEMALL-124][BUGFIX] Fixed bugs...
Date Fri, 15 Sep 2017 08:16:31 GMT
Github user myui commented on a diff in the pull request:

    https://github.com/apache/incubator-hivemall/pull/115#discussion_r139088453
  
    --- Diff: core/src/main/java/hivemall/evaluation/BinaryResponsesMeasures.java ---
    @@ -79,8 +91,15 @@ public static double IDCG(final int n) {
          * @return Precision
          */
         public static double Precision(@Nonnull final List<?> rankedList,
    -            @Nonnull final List<?> groundTruth, @Nonnull final int recommendSize)
{
    -        return (double) countTruePositive(rankedList, groundTruth, recommendSize) / recommendSize;
    +            @Nonnull final List<?> groundTruth, @Nonnegative final int recommendSize)
{
    +        if (rankedList.isEmpty()) {
    +            if (groundTruth.isEmpty()) {
    +                return 1.d;
    +            }
    +            return 0.d;
    +        }
    +        final int k = Math.min(rankedList.size(), recommendSize);
    --- End diff --
    
    Fixed in https://github.com/apache/incubator-hivemall/pull/115/commits/759b088370fb9e6b8d17c46dd9d71f7c1980a78a
    
    Recall is as it is.


---

Mime
View raw message