Databricks Machine Learning Associate Question 509
Select 3You are building a machine learning pipeline in Databricks and need to create visualizations to analyze the distribution of a categorical feature and a continuous feature in your dataset. Which of the following visualizations would be the most appropriate choices?
- A
Bar plot for the categorical feature
- B
Box plot for the continuous feature
- C
Histogram for the categorical feature
- D
Scatter plot for the categorical feature
- E
Histogram for the continuous feature
Show answer and explanation
Correct answers: A, B, E
Explanation
To analyze categorical features, a bar plot is the most appropriate as it visualizes counts or proportions for each category. For continuous features, both a box plot and a histogram are suitable options. Box plots provide insights into the spread, central tendency, and outliers, while histograms visualize the frequency distribution of values.
- A. Correct.
Bar plots are ideal for visualizing the distribution of categorical features as they display counts or proportions for each category.
- B. Correct.
Box plots are suitable for visualizing the distribution and spread of continuous features, including outliers.
- C. Incorrect.
Histograms are not appropriate for categorical features because they are meant for continuous or numerical data.
- D. Incorrect.
Scatter plots are not suitable for visualizing categorical features since they require numerical data on both axes.
- E. Correct.
Histograms are effective for analyzing the distribution of continuous features, showcasing the frequency of values in different ranges.