CertLumen

Databricks Machine Learning Associate · Section 2 · 19% of the exam

Identify scenarios where log scale transformation is appropriate

One of the objectives of the Databricks Certified Machine Learning Associate exam, in the section “Data Processing”. Here is what it covers, the points to remember and a question to try.

What it covers

Choose the right chart for categorical and continuous features, compare two continuous features with scatter plots and correlation and two categorical features with contingency tables and the chi-square test, and recognize when a log transform makes a skewed feature or target easier to model.

Points to remember

  • One categorical feature: bar chart of counts. One continuous feature: histogram or box plot.
  • Categorical versus continuous: box plot per category.
  • Two continuous features: scatter plot plus correlation. Pearson measures linear association; Spearman uses ranks and is robust to outliers.
  • df.stat.corr supports only Pearson; pyspark.ml.stat.Correlation.corr(df, vecCol, 'spearman') gives a Spearman matrix.
  • Two categorical features: df.stat.crosstab(c1, c2) as a heatmap or stacked bar, plus ChiSquareTest for independence.

Try a question

Before choosing a model, a data scientist wants to see whether listing price rises with square footage and whether the relationship looks linear. Both sqft and price are continuous. Which visualization should they create first?

  1. AA pie chart of total price per square-footage value
  2. BA scatter plot of sqft against price
  3. CA bar chart of row counts per sqft value
  4. DA contingency table of sqft and price shown as a heatmap
Show the answer

B. A scatter plot shows the direction, strength and shape (linear or curved) of the relationship between two continuous features, and extreme points stand out. Quantify it afterwards with a correlation coefficient: Pearson for a linear relationship, Spearman for a monotonic one or when outliers are present. Bar and pie charts and contingency tables are for categorical features.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Visualizing, Comparing and Log-Transforming Features teaches this objective (about 40 minutes), and 16 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 48 objectives · Next objective →