Databricks Machine Learning Associate Question 155
Select 5You are using Databricks to train a machine learning model and want to analyze the distribution of features in your dataset. You decide to use the 'summary' method on a DataFrame to better understand the statistics of each feature. Which of the following outputs are provided by the 'summary' method in Databricks?
- A
Mean value for each numeric column
- B
Standard deviation for each numeric column
- C
Median value for each numeric column
- D
Count of non-null values for each column
- E
Maximum value for each numeric column
- F
Minimum value for each numeric column
Show answer and explanation
Correct answers: A, B, D, E, F
Explanation
The 'summary' method in Databricks provides a quick statistical overview of a DataFrame, including metrics such as count, mean, standard deviation, minimum, and maximum for numeric columns. However, it does not compute the median by default, as that would require additional computation for percentile-based statistics.
- A. Correct.
The 'mean' (average) value is included in the output of the 'summary' method for numeric columns.
- B. Correct.
The 'stddev' (standard deviation) is included in the output of the 'summary' method for numeric columns.
- C. Incorrect.
The median value is not included in the default output of the 'summary' method. The median (50th percentile) would require descriptive statistics or custom computation.
- D. Correct.
The 'count' (number of non-null values) for each column is included in the output of the 'summary' method.
- E. Correct.
The 'max' (maximum value) is included in the output of the 'summary' method for numeric columns.
- F. Correct.
The 'min' (minimum value) is included in the output of the 'summary' method for numeric columns.