From b9fc66c4250f305a095c7a748d514c53af3588ff Mon Sep 17 00:00:00 2001 From: Renat Bekbolatov Date: Tue, 11 Jan 2022 16:43:13 -0800 Subject: [PATCH] update OneHotEncoder class name --- .../sparkml/train_score_export_ml_models_with_spark.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/features/sql-big-data-cluster/spark/sparkml/train_score_export_ml_models_with_spark.ipynb b/samples/features/sql-big-data-cluster/spark/sparkml/train_score_export_ml_models_with_spark.ipynb index 4d339123..ad799a52 100644 --- a/samples/features/sql-big-data-cluster/spark/sparkml/train_score_export_ml_models_with_spark.ipynb +++ b/samples/features/sql-big-data-cluster/spark/sparkml/train_score_export_ml_models_with_spark.ipynb @@ -313,7 +313,7 @@ "cell_type": "code", "source": [ "from pyspark.ml import Pipeline, PipelineModel\r\n", - "from pyspark.ml.feature import OneHotEncoderEstimator, StringIndexer, VectorAssembler\r\n", + "from pyspark.ml.feature import OneHotEncoder, StringIndexer, VectorAssembler\r\n", "from pyspark.ml.classification import LogisticRegression\r\n", "\r\n", "reg = 0.1\r\n", @@ -335,7 +335,7 @@ " \r\n", " tmpCol = \"-\".join([key, \"tmp\"])\r\n", " si_xvars.append(StringIndexer(inputCol=key, outputCol=tmpCol, handleInvalid=\"skip\")) #, handleInvalid=\"keep\"\r\n", - " ohe_xvars.append(OneHotEncoderEstimator(inputCols=[tmpCol], outputCols=[featureCol]))\r\n", + " ohe_xvars.append(OneHotEncoder(inputCols=[tmpCol], outputCols=[featureCol]))\r\n", " else:\r\n", " featureCols.append(key)\r\n", "\r\n", @@ -378,7 +378,7 @@ }, { "name": "stdout", - "text": "Using LogisticRegression model with Regularization Rate of 0.1.\nPipeline Created\nModel Trained\nModel is PipelineModel_dd10dea16fcc\nModel Stages [StringIndexer_a72809f2344f, OneHotEncoderEstimator_bff5847e2bae, StringIndexer_e62df3c26c82, VectorAssembler_e84f4c37608c, LogisticRegressionModel: uid = LogisticRegression_96385e6ff190, numClasses = 2, numFeatures = 17]", + "text": "Using LogisticRegression model with Regularization Rate of 0.1.\nPipeline Created\nModel Trained\nModel is PipelineModel_dd10dea16fcc\nModel Stages [StringIndexer_a72809f2344f, OneHotEncoder_bff5847e2bae, StringIndexer_e62df3c26c82, VectorAssembler_e84f4c37608c, LogisticRegressionModel: uid = LogisticRegression_96385e6ff190, numClasses = 2, numFeatures = 17]", "output_type": "stream" } ], @@ -550,4 +550,4 @@ "execution_count": 27 } ] -} \ No newline at end of file +}