[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-class-imbalance::en":3,"gloss-cluster-class-imbalance::en":26,"gloss-next-class-imbalance::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"class-imbalance","mlops","Class Imbalance","Class imbalance is the situation where the outcome you care about is rare in the data: fraudulent transactions, churning accounts, defective parts, security incidents. It is the normal case rather than an exception, and it breaks the default assumptions of both training and evaluation. In training, a loss function that weights every example equally is dominated by the majority class, so the cheapest way for a model to reduce error is to predict the majority almost always. In evaluation, accuracy stops carrying information for the same reason. The usual responses fall into three groups. Change the data: resample the majority down, oversample the minority, or generate synthetic minority examples — always after splitting, never before, or the same example appears in training and test. Change the objective: weight the minority class more heavily in the loss, which avoids duplicating rows and is usually the simpler starting point. Or change the decision: keep the model's scores and choose an operating threshold that reflects the real cost of a miss versus a false alarm, which is often the only change actually needed. Two cautions. Resampling distorts the predicted probabilities, so a model trained on a rebalanced set will overstate the minority rate unless it is recalibrated. And with a rare class, the test set contains few positive examples, so the metric you report is itself noisy — a difference of a few percentage points may be a handful of rows changing side.","Class imbalance makes accuracy meaningless and biases training toward the majority — resampling, class weights and thresholds compared, with their pitfalls.",null,[11,14,17,20,23],{"slug":12,"name":13},"cross-validation","Cross-Validation",{"slug":15,"name":16},"data-augmentation","Data Augmentation",{"slug":18,"name":19},"precision-and-recall","Precision and Recall",{"slug":21,"name":22},"synthetic-data","Synthetic Data",{"slug":24,"name":25},"train-test-split","Train\u002FTest Split",[27,31,35,38,41,45,48,49,52,55,58,61],{"slug":28,"category":5,"name":29,"updated_at":30},"annotation-guidelines","Annotation Guidelines","2026-08-24T03:30:02+00:00",{"slug":32,"category":5,"name":33,"updated_at":34},"baseline-model","Baseline Model","2026-08-24T02:46:38+00:00",{"slug":36,"category":5,"name":37,"updated_at":34},"batch-inference","Batch Inference",{"slug":39,"category":5,"name":40,"updated_at":34},"canary-prompt","Canary Prompt",{"slug":42,"category":5,"name":43,"updated_at":44},"champion-challenger","Champion-Challenger (A\u002FB Model Testing)","2026-08-24T02:46:37+00:00",{"slug":46,"category":5,"name":47,"updated_at":34},"continuous-batching","Continuous Batching",{"slug":12,"category":5,"name":13,"updated_at":34},{"slug":50,"category":5,"name":51,"updated_at":34},"data-labeling","Data Labeling",{"slug":53,"category":5,"name":54,"updated_at":44},"drift-detection","Drift Detection",{"slug":56,"category":5,"name":57,"updated_at":44},"eval-harness","Eval Harness",{"slug":59,"category":5,"name":60,"updated_at":44},"experiment-tracking","Experiment Tracking",{"slug":62,"category":5,"name":63,"updated_at":34},"explainability","Explainability"]