Created
June 23, 2021 16:45
-
-
Save kshirsagarsiddharth/1de1850f1ca1e7e31db95fec7fba049d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pyspark.ml.recommendation import ALS | |
| from pyspark.ml.evaluation import RegressionEvaluator | |
| from pyspark.ml.feature import StringIndexer | |
| indexer = StringIndexer(inputCol = "isbn", outputCol = "isbn_indexed") | |
| indexed = indexer.fit(filtered_with_location).transform(filtered_with_location)\ | |
| .withColumn('isbn_indexed',F.col('isbn_indexed')\ | |
| .cast("int"))\ | |
| .drop('isbn') | |
| indexed.printSchema() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment