Skip to content

Commit 48a1361

Browse files
committed
variable rename
1 parent 125a4fc commit 48a1361

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

examples/src/main/java/org/apache/spark/examples/ml/JavaImputerExample.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,11 @@ public static void main(String[] args) {
5858
});
5959
Dataset<Row> df = spark.createDataFrame(data, schema);
6060

61-
Imputer imputerModel = new Imputer()
62-
.setStrategy("mean")
61+
Imputer imputer = new Imputer()
6362
.setInputCols(new String[]{"a", "b"})
6463
.setOutputCols(new String[]{"out_a", "out_b"});
6564

66-
ImputerModel model = imputerModel.fit(df);
65+
ImputerModel model = imputer.fit(df);
6766
model.transform(df).show();
6867
// $example off$
6968

examples/src/main/python/ml/imputer_example.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@
4242
], ["a", "b"])
4343

4444
imputer = Imputer(inputCols=["a", "b"], outputCols=["out_a", "out_b"])
45-
imputerModel = imputer.fit(df)
45+
model = imputer.fit(df)
4646

47-
imputedData = imputerModel.transform(df)
48-
imputedData.select("a", "b", "out_a", "out_b").show()
47+
model.transform(df).select("a", "b", "out_a", "out_b").show()
4948
# $example off$
5049

5150
spark.stop()

examples/src/main/scala/org/apache/spark/examples/ml/ImputerExample.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ object ImputerExample {
4444
)).toDF("a", "b")
4545

4646
val imputer = new Imputer()
47-
.setStrategy("mean")
4847
.setInputCols(Array("a", "b"))
4948
.setOutputCols(Array("out_a", "out_b"))
5049

0 commit comments

Comments
 (0)