Databricks Machine Learning Associate Question 507
Select 2You are working with a dataset in Databricks that contains a categorical feature named 'Product_Category' and a continuous feature named 'Sales_Amount'. You want to visualize the relationship between these features to identify patterns in sales across different product categories. Which of the following visualizations are most appropriate for this task?
- A
Box plot
- B
Scatter plot
- C
Bar plot
- D
Histogram
- E
Heatmap
Show answer and explanation
Correct answers: A, C
Explanation
To analyze the relationship between a categorical feature ('Product_Category') and a continuous feature ('Sales_Amount'), visualizations like box plots and bar plots are most suitable. Box plots allow for comparison of distributions across categories, while bar plots are useful for showing aggregated metrics (e.g., mean or sum) for each category. Scatter plots, histograms, and heatmaps are not appropriate as they are designed for different types of data relationships.
- A. Correct.
Box plot is a correct choice because it effectively shows the distribution of the continuous feature (Sales_Amount) for each category in the categorical feature (Product_Category), making it easy to compare patterns across categories.
- B. Incorrect.
Scatter plot is not appropriate in this case because it is used to analyze the relationship between two continuous features, while 'Product_Category' is categorical.
- C. Correct.
Bar plot is a correct choice because it can be used to visualize aggregated values of the continuous feature (e.g., average or total Sales_Amount) for each category in the categorical feature (Product_Category).
- D. Incorrect.
Histogram is not suitable here because it is used to visualize the distribution of a single continuous feature, and it does not consider the relationship with a categorical feature.
- E. Incorrect.
Heatmap is not appropriate for this task as it is typically used to visualize correlations or aggregated values across two continuous features, or for summarizing matrix-like data.