Complete the code to import the Pipeline class from Spark ML.
from pyspark.ml import [1]
The Pipeline class is used to create ML pipelines in Spark.
Complete the code to create a pipeline with stages stored in a list called 'stages'.
pipeline = Pipeline([1]=stages)The Pipeline constructor expects a parameter named stages which is a list of pipeline stages.
Fix the error in the code to fit the pipeline on a DataFrame called 'df'.
model = pipeline.[1](df)To train the pipeline, use the fit method on the DataFrame.
Fill both blanks to create a pipeline stage that converts a string column 'category' into numeric indices.
indexer = StringIndexer(inputCol=[1], outputCol=[2])
The inputCol is the original string column, and outputCol is the new numeric column name.
Fill all three blanks to create a pipeline stage that assembles features from columns 'col1' and 'col2' into a vector column 'features'.
assembler = VectorAssembler(inputCols=[1], outputCol=[2], handleInvalid=[3])
The inputCols is a list of columns to combine, outputCol is the name of the vector column, and handleInvalid defines how to handle invalid data.
