Repository: spark
Updated Branches:
  refs/heads/branch-1.5 73d062184 -> 7f07cc6d0


[SPARK-10663] Removed unnecessary invocation of DataFrame.toDF method.

The Scala example under the "Example: Pipeline" heading in this
document initializes the "test" variable to a DataFrame. Because test
is already a DF, there is not need to call test.toDF as the example
does in a subsequent line: model.transform(test.toDF). So, I removed
the extraneous toDF invocation.

Author: Matt Hagen <[email protected]>

Closes #8875 from hagenhaus/SPARK-10663.

(cherry picked from commit 558e9c7e60a7c0d85ba26634e97562ad2163e91d)
Signed-off-by: Xiangrui Meng <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/7f07cc6d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/7f07cc6d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/7f07cc6d

Branch: refs/heads/branch-1.5
Commit: 7f07cc6d0fb12bf167a7a3fc5a6f19a0c30f3a2a
Parents: 73d0621
Author: Matt Hagen <[email protected]>
Authored: Tue Sep 22 21:14:25 2015 -0700
Committer: Xiangrui Meng <[email protected]>
Committed: Tue Sep 22 21:14:34 2015 -0700

----------------------------------------------------------------------
 docs/ml-guide.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/7f07cc6d/docs/ml-guide.md
----------------------------------------------------------------------
diff --git a/docs/ml-guide.md b/docs/ml-guide.md
index 8ec1e7e..2d4a7e9 100644
--- a/docs/ml-guide.md
+++ b/docs/ml-guide.md
@@ -466,7 +466,7 @@ val test = sqlContext.createDataFrame(Seq(
 )).toDF("id", "text")
 
 // Make predictions on test documents.
-model.transform(test.toDF)
+model.transform(test)
   .select("id", "text", "probability", "prediction")
   .collect()
   .foreach { case Row(id: Long, text: String, prob: Vector, prediction: 
Double) =>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to