Valid Databricks-Machine-Learning-Associate Dumps shared by ExamDiscuss.com for Helping Passing Databricks-Machine-Learning-Associate Exam! ExamDiscuss.com now offer the newest Databricks-Machine-Learning-Associate exam dumps, the ExamDiscuss.com Databricks-Machine-Learning-Associate exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com Databricks-Machine-Learning-Associate dumps with Test Engine here:
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?
Correct Answer: B
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 Spark MLlib documentation for LinearRegression: https://spark.apache.org/docs/latest/ml-classification-regression.html#linear-regression