How does SMOTE-NC adapt SMOTE for categorical features?

Last updated 15 November 2026

  • SMOTE-NC (Nominal-Continuous) adds a penalty per mismatched categorical feature to the neighbor distance, equal to the median std of the minority class's continuous features.

  • Continuous features are interpolated as in SMOTE. Categorical features take the most frequent value among the k neighbors, avoiding invalid in-between categories.

  • It needs at least one continuous feature (use SMOTEN for all-categorical data). Pass raw categorical columns and encode after resampling.

  • https://www.geeksforgeeks.org/machine-learning/smote-for-imbalanced-classification-with-python/
  • https://medium.com/analytics-vidhya/smote-nc-in-ml-categorization-models-fo-imbalanced-datasets-8adbdcf08c25
  • https://github.com/scikit-learn-contrib/imbalanced-learn/blob/master/imblearn/over_sampling/_smote/base.py
All Imbalanced Datasets interview questions