Notes

Skewness

Skewness is what you notice when a dataset doesn’t “lean” evenly around its typical value. Two groups can have the same average and spread, yet one has a long tail of unusually high (or low) values—and that asymmetry is exactly what skewness captures.

What skewness means
Skewness measures the asymmetry of a distribution. If values are balanced on both sides of the center, skewness is near zero. When one side has a longer tail, skewness moves away from zero.

  • Positive (right) skew: a long tail to the right. Most values are smaller, but a few very large ones pull the tail out.
  • Negative (left) skew: a long tail to the left. Most values are larger, but a few very small ones create the tail.

Everyday examples
Skewness shows up constantly in real data:

  • House prices: typically right-skewed because a few luxury homes cost far more than the rest.
  • Income: strongly right-skewed in many populations due to a small number of very high earners.
  • Exam scores: can be left-skewed if an exam is easy and many students score near the top.

Why it matters in AI/ML
Skewness affects modeling choices and evaluation:

  • Loss sensitivity: right-skewed targets (like prices) can make models chase rare extremes; transforms like log often stabilize learning.
  • Feature scaling and outliers: skewed features can produce influential outliers; robust scalers or winsorization may help.
  • Assumptions: methods that rely on roughly symmetric errors (common in linear regression diagnostics) can mislead when residuals are skewed.

Where you’ll see it
Libraries like pandas and SciPy compute it directly (e.g., DataFrame.skew() or scipy.stats.skew), often alongside histograms and box plots to diagnose distribution shape.

Skewness measures the asymmetry of a distribution around its mean. Positive skewness indicates a longer right tail (a few unusually large values), while negative skewness indicates a longer left tail. In AI/ML, skewness helps diagnose non-normal features, outliers, and whether transformations (e.g., log) may improve model fit and stability. Example: income data are often right-skewed, motivating log-scaling before linear regression.

Imagine a group of people’s incomes in a town. Most people earn around the same amount, but a few people earn extremely high salaries. The “shape” of that income list isn’t balanced—it has a long tail on the high end. That lopsidedness is called skewness.

Skewness describes whether a set of numbers leans more to the left or the right. If the long tail is on the right (a few very large values), it’s “right-skewed.” If the long tail is on the left (a few very small values), it’s “left-skewed.” In AI/ML, skewness matters because extreme values can affect averages and model training.