A machine learning engineer would like to develop a linear regression model with Spark ML to predict the price of a hotel room. They are using the Spark DataFrame train_df to train the model.
The Spark DataFrame train_df has the following schema:

The machine learning engineer shares the following code block:

Which of the following changes does the machine learning engineer need to make to complete the task?
In Spark ML, the linear regression model expects the feature column to be a vector type. However, if the features column in the DataFrame train_df is not already in this format (such as being a column of type UDT or a non-vectorized type), the engineer needs to convert it to a vector column using a transformer like VectorAssembler. This is a critical step in preparing the data for modeling as Spark ML models require input features to be combined into a single vector column.
Reference
Tamie
3 months agoRozella
3 months agoRoslyn
3 months agoOnita
4 months agoGaynell
4 months agoSylvie
4 months agoIola
5 months agoMargurite
5 months agoCherry
5 months agoPearlene
5 months agoSharmaine
5 months agoJose
5 months agoElenore
6 months agoLenna
6 months agoLizette
6 months agoWhitney
6 months agoBrent
6 months agoRyan
6 months agoMagda
7 months agoGertude
7 months agoLemuel
7 months agoLauran
7 months agoRoyal
8 months agoKimbery
8 months agoSherell
2 months agoPaul
3 months agoCammy
3 months agoAleta
3 months agoCristal
7 months ago