What is Data Skew?

A payments team trains a fraud model on a year of card transactions. Only a small share of the records are fraud, and most transaction amounts are small while a few are very large. The first model scores well on accuracy and still lets most fraud through.

Data skew is an uneven distribution of values in a dataset, where some classes, categories or value ranges appear far more often than others, which can bias how a model is trained and evaluated.

The NIST/SEMATECH e-Handbook of Statistical Methods describes skewness as a measure of the lack of symmetry in a distribution in its section on skewness and kurtosis. A transaction amount column with a long right tail is a typical skewed numeric feature.

Google’s Machine Learning Crash Course covers the label side in its guide to class-imbalanced datasets: one label, the majority class, is much more frequent than another, the minority class. The guide notes that accuracy is usually a poor metric for a model trained on such data, because a model can be right most of the time by predicting the majority class.

How is data skew different from class imbalance?

  • Class imbalance is skew in the target label, where one outcome far outnumbers another. The class imbalance correction entry covers the methods teams use for it.
  • Data skew is the broader term. It also covers skewed input features, such as income or purchase amounts, and uneven category frequencies in any column.
  • In distributed data processing, data skew means some partitions hold far more records than others, which slows parallel jobs. That meaning concerns compute time, not model quality.

Where does data skew break in AI work?

Skew causes trouble when the cases a task cares about are the rare ones.

  • Misleading metrics: a model that always predicts the common class can post high accuracy while missing the cases the task exists to catch.
  • Thin coverage: the rare group has too few examples for the model to learn what it looks like, so errors concentrate there.
  • Unrepresentative evaluation: a random split can leave the evaluation set with almost no minority examples. Stratified sampling keeps group proportions in each split.
  • Over-correction: aggressive resampling can make a model flag far more cases than a team can review, or remove rare patterns that another task needs.

CUBIG Shorts

99.9% Accurate. Zero Frauds Caught.

From The Curious Dictionary of AI-Ready Data, CUBIG’s short series that explains one data term per episode.

▶  Watch on YouTubeSubscribe

How do teams check and handle data skew?

Teams start with data profiling: the distribution of the label and key features, by group and over time, compared with the situations the task has to handle. Common responses include log transforms for long-tailed numeric features, resampling methods such as SMOTE or upsampling, and class weights during training.

Whether skew should be corrected depends on the task. Fraud is rare in reality, so the evaluation set usually keeps the real proportion even when the training data is rebalanced. Teams record what they adjusted, keep the original dataset and compare results before and after under the same evaluation set, with metrics such as recall on the rare class rather than overall accuracy alone.

Related entries: data augmentation, golden dataset and AI-ready data.

Frequently asked questions

What causes data skew?

Common causes include rare events, uneven data collection across groups, sampling bias and business processes that produce some outcomes far more often than others.

How do teams measure data skew?

For numeric features, teams compute a skewness statistic or plot the distribution. For labels and categories, they compare class or category frequencies by group and over time.

Should data skew always be corrected?

No. Some skew reflects reality, such as fraud being rare. Any correction should be chosen for the specific task and checked against an evaluation set that reflects real-world conditions.