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
Iola
9 hours agoMargurite
6 days agoCherry
11 days agoPearlene
16 days agoSharmaine
21 days agoJose
26 days agoElenore
1 month agoLenna
1 month agoLizette
1 month agoWhitney
2 months agoBrent
2 months agoRyan
2 months agoMagda
2 months agoGertude
2 months agoLemuel
2 months agoLauran
3 months agoRoyal
3 months agoKimbery
3 months agoCristal
3 months ago