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
2 months agoRozella
2 months agoRoslyn
2 months agoOnita
2 months agoGaynell
2 months agoSylvie
2 months agoIola
3 months agoMargurite
3 months agoCherry
3 months agoPearlene
4 months agoSharmaine
4 months agoJose
4 months agoElenore
4 months agoLenna
4 months agoLizette
4 months agoWhitney
5 months agoBrent
5 months agoRyan
5 months agoMagda
5 months agoGertude
5 months agoLemuel
5 months agoLauran
6 months agoRoyal
6 months agoKimbery
6 months agoSherell
26 days agoPaul
1 month agoCammy
1 month agoAleta
1 month agoCristal
6 months ago