Histogram results
Statistical summary
Bin frequency table
| Dataset | Bin | Lower | Upper | Midpoint | Width | Frequency | Relative | Percent | Cumulative | Cumulative % | Density |
|---|
Formula used
Frequency: fᵢ = number of observations in bin i Relative frequency: rᵢ = fᵢ / n Percentage frequency: pᵢ = 100 × fᵢ / n Frequency density: dᵢ = fᵢ / (n × bin width) Cumulative frequency: Fᵢ = Σ fⱼ for j ≤ i Freedman–Diaconis width: h = 2 × IQR × n⁻¹ᐟ³ Scott width: h = 3.5 × s × n⁻¹ᐟ³
How to use the Histogram Calculator
- Paste numerical observations or upload a CSV or TXT file.
- Add datasets when comparing training, testing, actual, or predicted distributions.
- Select an automatic rule, manual count, width, or custom boundaries.
- Choose frequency, density, transformations, outlier handling, and overlays.
- Customize the chart, then calculate, inspect bins, and export results.
Example data
| Dataset | Example values | Suggested use |
|---|---|---|
| Training feature | 12, 14, 15, 18, 21, 25, 32, 38 | Inspect feature shape and outliers. |
| Testing feature | 10, 13, 16, 19, 24, 30, 36, 44 | Compare distribution shift. |
| Prediction errors | -4, -2, -1, 0, 0, 1, 2, 6 | Check bias, tails, and spread. |
Frequently asked questions
What does a histogram show?
It groups numerical observations into adjacent intervals. Bar heights describe frequency, percentage, or density.
How is a histogram different from a bar chart?
Histogram bins represent continuous numerical intervals. Bar charts usually compare separate categories with visible gaps.
Which bin rule should I choose?
Freedman–Diaconis is robust for many datasets. Sturges works well for smaller, near-normal samples.
Why do different bin counts change the shape?
Wide bins hide local structure. Narrow bins may exaggerate random noise and small fluctuations.
What is frequency density?
Frequency density divides relative frequency by bin width. It is appropriate when custom intervals have unequal widths.
Can I compare training and testing data?
Yes. Add both datasets, use shared bins, and review mean, spread, KS statistic, and PSI.
What does a right-skewed histogram indicate?
Most values are concentrated lower down. A smaller number of high observations create a longer right tail.
Should outliers be removed automatically?
No. Review their source and meaning first. Removal may discard legitimate rare observations important to machine learning.
What does the KDE curve show?
It estimates a smooth probability density. Bandwidth controls whether the curve appears smoother or more detailed.
How can histograms reveal class imbalance?
Use separate datasets for classes or filtered subsets. Compare their counts, shapes, ranges, and concentrated bins.
Can I export the analysis?
Yes. Download PNG, SVG, CSV, print to PDF, or copy the statistical results.