|
1 | | -.. khisto-python documentation master file, created by |
2 | | - sphinx-quickstart on Fri Mar 6 17:40:33 2026. |
3 | | - You can adapt this file completely to your liking, but it should at least |
4 | | - contain the root `toctree` directive. |
| 1 | +.. khisto-python documentation master file |
5 | 2 |
|
6 | | -khisto-python documentation |
7 | | -=========================== |
| 3 | +=========================================== |
| 4 | +Khisto — Histograms that fit your data |
| 5 | +=========================================== |
8 | 6 |
|
9 | | -Khisto helps you build histograms that look right on the first try. |
| 7 | +.. rst-class:: hero-tagline |
10 | 8 |
|
11 | | -It replaces fixed-width bin guesses with adaptive bins computed by the Khiops |
12 | | -algorithm, so dense regions stay detailed and sparse regions stay readable. |
| 9 | + Drop-in replacements for ``numpy.histogram`` and ``plt.hist`` with |
| 10 | + adaptive, variable-width bins powered by the Khisto algorithm. |
| 11 | + Dense regions get fine bins, sparse regions get wide ones — no tuning needed. |
13 | 12 |
|
14 | | -Pick the entry point that matches your workflow: |
| 13 | +.. grid:: 2 |
| 14 | + :gutter: 3 |
15 | 15 |
|
16 | | -- :doc:`demo` for a runnable tour. |
17 | | -- :doc:`array/histogram/index` for a NumPy-like API with better bins. |
18 | | -- :doc:`matplotlib/index` for plots that stay familiar but look sharper. |
19 | | -- :doc:`core/index` for full access to the histogram series. |
20 | | -- :doc:`api_comparison` for a quick comparison with NumPy and matplotlib. |
| 16 | + .. grid-item-card:: Standard Gaussian |
| 17 | + :img-top: images/gaussian-quick-start.png |
| 18 | + |
| 19 | + Bins concentrate around the interesting areas — exactly |
| 20 | + matching the density of a normal distribution. |
| 21 | + |
| 22 | + .. grid-item-card:: Heavy-tailed Pareto |
| 23 | + :img-top: images/pareto-quick-start.png |
| 24 | + |
| 25 | + Log-log axes reveal how adaptive bins track a power-law decay |
| 26 | + over four orders of magnitude. |
| 27 | + |
| 28 | +Get started |
| 29 | +----------- |
| 30 | + |
| 31 | +.. div:: install-cmd |
| 32 | + |
| 33 | + .. code-block:: bash |
| 34 | +
|
| 35 | + pip install khisto # core (NumPy only) |
| 36 | + pip install "khisto[matplotlib]" # + plotting |
| 37 | +
|
| 38 | +.. code-block:: python |
| 39 | +
|
| 40 | + import numpy as np |
| 41 | + from khisto import histogram |
| 42 | +
|
| 43 | + data = np.random.normal(0, 1, 10_000) |
| 44 | + hist, bin_edges = histogram(data) # optimal bins, no guessing |
| 45 | +
|
| 46 | +.. grid:: 1 1 3 3 |
| 47 | + :gutter: 3 |
| 48 | + :class-container: sd-mt-3 |
| 49 | + |
| 50 | + .. grid-item-card:: :octicon:`package;1.5em` NumPy-like API |
| 51 | + :link: array/histogram/index |
| 52 | + :link-type: doc |
| 53 | + |
| 54 | + ``histogram(data)`` returns ``(hist, bin_edges)`` — same shape as |
| 55 | + ``numpy.histogram``, better bins. |
| 56 | + |
| 57 | + .. grid-item-card:: :octicon:`graph;1.5em` Matplotlib integration |
| 58 | + :link: matplotlib/index |
| 59 | + :link-type: doc |
| 60 | + |
| 61 | + ``khisto.matplotlib.hist`` plots like ``plt.hist`` with density, |
| 62 | + cumulative, step, and log-scale support. |
| 63 | + |
| 64 | + .. grid-item-card:: :octicon:`telescope;1.5em` Core engine |
| 65 | + :link: core/index |
| 66 | + :link-type: doc |
| 67 | + |
| 68 | + ``compute_histograms`` exposes every granularity level so you can |
| 69 | + pick the resolution that suits your analysis. |
| 70 | + |
| 71 | +.. grid:: 1 1 2 2 |
| 72 | + :gutter: 3 |
| 73 | + :class-container: sd-mt-1 |
| 74 | + |
| 75 | + .. grid-item-card:: :octicon:`git-compare;1.5em` API comparison |
| 76 | + :link: api_comparison |
| 77 | + :link-type: doc |
| 78 | + |
| 79 | + Side-by-side parameter tables for NumPy, Matplotlib, and Khisto. |
| 80 | + |
| 81 | + .. grid-item-card:: :octicon:`play;1.5em` Interactive demo |
| 82 | + :link: demo |
| 83 | + :link-type: doc |
| 84 | + |
| 85 | + A runnable notebook tour covering all features. |
21 | 86 |
|
22 | 87 | .. toctree:: |
23 | 88 | :maxdepth: 2 |
|
0 commit comments