كتب الذكاء الاصطناعيمشاريع الذكاء الاصطناعيمقالات الذكاء الاصطناعيمعجم الذكاء الاصطناعياسئلة واجوبة في الذكاء الاصطناعيأكاديمية الذكاء الاصطناعي للأطفالأكاديمية الذكاء الاصطناعيمدرسة رياضيات الذكاء الاصطناعيمختبر الذكاء الاصطناعيمختبر الخوارزميات المستوحاة من الطبيعةأطلس نماذج الذكاء الاصطناعيموسوعة تطبيقات الذكاء الاصطناعيمستكشف مجموعات البيانات للذكاء الاصطناعياختبارات الذكاء الاصطناعيالفايب كودينغدليل البرمجة بالذكاء الاصطناعيمولّد مشاريع الذكاء الاصطناعيمرصد الذكاء الاصطناعيدليل أدوات الذكاء الاصطناعي البحث والنشر الأكاديميمكتبة البرومبتات الأكاديميةمستودع الرسائل والأطاريح في الذكاء الاصطناعيحاسبة الترقية العلميةأكاديمية الوكلاء الذكيينمختبر أخلاقيات الذكاء الاصطناعي والعدالةساحة ألعاب الذكاء الاصطناعيمختبر التنبؤ بالسلاسل الزمنيةمتحف الذكاء الاصطناعيمختبر الرؤية الحاسوبيةمختبر الشبكات العصبية البيانيةمختبر معالجة اللغة الطبيعيةمختبر الحوسبة الكمّيةخرائط طريق الذكاء الاصطناعي

Data Balance Lab

Balanced vs imbalanced data, ROS, RUS and SMOTE, the right metrics, leakage when SMOTE comes before the split, and class balance vs group fairness.

العربية

Module experiments (5)

Concepts and formulas

Classification metrics formula

Accuracy, precision, recall, F1 and balanced accuracy.

\mathrm{Acc}=\frac{TP+TN}{n},\;\mathrm{P}=\frac{TP}{TP+FP},\;\mathrm{R}=\frac{TP}{TP+FN},\;F_1=\frac{2PR}{P+R},\;\mathrm{BA}=\frac{\mathrm{TPR}+\mathrm{TNR}}{2}

Try it in: Balanced vs imbalanced data

SMOTE synthesis formula

x_nn is one of x_i's k nearest same-class neighbours.

x_{\text{new}}=x_i+\lambda\,(x_{nn}-x_i),\quad \lambda\sim U(0,1)

Try it in: ROS, RUS and SMOTE before and after

Class imbalance (عدم توازن الفئات)

When one target class is rare, a model can reach high accuracy by predicting the majority class. Use recall, F1, balanced accuracy and the confusion matrix.

Try it in: Balanced vs imbalanced data

SMOTE (SMOTE)

Creates synthetic minority examples by interpolating between an example and one of its k nearest same-class neighbours (Chawla et al., 2002). Apply it to training data only, after the split and inside each CV fold; applying it before the split leaks test information.

Try it in: ROS, RUS and SMOTE before and after

Random over/under-sampling (زيادة العينات وتقليلها عشوائياً)

ROS duplicates minority examples; RUS removes majority examples. ROS can overfit; RUS loses information.

Try it in: ROS, RUS and SMOTE before and after

Data leakage (تسرب البيانات)

Using test information during training or preprocessing, making results look better than they are, e.g. SMOTE, scaling or feature selection before the split.

Try it in: Leakage: SMOTE before the split

Confusion matrix and classification metrics

Four cells: TP, FP, TN, FN; accuracy, precision, recall, F1, specificity and balanced accuracy derive from it. Computing them per group is the basis of fairness measurement.

Try it in: Balanced vs imbalanced data

Questions and guides

Does SMOTE fix bias against groups?

Not necessarily. SMOTE addresses a rare target class; group bias is a different problem needing per-group error measurement and specific mitigation. Apply SMOTE to training data only, after the split.

Try it in: Class balance is not group fairness

Module sources

  1. imbalanced-learn — SMOTEimbalanced-learn developers (2025) — Tool
  2. SMOTE: Synthetic Minority Over-sampling Technique (arXiv:1106.1813)N. V. Chawla, K. W. Bowyer, L. O. Hall, W. P. Kegelmeyer (2002) — Paper
  3. Data preprocessing techniques for classification without discrimination. Knowledge and Information Systems 33. DOI 10.1007/s10115-011-0463-8F. Kamiran, T. Calders (2012) — Paper — print reference; no verified open link