Github user etrain commented on a diff in the pull request:
https://github.com/apache/spark/pull/3637#discussion_r22679713
--- Diff:
examples/src/main/scala/org/apache/spark/examples/ml/CrossValidatorExample.scala
---
@@ -101,10 +102,10 @@ object CrossValidatorExample {
// Make predictions on test documents. cvModel uses the best model
found (lrModel).
cvModel.transform(test)
- .select('id, 'text, 'score, 'prediction)
+ .select('id, 'text, 'probability, 'prediction)
.collect()
- .foreach { case Row(id: Long, text: String, score: Double,
prediction: Double) =>
- println("(" + id + ", " + text + ") --> score=" + score + ",
prediction=" + prediction)
+ .foreach { case Row(id: Long, text: String, prob: Vector,
prediction: Double) =>
+ println("(" + id + ", " + text + ") --> prob=" + prob + ",
prediction=" + prediction)
--- End diff --
Minor nit - I find string interpolation (compatible with Scala 2.10+) makes
these kinds of lines much more readable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]