Databricks Machine Learning Associate Question 559
Select 2You are working on a machine learning pipeline in Databricks. You need to preprocess your dataset by scaling the numerical features and then train a regression model. Which of the following components in the pipeline would typically act as an estimator?
- A
A StandardScaler used to compute the mean and standard deviation from the training data
- B
A trained StandardScaler that applies scaling to transform the dataset
- C
A LinearRegression model that learns the coefficients from the data
- D
A trained LinearRegression model used to predict target values from input features
- E
A Pandas DataFrame containing the raw dataset
Show answer and explanation
Correct answers: A, C
Explanation
Estimators in a machine learning pipeline are components that learn parameters from data during their fit process, such as the mean and standard deviation for scaling or the coefficients in a regression model. Transformers, on the other hand, apply these learned parameters to transform the data. In this scenario, the initial StandardScaler and LinearRegression model are estimators because they learn from the training data during fitting.
- A. Correct.
Correct: A StandardScaler in its initial state (before fitting) is an estimator because it learns the mean and standard deviation from the training data during the fit process.
- B. Incorrect.
Incorrect: Once the StandardScaler has been fitted, it becomes a transformer because it is used to transform the dataset.
- C. Correct.
Correct: A LinearRegression model in its initial state is an estimator because it learns the coefficients from the training data during the fit process.
- D. Incorrect.
Incorrect: A trained LinearRegression model is used for making predictions and no longer acts as an estimator.
- E. Incorrect.
Incorrect: A Pandas DataFrame is simply a data structure and not an estimator or transformer.