Skip to content
Snippets Groups Projects
Commit 558e9c7e authored by Matt Hagen's avatar Matt Hagen Committed by Xiangrui Meng
Browse files

[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 <anonz3000@gmail.com>

Closes #8875 from hagenhaus/SPARK-10663.
parent 84f81e03
No related branches found
No related tags found
No related merge requests found
......@@ -475,7 +475,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) =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment