You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/06/11 10:00:30 UTC
[GitHub] [spark] uchiiii opened a new pull request, #36843: [WIP] Add relevance score for nDCG evaluation
uchiiii opened a new pull request, #36843:
URL: https://github.com/apache/spark/pull/36843
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
- To add relevance score to evaluate nDCG in the function `ndcgAt`.
- To extend the interface of constructor of `RankingMetrics` class.
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
- The precise definition of nDCG is [here on Wikipedia](https://en.wikipedia.org/wiki/Discounted_cumulative_gain), where relevance score is used. Currently, the implementation of nDCG on spark (MLlib) treats this as binary (0 or 1). This PR is to extend the `ndcgAt` function to be able to treat relevance score.
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
- I extended the interface of `RankingMetrics` class for `ndcgAt` function, so now it accepts `RDD[(Array[T], Array[T], Array[(T, Double)])]` or `RDD[(Array[T], Array[T])])` as the constructor arguments while the `RDD[(Array[T], Array[T])])` was only accepted.
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### How was this patch tested?
- Test is still WIP.
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897426483
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
Review Comment:
This is also for the case when a user gives `lab` and `rel` of different sizes. `zip` can remove unnecessary elements.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r896862293
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,16 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
-class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])])
- extends Logging with Serializable {
+class RankingMetrics[T: ClassTag](
+ predictionAndLabels: RDD[(Array[T], Array[T], Array[(T, Double)])])
Review Comment:
Thank you for your review.
You definitely have a point. I changed from `(T, Double)` to `Double`
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] zhengruifeng commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r900722612
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
since end users now mainly use the `.ml`, is there any plan to expose this function to `.ml`?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r898059779
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
I made changes and updated the docs.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #36843: [WIP][SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #36843:
URL: https://github.com/apache/spark/pull/36843#issuecomment-1152905357
Can one of the admins verify this patch?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897437412
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -58,9 +65,10 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def precisionAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- countRelevantItemRatio(pred, lab, k, k)
- }.mean()
+ predictionAndLabels.map { case (pred, lab, _) =>
+ countRelevantItemRatio(pred, lab, k, k)
Review Comment:
Unindent - just match how the code was
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897425495
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
+ if (useBinary && lab.size != rel.size) {
+ logWarning(
+ "# of ground truth set and # of relevance value set should be equal, " +
+ "check input data")
}
- if (i < labSetSize) {
- maxDcg += gain
+
+ if (labSet.nonEmpty) {
+ val labSetSize = labSet.size
+ val n = math.min(math.max(pred.length, labSetSize), k)
+ var maxDcg = 0.0
+ var dcg = 0.0
+ var i = 0
+ while (i < n) {
+ if (useBinary) {
+ // Base of the log doesn't matter for calculating NDCG,
+ // if the relevance value is binary.
+ val gain = 1.0 / math.log(i + 2)
+ if (i < pred.length && labSet.contains(pred(i))) {
+ dcg += gain
+ }
+ if (i < labSetSize) {
+ maxDcg += gain
+ }
+ } else {
+ if (i < pred.length) {
Review Comment:
We manage this by `relMap.getOrElse(pred(i), 0.0)` below.
> I would imagine the only difference is the computation of gain, between these two cases
Basically yes. So we could write in the way you suggest without `getOrElse`.
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
+ if (useBinary && lab.size != rel.size) {
+ logWarning(
+ "# of ground truth set and # of relevance value set should be equal, " +
+ "check input data")
}
- if (i < labSetSize) {
- maxDcg += gain
+
+ if (labSet.nonEmpty) {
+ val labSetSize = labSet.size
+ val n = math.min(math.max(pred.length, labSetSize), k)
+ var maxDcg = 0.0
+ var dcg = 0.0
+ var i = 0
+ while (i < n) {
+ if (useBinary) {
+ // Base of the log doesn't matter for calculating NDCG,
+ // if the relevance value is binary.
+ val gain = 1.0 / math.log(i + 2)
+ if (i < pred.length && labSet.contains(pred(i))) {
+ dcg += gain
+ }
+ if (i < labSetSize) {
+ maxDcg += gain
+ }
+ } else {
+ if (i < pred.length) {
Review Comment:
We manage this by `relMap.getOrElse(pred(i), 0.0)` below.
> I would imagine the only difference is the computation of gain, between these two cases
Basically yes. So we could write in the way you suggest without `getOrElse`.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897444041
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -58,9 +65,10 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def precisionAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- countRelevantItemRatio(pred, lab, k, k)
- }.mean()
+ predictionAndLabels.map { case (pred, lab, _) =>
+ countRelevantItemRatio(pred, lab, k, k)
Review Comment:
Fixed !
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] zhengruifeng commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r900721694
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
I think that we should refer to `BinaryClassificationMetrics` and `MulticlassMetrics`, in which `RDD[_ <: Product]` was used as the input.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897423214
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
+ if (useBinary && lab.size != rel.size) {
+ logWarning(
+ "# of ground truth set and # of relevance value set should be equal, " +
+ "check input data")
}
- if (i < labSetSize) {
- maxDcg += gain
+
+ if (labSet.nonEmpty) {
+ val labSetSize = labSet.size
+ val n = math.min(math.max(pred.length, labSetSize), k)
+ var maxDcg = 0.0
+ var dcg = 0.0
+ var i = 0
+ while (i < n) {
+ if (useBinary) {
+ // Base of the log doesn't matter for calculating NDCG,
+ // if the relevance value is binary.
+ val gain = 1.0 / math.log(i + 2)
+ if (i < pred.length && labSet.contains(pred(i))) {
+ dcg += gain
+ }
+ if (i < labSetSize) {
+ maxDcg += gain
+ }
+ } else {
+ if (i < pred.length) {
+ dcg += (math.pow(2.0, relMap.getOrElse(pred(i), 0.0)) - 1) / math.log(i + 2)
Review Comment:
This line and the line below (maxDcg) are different. `relMap.getOrElse(pred(i), 0.0)` or `relMap.getOrElse(lab(i), 0.0)`. Thus these could not be one expression.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r901102306
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
For the first one - yeah this change is in the 'older' .mllib package. I don't think there is an equivalent for it in the DataFrame-based .ml packages, so, maybe we can ignore that here. But if nDCG is supported in the .ml package somewhere and I forgot it, would be good to add it there too.
The declaration suggested here might actually work for both input types without a separate constructor. Try it maybe? if it works, yes, that is simpler, and lets this API support even more inputs
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r901315346
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
Thank you for your explanation!
Could you review this?
https://github.com/apache/spark/pull/36920
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897424754
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
+ if (useBinary && lab.size != rel.size) {
+ logWarning(
+ "# of ground truth set and # of relevance value set should be equal, " +
+ "check input data")
}
- if (i < labSetSize) {
- maxDcg += gain
+
+ if (labSet.nonEmpty) {
+ val labSetSize = labSet.size
+ val n = math.min(math.max(pred.length, labSetSize), k)
+ var maxDcg = 0.0
+ var dcg = 0.0
+ var i = 0
+ while (i < n) {
+ if (useBinary) {
+ // Base of the log doesn't matter for calculating NDCG,
+ // if the relevance value is binary.
+ val gain = 1.0 / math.log(i + 2)
+ if (i < pred.length && labSet.contains(pred(i))) {
+ dcg += gain
+ }
+ if (i < labSetSize) {
+ maxDcg += gain
+ }
+ } else {
+ if (i < pred.length) {
+ dcg += (math.pow(2.0, relMap.getOrElse(pred(i), 0.0)) - 1) / math.log(i + 2)
Review Comment:
Ah I see it now.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897422167
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
Review Comment:
This is to calculate the `dcg` fast. When `dcg` is calculated, the relevance score of pred(i) is required. (`lab` and `rel` is parallel but pred is not`)
ref:
- https://spark.apache.org/docs/1.5.0/mllib-evaluation-metrics.html#ranking-systems
- https://github.com/apache/spark/pull/36843/files#diff-5b07c866965423f2ef414592a98e8d22426bd641463d35094bd1ece2656d3657R144
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen closed pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen closed pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
URL: https://github.com/apache/spark/pull/36843
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r896862293
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,16 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
-class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])])
- extends Logging with Serializable {
+class RankingMetrics[T: ClassTag](
+ predictionAndLabels: RDD[(Array[T], Array[T], Array[(T, Double)])])
Review Comment:
Thank you for your review.
You definitely have a point. I changed from `(T, Double)` to `Double`.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r896869772
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -58,9 +66,12 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def precisionAt(k: Int): Double = {
Review Comment:
I do not think so. As far as I know and search, there is no other definition of precision and the current implementation is enough.
FYI: [Wikipedia for precision and recall](https://en.wikipedia.org/wiki/Precision_and_recall)
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r896243825
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,16 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
-class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])])
- extends Logging with Serializable {
+class RankingMetrics[T: ClassTag](
+ predictionAndLabels: RDD[(Array[T], Array[T], Array[(T, Double)])])
Review Comment:
Hm, why does the last need to be (T, Double) pairs? Wouldn't this be an attribute of the ground truth? Looking this up via Map seems clunky later. The problem is not changing the binary signature, but, at least, how about a third array of Double only, that is parallel to the second array?
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -58,9 +66,12 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def precisionAt(k: Int): Double = {
Review Comment:
Is there any similar notion of precision@k when the ground truth has a relevance 'weight'?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897422167
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
Review Comment:
This is to calculate the `dcg` fast. When `dcg` is calculated, the relevance score of pred(i) is required. (`lab` and `rel` is parallel but pred is not`)
FYI:
- https://spark.apache.org/docs/1.5.0/mllib-evaluation-metrics.html#ranking-systems
- https://github.com/apache/spark/pull/36843/files#diff-5b07c866965423f2ef414592a98e8d22426bd641463d35094bd1ece2656d3657R144
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897945325
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
Oh, we need to update the `@Since` tags. I think you can somehow add a `@Since` annotation to the default constructor args? as it's since 3.4.0. I'm not sure exactly where it goes. The old constructor can remain since 1.2.0. If that doesn't work, maybe we can leave this constructor and add the new one as a new `def this(...)` since 3.4.0?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r896914108
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
Review Comment:
Why make a map here? isn't the indexing into the `rel` array the same? Also I'd avoid the 'infix' notation in Spark code
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
+ if (useBinary && lab.size != rel.size) {
+ logWarning(
+ "# of ground truth set and # of relevance value set should be equal, " +
+ "check input data")
}
- if (i < labSetSize) {
- maxDcg += gain
+
+ if (labSet.nonEmpty) {
+ val labSetSize = labSet.size
+ val n = math.min(math.max(pred.length, labSetSize), k)
+ var maxDcg = 0.0
+ var dcg = 0.0
+ var i = 0
+ while (i < n) {
+ if (useBinary) {
+ // Base of the log doesn't matter for calculating NDCG,
+ // if the relevance value is binary.
+ val gain = 1.0 / math.log(i + 2)
+ if (i < pred.length && labSet.contains(pred(i))) {
+ dcg += gain
+ }
+ if (i < labSetSize) {
+ maxDcg += gain
+ }
+ } else {
+ if (i < pred.length) {
+ dcg += (math.pow(2.0, relMap.getOrElse(pred(i), 0.0)) - 1) / math.log(i + 2)
Review Comment:
Pull out the right side as one expression, as in the code above, with `val gain`? to not compute it twice
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
Review Comment:
Can you revert these changes that made one line into 3? the original was better IMHO
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
+ if (useBinary && lab.size != rel.size) {
+ logWarning(
+ "# of ground truth set and # of relevance value set should be equal, " +
+ "check input data")
}
- if (i < labSetSize) {
- maxDcg += gain
+
+ if (labSet.nonEmpty) {
+ val labSetSize = labSet.size
+ val n = math.min(math.max(pred.length, labSetSize), k)
+ var maxDcg = 0.0
+ var dcg = 0.0
+ var i = 0
+ while (i < n) {
+ if (useBinary) {
+ // Base of the log doesn't matter for calculating NDCG,
+ // if the relevance value is binary.
+ val gain = 1.0 / math.log(i + 2)
+ if (i < pred.length && labSet.contains(pred(i))) {
+ dcg += gain
+ }
+ if (i < labSetSize) {
+ maxDcg += gain
+ }
+ } else {
+ if (i < pred.length) {
Review Comment:
Does this not need `labSet.contains(pred(i))`?
I would imagine the only difference is the computation of `gain`, between these two cases
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r897424639
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -142,33 +158,57 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], Array[T])]
@Since("1.2.0")
def ndcgAt(k: Int): Double = {
require(k > 0, "ranking position k should be positive")
- predictionAndLabels.map { case (pred, lab) =>
- val labSet = lab.toSet
-
- if (labSet.nonEmpty) {
- val labSetSize = labSet.size
- val n = math.min(math.max(pred.length, labSetSize), k)
- var maxDcg = 0.0
- var dcg = 0.0
- var i = 0
- while (i < n) {
- // Base of the log doesn't matter for calculating NDCG,
- // if the relevance value is binary.
- val gain = 1.0 / math.log(i + 2)
- if (i < pred.length && labSet.contains(pred(i))) {
- dcg += gain
+ predictionAndLabels
+ .map {
+ case (pred, lab, rel) =>
+ val useBinary = rel.isEmpty
+ val labSet = lab.toSet
+ val relMap = (lab zip rel).toMap
Review Comment:
Oh I understand. We know the relevance of the labels but not necessarily predictions. I suppose this imposes some requirements on the type of `lab` but I think that's reasonable, as far as I can think of
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] uchiiii commented on a diff in pull request #36843: [SPARK-39446][MLLIB] Add relevance score for nDCG evaluation
Posted by GitBox <gi...@apache.org>.
uchiiii commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r901078835
##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,15 @@ import org.apache.spark.rdd.RDD
* @param predictionAndLabels an RDD of (predicted ranking, ground truth set) pairs.
*/
@Since("1.2.0")
Review Comment:
Sorry in advance for my poor understanding. I have some questions.
- What is `.ml` ? Do you mean `org.apache.spark.ml` ?
- `RDD[_ <: Product]` is used to make`MulticlassMetric` class available to `.ml` ?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org