Skip to content

Commit

Permalink
All examples under spark scala - String interpolation has implemented…
Browse files Browse the repository at this point in the history
… - 2
  • Loading branch information
chetkhatri committed Dec 26, 2017
1 parent 8d729fa commit 5507cad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ object SimpleSkewedGroupByTest {
pairs1.count

println(s"RESULT: ${pairs1.groupByKey(numReducers).count}")
// Print how many keys each reducer got (for debugging)
// println("RESULT: " + pairs1.groupByKey(numReducers)
// .map{case (k,v) => (k, v.size)}
// .collectAsMap)

spark.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ object DecisionTreeRegressionExample {
.setPredictionCol("prediction")
.setMetricName("rmse")
val rmse = evaluator.evaluate(predictions)
println("Root Mean Squared Error (RMSE) on test data = " + rmse)
println(s"Root Mean Squared Error (RMSE) on test data = $rmse")

val treeModel = model.stages(1).asInstanceOf[DecisionTreeRegressionModel]
println("Learned regression tree model:\n" + treeModel.toDebugString)
println(s"Learned regression tree model:\n ${treeModel.toDebugString}")
// $example off$

spark.stop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ object VectorIndexerExample {
val indexerModel = indexer.fit(data)

val categoricalFeatures: Set[Int] = indexerModel.categoryMaps.keys.toSet
println(s"Chose ${categoricalFeatures.size} categorical features: " +
categoricalFeatures.mkString(", "))
println(s"Chose ${categoricalFeatures.size} " +
s"categorical features: {$categoricalFeatures.mkString(", ")}")

// Create new column "indexed" with categorical values transformed to indices
val indexedData = indexerModel.transform(data)
Expand Down

0 comments on commit 5507cad

Please sign in to comment.