Databricks Machine Learning Associate Question 515
Single answerYou are tasked with analyzing a dataset in Databricks to understand the relationship between two continuous features: 'age' and 'income'. Which of the following methods should you use to compare these features?
- A
Calculate the Pearson correlation coefficient between 'age' and 'income'
- B
Perform a Chi-Square test between 'age' and 'income'
- C
Use a box plot to compare 'age' and 'income'
- D
Apply a t-test to compare 'age' and 'income'
Show answer and explanation
Correct answer: A
Explanation
To compare two continuous features, such as 'age' and 'income', the Pearson correlation coefficient is the best method as it quantifies the linear relationship between them. Other methods, like the Chi-Square test or t-test, are designed for different types of comparisons and are not suitable in this context.
- A. Correct.
Correct. The Pearson correlation coefficient is the appropriate method to measure the strength and direction of the linear relationship between two continuous features.
- B. Incorrect.
Incorrect. The Chi-Square test is used to assess the independence or association between two categorical variables, not continuous variables.
- C. Incorrect.
Incorrect. A box plot is used to visualize the distribution of a single variable or to compare one continuous variable across multiple categories. It is not suitable for directly comparing the relationship between two continuous variables.
- D. Incorrect.
Incorrect. A t-test is used to compare the means of two groups (e.g., a continuous feature across two categories) and is not appropriate for comparing the relationship between two continuous features.