CareerByteCode

Class Imbalance Ratio Calculator

For data scientists checking a classification dataset before training. You get the number of classes, total samples, the largest to smallest imbalance ratio, the majority baseline accuracy and each class share.

FreeRuns in your browserNothing uploadedNo sign-up neededAll 10 tools in the ML Toolbox
Keep this resultSign in to email it to yourself or save it to your profile. The tool itself never needs an account.

ByteLabs

Close the gaps with real-world projects

Build industry projects on ByteLabs and add verified proof of your skills to your public profile.

Explore ByteLabs
How to use

How to use the Class Balance

  1. Enter class counts as label: count, one per line, or just the counts.
  2. Click Analyze balance.
  3. Read the imbalance ratio and majority baseline accuracy.
  4. Check each class share in the table below.
Worked example

An example, step by step

You enter

cat: 900, dog: 90, bird: 10

The tool shows

3 classes, total 1,000, imbalance ratio 90 : 1, majority baseline 90%; shares 90%, 9%, 1%

FAQ

Questions about the Class Balance

What is the majority class baseline?

It is the accuracy you get by always predicting the largest class. Here 900 of 1,000 samples gives 90 percent, so a model must beat that to add value.

What imbalance ratio counts as severely imbalanced?

There is no fixed cutoff, but ratios beyond about 10 to 1 usually need attention, and 100 to 1 or more calls for metrics like F1 or PR-AUC instead of accuracy.

How do I handle class imbalance?

Common options are class weights in the loss, resampling (oversampling the minority or undersampling the majority), synthetic samples such as SMOTE, and threshold tuning.

Is the Class Balance free and private?

Yes. It is free, needs no sign-up and runs entirely in your browser, so what you type is not uploaded. You only sign in if you want to email a result to yourself or save it to your CareerByteCode profile.

Copied