srowen commented on a change in pull request #23589: [SPARK-26351][mllib]Update
doc and minor correction in the mllib evaluation metrics
URL: https://github.com/apache/spark/pull/23589#discussion_r249248310
##########
File path: docs/mllib-evaluation-metrics.md
##########
@@ -439,21 +439,21 @@ $$rel_D(r) = \begin{cases}1 & \text{if $r \in D$}, \\ 0
& \text{otherwise}.\end{
Precision at k
</td>
<td>
- $p(k)=\frac{1}{M} \sum_{i=0}^{M-1} {\frac{1}{k}
\sum_{j=0}^{\text{min}(\left|D\right|, k) - 1} rel_{D_i}(R_i(j))}$
+ $p(k)=\frac{1}{M} \sum_{i=0}^{M-1} {\frac{1}{k}
\sum_{j=0}^{\text{min}(\left|R_i\right|, k) - 1} rel_{D_i}(R_i(j))}$
</td>
<td>
- <a
href="https://en.wikipedia.org/wiki/Information_retrieval#Precision_at_K">Precision
at k</a> is a measure of
+ <a
href="https://en.wikipedia.org/wiki/Evaluation_measures_(information_retrieval)#Precision_at_K">Precision
at k</a> is a measure of
how many of the first k recommended documents are in the set of true
relevant documents averaged across all
users. In this metric, the order of the recommendations is not taken
into account.
</td>
</tr>
<tr>
<td>Mean Average Precision</td>
<td>
- $MAP=\frac{1}{M} \sum_{i=0}^{M-1} {\frac{1}{\left|D_i\right|}
\sum_{j=0}^{Q-1} \frac{rel_{D_i}(R_i(j))}{j + 1}}$
+ $MAP=\frac{1}{M} \sum_{i=0}^{M-1} {\frac{1}{\left|R_i\right|}
\sum_{j=0}^{\left|R_i\right|-1} \frac{rel_{D_i}(R_i(j))}{j + 1}}$
Review comment:
I'm not sure if dividing by R_i is right here, but see below.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]