diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala | 4 | ||||
-rw-r--r-- | examples/src/main/scala/org/apache/spark/examples/ml/OneVsRestExample.scala | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala b/examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala index 82bc14789b..5cd13ad64c 100644 --- a/examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala +++ b/examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala @@ -21,7 +21,7 @@ package org.apache.spark.examples.ml // $example on$ import org.apache.spark.ml.feature.Binarizer // $example off$ -import org.apache.spark.sql.{DataFrame, SparkSession} +import org.apache.spark.sql.{SparkSession} object BinarizerExample { def main(args: Array[String]): Unit = { @@ -31,7 +31,7 @@ object BinarizerExample { .getOrCreate() // $example on$ val data = Array((0, 0.1), (1, 0.8), (2, 0.2)) - val dataFrame: DataFrame = spark.createDataFrame(data).toDF("label", "feature") + val dataFrame = spark.createDataFrame(data).toDF("label", "feature") val binarizer: Binarizer = new Binarizer() .setInputCol("feature") diff --git a/examples/src/main/scala/org/apache/spark/examples/ml/OneVsRestExample.scala b/examples/src/main/scala/org/apache/spark/examples/ml/OneVsRestExample.scala index 0b333cf629..0da8e3137a 100644 --- a/examples/src/main/scala/org/apache/spark/examples/ml/OneVsRestExample.scala +++ b/examples/src/main/scala/org/apache/spark/examples/ml/OneVsRestExample.scala @@ -21,7 +21,6 @@ package org.apache.spark.examples.ml // $example on$ import org.apache.spark.ml.classification.{LogisticRegression, OneVsRest} import org.apache.spark.ml.evaluation.MulticlassClassificationEvaluator -import org.apache.spark.sql.DataFrame // $example off$ import org.apache.spark.sql.SparkSession @@ -43,7 +42,7 @@ object OneVsRestExample { // $example on$ // load data file. - val inputData: DataFrame = spark.read.format("libsvm") + val inputData = spark.read.format("libsvm") .load("data/mllib/sample_multiclass_classification_data.txt") // generate the train/test split. |