Class Distribution Chart Calculator

Explore class balance, compare dataset splits, measure imbalance, simulate resampling, calculate weights, and create clear charts for better machine learning decisions instantly online today.

Calculated Results

Results update after you calculate or change valid settings.

Not calculated
Add class data, then select Calculate distribution.
Total samples0
Number of classes0
Majority class
Minority class
Imbalance ratio
Normalized entropy
Gini impurity
Majority baseline
Class Count Weighted count Percentage Cumulative Rank Balanced weight Status

Interpretation

No interpretation is available yet.

Recommendations

  • Calculate the distribution to receive recommendations.

Result Summary

No calculated summary yet.

Dataset and Class Input

Headers may include class, count, train, validation, test, predicted, weight.
Class name Overall count Train Validation Test Predicted Sample weight Color Remove

Distribution, Sorting, and Filtering

Use zero to display every class.
%
%

Chart Options

Split Analysis and Drift Detection

points
No split analysis yet.

Resampling Simulator

Class Original Target Added Removed New percentage

Class-Weight Calculator

Class Count Raw weight Normalized weight

Formula Used

Class percentage: pᵢ = nᵢ ÷ N × 100.

Imbalance ratio: IR = max(nᵢ) ÷ min(nᵢ).

Entropy: H = −Σ pᵢ ln(pᵢ).

Normalized entropy: H ÷ ln(K).

Gini impurity: 1 − Σ pᵢ².

Balanced weight: wᵢ = N ÷ (K × nᵢ).

Here, N is total samples. K is total classes. The value nᵢ is one class count.

How to Use

  1. Add class names and counts.
  2. Enter split or prediction counts when available.
  3. Select sorting, filters, and chart options.
  4. Choose resampling and class-weight methods.
  5. Select Calculate distribution.
  6. Review imbalance, drift, and rare-class warnings.
  7. Export the chart or calculated report.

Example Data Table

Class Overall Train Validation Test Predicted
Cat5203608080490
Dog4102856560430
Bird1451002025155
Horse7550101575

Frequently Asked Questions

What is a class distribution?

It shows samples assigned to each target class. It reveals whether categories have similar representation. Large differences may influence model learning.

Why does class imbalance matter?

Models may favor large classes during training. Accuracy can appear strong despite weak minority recall. Balanced metrics give a clearer evaluation.

What is a majority-class baseline?

It predicts the largest class every time. This provides a simple accuracy benchmark. Better models should exceed this baseline meaningfully.

What imbalance ratio is acceptable?

No single threshold fits every problem. Costs and sample sizes also matter. Review recall and precision for each class.

Should I always oversample minorities?

No method works for every dataset. Oversampling may copy noise or outliers. Validate choices using unseen data.

When should class weights be used?

Weights help many loss-based classification models. They increase minority errors during optimization. Compare weighted and unweighted validation results.

What does normalized entropy show?

It measures how evenly classes are distributed. Values near one indicate stronger balance. Values near zero indicate concentration.

How is split drift detected?

The calculator compares class percentages across splits. Large percentage-point differences trigger warnings. Missing classes receive separate warnings.

Can this replace model evaluation?

No, distribution analysis is only diagnostic. Use confusion matrices and per-class metrics. Evaluate performance on representative unseen data.

Related Calculators

Confusion Matrix HeatmapPrecision-Recall CurveCumulative Gain ChartLift ChartCalibration CurveDecision Boundary PlotProbability Distribution PlotThreshold Performance PlotMulticlass ROC CurveError Analysis Bar Chart

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.