@@ -60,7 +60,7 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
6060 (aggregator1, aggregator2) => aggregator1.merge(aggregator2))
6161 }
6262
63- test(" Standardization with dense input when means and variances are provided" ) {
63+ test(" Standardization with dense input when means and stds are provided" ) {
6464
6565 val dataRDD = sc.parallelize(denseData, 3 )
6666
@@ -72,9 +72,9 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
7272 val model2 = standardizer2.fit(dataRDD)
7373 val model3 = standardizer3.fit(dataRDD)
7474
75- val equivalentModel1 = new StandardScalerModel (model1.variance , model1.mean)
76- val equivalentModel2 = new StandardScalerModel (model2.variance , model2.mean, true , false )
77- val equivalentModel3 = new StandardScalerModel (model3.variance , model3.mean, false , true )
75+ val equivalentModel1 = new StandardScalerModel (model1.std , model1.mean)
76+ val equivalentModel2 = new StandardScalerModel (model2.std , model2.mean, true , false )
77+ val equivalentModel3 = new StandardScalerModel (model3.std , model3.mean, false , true )
7878
7979 val data1 = denseData.map(equivalentModel1.transform)
8080 val data2 = denseData.map(equivalentModel2.transform)
@@ -193,7 +193,7 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
193193 }
194194
195195
196- test(" Standardization with sparse input when means and variances are provided" ) {
196+ test(" Standardization with sparse input when means and stds are provided" ) {
197197
198198 val dataRDD = sc.parallelize(sparseData, 3 )
199199
@@ -205,9 +205,9 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
205205 val model2 = standardizer2.fit(dataRDD)
206206 val model3 = standardizer3.fit(dataRDD)
207207
208- val equivalentModel1 = new StandardScalerModel (model1.variance , model1.mean)
209- val equivalentModel2 = new StandardScalerModel (model2.variance , model2.mean, true , false )
210- val equivalentModel3 = new StandardScalerModel (model3.variance , model3.mean, false , true )
208+ val equivalentModel1 = new StandardScalerModel (model1.std , model1.mean)
209+ val equivalentModel2 = new StandardScalerModel (model2.std , model2.mean, true , false )
210+ val equivalentModel3 = new StandardScalerModel (model3.std , model3.mean, false , true )
211211
212212 val data2 = sparseData.map(equivalentModel2.transform)
213213
@@ -288,7 +288,7 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
288288 assert(data2(5 ) ~== Vectors .sparse(3 , Seq ((1 , 0.71580142 ))) absTol 1E-5 )
289289 }
290290
291- test(" Standardization with constant input when means and variances are provided" ) {
291+ test(" Standardization with constant input when means and stds are provided" ) {
292292
293293 val dataRDD = sc.parallelize(constantData, 2 )
294294
@@ -300,9 +300,9 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
300300 val model2 = standardizer2.fit(dataRDD)
301301 val model3 = standardizer3.fit(dataRDD)
302302
303- val equivalentModel1 = new StandardScalerModel (model1.variance , model1.mean)
304- val equivalentModel2 = new StandardScalerModel (model2.variance , model2.mean, true , false )
305- val equivalentModel3 = new StandardScalerModel (model3.variance , model3.mean, false , true )
303+ val equivalentModel1 = new StandardScalerModel (model1.std , model1.mean)
304+ val equivalentModel2 = new StandardScalerModel (model2.std , model2.mean, true , false )
305+ val equivalentModel3 = new StandardScalerModel (model3.std , model3.mean, false , true )
306306
307307 val data1 = constantData.map(equivalentModel1.transform)
308308 val data2 = constantData.map(equivalentModel2.transform)
@@ -342,12 +342,12 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
342342
343343 test(" StandardScalerModel argument nulls are properly handled" ) {
344344
345- withClue(" model needs at least one of variance or mean vectors" ) {
345+ withClue(" model needs at least one of std or mean vectors" ) {
346346 intercept[IllegalArgumentException ] {
347347 val model = new StandardScalerModel (null , null )
348348 }
349349 }
350- withClue(" model needs variance to set withStd to true" ) {
350+ withClue(" model needs std to set withStd to true" ) {
351351 intercept[IllegalArgumentException ] {
352352 val model = new StandardScalerModel (null , Vectors .dense(0.0 ))
353353 model.setWithStd(true )
@@ -359,7 +359,7 @@ class StandardScalerSuite extends FunSuite with MLlibTestSparkContext {
359359 model.setWithMean(true )
360360 }
361361 }
362- withClue(" model needs variance and mean vectors to be equal size when both are provided" ) {
362+ withClue(" model needs std and mean vectors to be equal size when both are provided" ) {
363363 intercept[IllegalArgumentException ] {
364364 val model = new StandardScalerModel (Vectors .dense(0.0 ), Vectors .dense(0.0 ,1.0 ))
365365 }
0 commit comments