Databricks Machine Learning Associate Question 511
Select 2You are working on a machine learning project in Databricks and want to visualize the distribution of a continuous feature named 'age' and its relationship with a categorical feature named 'income_level'. Which of the following visualizations would be the most appropriate to use in this scenario?
- A
Box plot
- B
Histogram
- C
Scatter plot
- D
Violin plot
- E
Bar chart
Show answer and explanation
Correct answers: A, D
Explanation
To visualize the distribution of a continuous feature ('age') and its relationship with a categorical feature ('income_level'), both box plots and violin plots are appropriate choices. Box plots summarize the distribution using quartiles, while violin plots provide additional information by showing the density of the data. Histograms, scatter plots, and bar charts do not meet the requirements of this specific scenario.
- A. Correct.
Box plot is suitable for visualizing the distribution of a continuous feature (like 'age') and its relationship with a categorical feature (like 'income_level'), making it a correct choice in this scenario.
- B. Incorrect.
Histogram is used to show the distribution of a single continuous feature, but it does not incorporate a categorical feature, so it does not address the full requirements of the question.
- C. Incorrect.
Scatter plot is ideal for visualizing the relationship between two continuous features, but it is not appropriate for combining a continuous feature with a categorical feature.
- D. Correct.
Violin plot is an excellent choice as it extends the box plot by showing the kernel density estimate of the distribution for each category of the categorical feature, making it suitable for this scenario.
- E. Incorrect.
Bar chart is typically used to display the frequency or proportions of categories in a categorical feature but is not appropriate for visualizing a continuous feature like 'age'.