Skip to content

Commit

Permalink
Removing commented code.
Browse files Browse the repository at this point in the history
Signed-off-by: jzonthemtn <[email protected]>
  • Loading branch information
jzonthemtn committed Dec 10, 2024
1 parent 15f9253 commit 5235224
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,13 @@ public long calculateCoec(final Map<Integer, Double> rankAggregatedClickThrough,
final double meanCtrAtRank = rankAggregatedClickThrough.getOrDefault(r, 0.0);
final long countOfTimesShownAtRank = openSearchHelper.getCountOfQueriesForUserQueryHavingResultInRankR(userQuery, ctr.getObjectId(), r);

// System.out.println("rank = " + r);
// System.out.println("\tmeanCtrAtRank = " + meanCtrAtRank);
// System.out.println("\tcountOfTimesShownAtRank = " + countOfTimesShownAtRank);

denominatorSum += (meanCtrAtRank * countOfTimesShownAtRank);

}

// Numerator is sum of clicks at all ranks up to the maxRank.
final int totalNumberClicksForQueryResult = ctr.getClicks();

// System.out.println("numerator = " + totalNumberClicksForQueryResult);
// System.out.println("denominator = " + denominatorSum);

// Divide the numerator by the denominator (value).
final double judgment = totalNumberClicksForQueryResult / denominatorSum;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,47 +58,6 @@ public Map<String, Object> getJudgmentAsMap() {

}

/**
* A convenience function to output the judgments.
* @param judgments A collection of {@link Judgment}.
*/
public static void showJudgments(final Collection<Judgment> judgments) {

LOGGER.info("query_id, query, document, judgment");

for(final Judgment judgment : judgments) {
LOGGER.info(judgment.toJudgmentString());
}

}

/**
* Find a judgment in a collection of judgments.
* @param judgments The collection of {@link Judgment judgments}.
* @param query The query to find.
* @param documentId The document ID to find.
* @return The matching {@link Judgment judgment}.
*/
public static Judgment findJudgment(final Collection<Judgment> judgments, final String query, final String documentId) {

for(final Judgment judgment : judgments) {

// LOGGER.info("Comparing {}:{} with {}:{}", judgment.getQuery(), judgment.getDocument(), query, documentId);

if(judgment.getQuery().equalsIgnoreCase(query) && judgment.getDocument().equalsIgnoreCase(documentId)) {
LOGGER.info("Judgment score of {} for query {} and document {} was found.", judgment.getJudgment(), query, documentId);
return judgment;
}

}

// A judgment for this query and document was not found.
LOGGER.warn("A judgment for query {} and document {} was not found.", query, documentId);
// TODO: Would this ever happen?
return null;

}

@Override
public String toString() {
return "query_id: " + queryId + ", query: " + query + ", document: " + document + ", judgment: " + MathUtils.round(judgment);
Expand Down

0 comments on commit 5235224

Please sign in to comment.