Courseiva
Question 24 of 1,672
Exploratory Data AnalysiseasyMultiple ChoiceObjective-mapped

Log Transformation for Skewed Features in Regression

A machine learning engineer is working on a regression problem to predict house prices. The dataset contains 500,000 rows and 20 features, including 'sqft_living', 'bedrooms', 'bathrooms', 'floors', 'waterfront', 'view', 'condition', 'grade', 'yr_built', 'zipcode', and 'lat'. After performing exploratory data analysis, the engineer notices that the 'sqft_living' feature has a right-skewed distribution with a long tail. The 'zipcode' feature is categorical with 70 unique values. The 'lat' feature is continuous. The engineer wants to prepare the data for a linear regression model. Which action should the engineer take to improve model performance?

Quick Answer

The correct action is to apply a log transformation to the 'sqft_living' feature. This is necessary because linear regression assumes that features are approximately normally distributed, and a right-skewed distribution with a long tail violates that assumption, causing the model to be overly sensitive to extreme values and reducing predictive accuracy. By applying a log transformation, you compress the long tail, making the distribution more symmetric and allowing the model to better capture a linear relationship between the feature and the target variable. On the AWS Certified Machine Learning Specialty MLS-C01 exam, this question tests your understanding of feature engineering for regression, specifically how skewed features can degrade model performance and that log transformation is a standard remedy. A common trap is to confuse log transformation with scaling methods like standardization or min-max normalization, which do not address skewness. Remember the memory tip: “When the tail is long, log makes it strong.”

⚠ Common exam trap

The MLS-C01 exam often tests the misconception that standard scaling (z-score) can fix skewness, when in reality it only normalizes the mean and variance without altering the shape of the distribution.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Apply a log transformation to the 'sqft_living' feature.

Linear regression assumes that features are approximately normally distributed, and a right-skewed distribution like 'sqft_living' can violate this assumption, leading to poor model performance. Applying a log transformation compresses the long tail, making the distribution more symmetric and helping the model learn a linear relationship between the feature and the target. This is a standard preprocessing step for skewed features in regression tasks.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Remove the 'sqft_living' feature because it violates the normality assumption.

    Why it's wrong here

    Dropping a potentially important feature is not the best first step.

  • Apply a log transformation to the 'sqft_living' feature.

    Why this is correct

    Log transformation reduces right skewness, making the distribution more symmetric.

  • One-hot encode the 'zipcode' feature to capture location effects.

    Why it's wrong here

    While useful, this does not address the identified skewness in 'sqft_living'.

  • Apply standard scaling (z-score) to the 'sqft_living' feature.

    Why it's wrong here

    Applying standard scaling to 'sqft_living' fails because it merely rescales the feature to a mean of 0 and standard deviation of 1, without transforming its inherent right-skewed distribution. Linear regression models benefit from more normally distributed features, as skewness can violate assumptions about residuals and affect coefficient stability. This option is tempting because standardisation is crucial for algorithms sensitive to feature magnitudes, such as gradient descent-based optimisers or distance-based models, where it prevents features with larger ranges from dominating the learning process.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on MLS-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A machine learning team is reviewing a dataset for a regression problem. They notice that the target variable has a right-skewed distribution. Which transformation should they consider applying to the target variable to improve model performance?

easy
  • A.Apply StandardScaler to the target variable.
  • B.Apply MinMaxScaler to the target variable.
  • C.Apply log transformation to the target variable.
  • D.Apply one-hot encoding to the target variable.

Why C: Log transformation is commonly applied to right-skewed data to make it more normally distributed, which can improve model performance. Option A (StandardScaler) is for scaling, not skewness. Option B (MinMaxScaler) also doesn't address skewness. Option D (One-hot encoding) is for categorical variables.

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.