Datasets:
|
Download README.md from judicialmind/MandiBench: direct link, hf CLI and curl.
- Browser
- Download file 16.3 kB
-
https://huggingface.co/datasets/judicialmind/MandiBench/resolve/main/README.md
- Command line
-
hf download hf://datasets/judicialmind/MandiBench/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/datasets/judicialmind/MandiBench/resolve/main/README.md
16.3 kB
| license: cc-by-nc-sa-4.0 | |
| pretty_name: MandiBench | |
| language: | |
| - en | |
| task_categories: | |
| - time-series-forecasting | |
| tags: | |
| - agriculture | |
| - india | |
| - mandi | |
| - agmarknet | |
| - prices | |
| - forecasting | |
| - benchmark | |
| size_categories: | |
| - 10M<n<100M | |
| configs: | |
| - config_name: series | |
| data_files: series/all.parquet | |
| - config_name: catalog | |
| data_files: series/catalog.parquet | |
| extra_gated_prompt: 'This dataset is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 licence (CC BY-NC-SA 4.0): research, academic, personal and other non-commercial use is permitted with attribution; adaptations must be shared under the same licence; commercial use is not permitted. The original public source data remains under the Government Open Data License - India (GODL-India). Commercial use: contact surya@judicialmind.ai or hello@judicialmind.ai.' | |
| extra_gated_fields: | |
| Name: text | |
| Email: text | |
| Organization: text | |
| I accept the CC BY-NC-SA licence terms (research and non-commercial use only): checkbox | |
| extra_gated_button_content: Accept and request access | |
| # MandiBench | |
| <!-- jm:top --> | |
| Licence: CC BY-NC-SA 4.0 — research and non-commercial use only; derivatives must be shared under the same licence. Commercial use: contact surya@judicialmind.ai or hello@judicialmind.ai | |
| Access is approved automatically when the email you enter matches your Hugging Face account email and belongs to the organisation you name; other requests are reviewed manually. | |
| <!-- /jm:top --> | |
| MandiBench is a probabilistic forecasting benchmark for daily wholesale (mandi) prices in India. Each of its 12,863 | |
| series is the daily modal price of one commodity variety in one Agmarknet market (Rs per quintal), with history | |
| from 2001 to May 2026. Forecasters predict the next 7, 14 and 30 days from 11 monthly origins (2025-06-01 to | |
| 2026-04-01), as nine quantiles (q0.1 ... q0.9). Nine state/UT groups are held out entirely, to test transfer to | |
| markets a trained model has never seen. The repository ships the series, the forecasts of nine models, the | |
| leaderboard and `evaluate.py`, which recomputes the leaderboard from the shipped forecasts and scores new models. | |
| **Headline result:** our Chronos-2 fine-tunes top the leaderboard at every horizon, on all series and in the held-out | |
| states: the group-context fine-tune reaches WQL 0.0930 at 30 days (0.0796 held-out) and the released | |
| [Mandi-Chronos](https://huggingface.co/judicialmind/Mandi-Chronos) 0.0990 (0.0847), against 0.1012 for TimesFM-2.5 | |
| and 0.1025 for zero-shot Chronos-2. | |
| ## Quickstart | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| root = snapshot_download("judicialmind/MandiBench", repo_type="dataset") | |
| import pandas as pd | |
| series = pd.read_parquet(f"{root}/series/all.parquet") | |
| print(series.shape) | |
| print(series[["series_id", "ts", "target", "cclass"]].head(3).to_string()) | |
| ``` | |
| Output: `(27437227, 14)` (27,437,227 rows, 14 columns), then: | |
| **First three rows of `series/all.parquet`** | |
| | series id | date | target | commodity class | | |
| |---|---|---:|---| | |
| | mandi\|Andhra Pradesh\|Anantapur\|Anantapur\|Mousambi(Sweet Lime)\|Mousambi | 2014-05-27 | 1,600 | fruit | | |
| | mandi\|Andhra Pradesh\|Anantapur\|Anantapur\|Mousambi(Sweet Lime)\|Mousambi | 2014-06-07 | 1,570 | fruit | | |
| | mandi\|Andhra Pradesh\|Anantapur\|Anantapur\|Mousambi(Sweet Lime)\|Mousambi | 2014-06-20 | 1,400 | fruit | | |
| Other loaders: `datasets.load_dataset("judicialmind/MandiBench", "series", split="train")`, or DuckDB | |
| (`SELECT commodity, avg(target) FROM 'series/all.parquet' GROUP BY 1`). | |
| ### Evaluate a model | |
| `evaluate.py` (numpy, pandas, pyarrow; `pip install -r requirements.txt`) exposes the benchmark windows and their | |
| contexts as arrays. Row `i` of every array is window `bench.windows.iloc[i]` (`series_id, origin, state, cclass, | |
| heldout`). Input: `bench.context` (windows x 512) holds the daily prices of the 512 days before the origin (NaN = no | |
| trade that day). Output: an array of shape (windows, 30, 9), the forecast for days origin ... origin + 29 at the nine | |
| quantile levels in `QUANTILES`. | |
| ```python | |
| import sys | |
| import numpy as np | |
| from statistics import NormalDist | |
| sys.path.insert(0, root) | |
| from evaluate import QUANTILES, Benchmark | |
| bench = Benchmark(root) | |
| print(len(bench.windows), "windows") | |
| # toy forecaster: last observed price, normal spread of 5% x sqrt(h) | |
| z = np.array([NormalDist().inv_cdf(q) for q in QUANTILES]) | |
| h = np.arange(1, 31)[:, None] | |
| Q = bench.last[:, None, None] * (1 + 0.05 * np.sqrt(h) * z) # (windows, 30 days, 9 quantiles) | |
| res = bench.score(Q, "last_value") | |
| print(res[res["slice"].isin(["all", "heldout"])][["h", "slice", "wql", "mase", "cov_80"]].round(4).to_string(index=False)) | |
| ``` | |
| Output: `96648 windows` (96,648 benchmark windows), then: | |
| **Toy forecaster `last_value`, by horizon and slice** | |
| | horizon (days) | slice | WQL | MASE | 80% coverage | | |
| |---:|---|---:|---:|---:| | |
| | 7 | all | 0.0791 | 1.1059 | 0.7254 | | |
| | 7 | heldout | 0.0649 | 1.0358 | 0.7948 | | |
| | 14 | all | 0.0936 | 1.4293 | 0.7511 | | |
| | 14 | heldout | 0.0787 | 1.2900 | 0.8131 | | |
| | 30 | all | 0.1204 | 1.8335 | 0.7807 | | |
| | 30 | heldout | 0.1036 | 1.6976 | 0.8343 | | |
| From the command line (run inside the downloaded folder): | |
| ```bash | |
| python evaluate.py # recompute the leaderboard from forecasts/ -> "REPRODUCED" | |
| python evaluate.py --write-windows windows.csv # the 96,648 (series_id, origin) windows to forecast | |
| python evaluate.py --submission my_forecasts.parquet --name my_model --out my_model.csv | |
| ``` | |
| A submission file (or a folder of parquet/csv files) has one row per window and day: `series_id, origin, h, q0.1, | |
| q0.2, ..., q0.9`, with `origin` the first forecast day (ISO date) and `h` = 1 ... 30 (day `origin + h - 1`). Use only | |
| observations dated before `origin`. The output adds `win_rate`, the share of windows where the model's MASE beats | |
| `chronos2`. To appear on the [MandiBench-Leaderboard](https://huggingface.co/spaces/judicialmind/MandiBench-Leaderboard), | |
| open a discussion on this repository with the `--out` csv and a short model description. | |
| ## Tasks and metrics | |
| - **Origins:** the first day of each month from 2025-06-01 to 2026-04-01 (11). The context is every observation | |
| before the origin; a model may use the full history (the shipped models read at most the last 512 days). | |
| - **Horizons:** 7, 14 and 30 days. One call per (series, origin) forecasts 30 days; a horizon-h task scores days | |
| 1 ... h. Only days with an observed price count. | |
| - **Held-out states:** Chandigarh, Himachal Pradesh, Madhya Pradesh, Manipur, Meghalaya, Odisha, Rajasthan, | |
| Tamil Nadu, West Bengal (`splits.json`). The trained models (LightGBM and the fine-tuned Chronos-2 variants) used | |
| only data before 2025-06-01 from the other states. Slices: `all`, `heldout`, `indist`, and one per commodity class | |
| (`cclass=cereal`, ...). | |
| - **Metrics** (computed per origin x horizon, then averaged over origins): | |
| - `wql`: weighted quantile loss, the mean over the 9 quantiles of 2 x summed pinball loss / summed |y|, pooled | |
| over the windows of the task. Lower is better. | |
| - `mase`: mean absolute error of q0.5 divided by the mean absolute 7-day change of the 512-day context (lag 1 | |
| when no 7-day pair is observed), averaged over windows. Lower is better. | |
| - `cov_80`: share of observed days inside [q0.1, q0.9]; 0.80 is ideal. | |
| - `dir_acc_7d`: share of windows where q0.5 moves in the same direction as the price from the last observed | |
| value, at the last observed day within the first week (windows with no change are skipped). | |
| - `n_windows`: windows with a defined MASE. | |
| The leaderboard scores the 96,648 (series, origin) windows that all nine models forecast. | |
| ## Results | |
| Leaderboard, sorted by WQL at 30 days (`leaderboard.parquet`; per-class slices and `win_rate` vs `chronos2` are in | |
| `leaderboard.json`). | |
| **All series** (windows: 88,899 at h=7, 92,776 at h=14, 96,341 at h=30) | |
| | model | WQL h7 | WQL h14 | WQL h30 | MASE h7 | MASE h14 | MASE h30 | cov_80 h30 | dir_acc_7d | | |
| |---|---|---|---|---|---|---|---|---| | |
| | chronos2_ft_b | 0.0633 | 0.0736 | 0.0930 | 1.0660 | 1.3494 | 1.6990 | 0.7289 | 0.6729 | | |
| | chronos2_ft_c | 0.0656 | 0.0765 | 0.0969 | 1.1077 | 1.4087 | 1.7858 | 0.7678 | 0.6370 | | |
| | chronos2_ft_a ([Mandi-Chronos](https://huggingface.co/judicialmind/Mandi-Chronos)) | 0.0665 | 0.0778 | 0.0990 | 1.1126 | 1.4177 | 1.8018 | 0.7215 | 0.6271 | | |
| | timesfm25 | 0.0672 | 0.0793 | 0.1012 | 1.0833 | 1.4031 | 1.8046 | 0.7410 | 0.6109 | | |
| | chronos2 | 0.0677 | 0.0799 | 0.1025 | 1.1487 | 1.4675 | 1.8759 | 0.7490 | 0.6156 | | |
| | tirex | 0.0709 | 0.0827 | 0.1038 | 1.2017 | 1.5219 | 1.9185 | 0.7605 | 0.6204 | | |
| | lightgbm | 0.0700 | 0.0831 | 0.1087 | 1.2280 | 1.6134 | 2.1358 | 0.7704 | 0.6025 | | |
| | ets_lite | 0.0708 | 0.0862 | 0.1153 | 1.0865 | 1.4099 | 1.8143 | 0.8532 | 0.6109 | | |
| | seasonal_naive | 0.0845 | 0.0957 | 0.1193 | 1.2682 | 1.5662 | 1.9484 | 0.8003 | 0.1037 | | |
| **Held-out states** (windows: 13,176 at h=7, 13,875 at h=14, 14,479 at h=30) | |
| | model | WQL h7 | WQL h14 | WQL h30 | MASE h7 | MASE h14 | MASE h30 | cov_80 h30 | dir_acc_7d | | |
| |---|---|---|---|---|---|---|---|---| | |
| | chronos2_ft_b | 0.0511 | 0.0609 | 0.0796 | 1.0379 | 1.2741 | 1.6773 | 0.7126 | 0.6531 | | |
| | chronos2_ft_c | 0.0523 | 0.0626 | 0.0819 | 1.0734 | 1.3154 | 1.7252 | 0.7608 | 0.6264 | | |
| | chronos2_ft_a ([Mandi-Chronos](https://huggingface.co/judicialmind/Mandi-Chronos)) | 0.0532 | 0.0641 | 0.0847 | 1.0734 | 1.3243 | 1.7485 | 0.7221 | 0.6150 | | |
| | chronos2 | 0.0541 | 0.0652 | 0.0858 | 1.1387 | 1.3944 | 1.8477 | 0.7466 | 0.6008 | | |
| | tirex | 0.0559 | 0.0665 | 0.0863 | 1.1729 | 1.4408 | 1.8897 | 0.7618 | 0.6137 | | |
| | timesfm25 | 0.0541 | 0.0653 | 0.0869 | 1.0336 | 1.2881 | 1.7270 | 0.7269 | 0.5955 | | |
| | lightgbm | 0.0551 | 0.0666 | 0.0894 | 1.0864 | 1.3739 | 1.9001 | 0.7963 | 0.6002 | | |
| | ets_lite | 0.0569 | 0.0703 | 0.0947 | 1.0352 | 1.2910 | 1.7046 | 0.8391 | 0.6014 | | |
| | seasonal_naive | 0.0682 | 0.0783 | 0.0990 | 1.1941 | 1.4292 | 1.8256 | 0.7936 | 0.1106 | | |
| Models: | |
| | model | description | | |
| |---|---| | |
| | `seasonal_naive` | price on the same weekday of the last week; spread from past 7-day changes (its median often equals the last price, which scores as a wrong direction in `dir_acc_7d`) | | |
| | `ets_lite` | damped additive-trend exponential smoothing per series; spread from one-step residuals | | |
| | `lightgbm` | global LightGBM quantile regression on scaled lags, rolling statistics and calendar features | | |
| | `chronos2` | `amazon/chronos-2`, zero-shot | | |
| | `timesfm25` | `google/timesfm-2.5-200m-pytorch`, zero-shot | | |
| | `tirex` | `NX-AI/TiRex`, zero-shot | | |
| | `chronos2_ft_a` | Chronos-2 fine-tuned on MandiBench series, univariate: released as [Mandi-Chronos](https://huggingface.co/judicialmind/Mandi-Chronos) | | |
| | `chronos2_ft_b` | Chronos-2 fine-tuned and run with group context: the series of one state and commodity are forecast jointly | | |
| | `chronos2_ft_c` | Chronos-2 fine-tuned with daily soil-moisture and reservoir-storage covariates (NRSC and CWC data from data.gov.in, not included here) | | |
| ## Files | |
| | file | content | | |
| |---|---| | |
| | `series/all.parquet` | the benchmark series, one row per series and trading day (27,437,227 rows) | | |
| | `series/catalog.parquet` | all 178,352 candidate market x commodity x variety series with coverage counts; `kept` marks the 12,863 benchmark series | | |
| | `splits.json` | origins, horizons, held-out states, season length (7) | | |
| | `tasks.json` | the 33 origin x horizon tasks in fev-style task format (id/timestamp/target columns, horizon, quantile levels) | | |
| | `forecasts/<model>/<origin>.parquet` | the forecasts of the nine models, one file per origin | | |
| | `leaderboard.parquet`, `leaderboard.json` | the leaderboard (324 rows: model x horizon x slice); the json adds `win_rate` | | |
| | `evaluate.py`, `requirements.txt` | evaluation harness | | |
| ## Schema | |
| `series/all.parquet` | |
| | column | type | description | | |
| |---|---|---| | |
| | `series_id` | string | `mandi|state|district|market|commodity|variety` | | |
| | `ts` | date | trading day | | |
| | `target` | float64 | modal price, Rs per quintal (median over the grades reported that day) | | |
| | `state`, `district`, `market` | string | Agmarknet market location | | |
| | `commodity`, `variety` | string | Agmarknet commodity and variety names | | |
| | `cclass` | string | commodity class: cereal, pulse, oilseed, vegetable, fruit, spice, sugar, dairy_meat_fish, top (tomato, onion, potato) | | |
| | `grade` | string | always `NA` (grades are merged) | | |
| | `district_lgd` | int32 | empty in this release | | |
| | `cov_min_price`, `cov_max_price` | float64 | minimum and maximum price that day (median over grades), Rs per quintal | | |
| | `n_grades` | int64 | number of grade rows merged into the day | | |
| `series/catalog.parquet`: `state, district, market, commodity, variety, cclass`, `first_ts`/`last_ts` (first and last | |
| trading day), `n_obs_pre` / `first_pre` (days and first day before 2025-06-01), `n_obs_post` (days from 2025-06-01), | |
| `n_mkt_days` (trading days of the market from `first_pre` to 2025-06-01), `n_obs_recent` / `mkt_days_recent` (days | |
| of the series and of its market in the two years before 2025-06-01), `obs_ratio` (= `n_obs_recent / | |
| mkt_days_recent`), `series_id`, `kept`. | |
| `forecasts/<model>/<origin>.parquet`: `series_id, origin, h, ts, q0.1 ... q0.9, mean, target` (one row per window and | |
| forecast day; `target` = observed price, null when the market did not trade). | |
| ## Coverage | |
| 12,863 series from 2,126 markets in 457 districts of 24 states and union territories, 176 food commodities in | |
| nine classes (vegetables 4,622 series, tomato/onion/potato 2,030, cereals 1,742, fruit 1,510, spices 1,285, | |
| oilseeds 798, pulses 725, sugar 129, dairy/meat/fish 22). Daily prices from 2001-01-10 to 2026-05-15; 25,729,325 | |
| rows before the first origin and 1,707,902 from it. A series is included when it has at least two years of history | |
| before 2025-06-01 and traded on at least half of its market's trading days in the two years before that date. | |
| The prices come from 83.2 million Agmarknet rows. 14.0 million exact paging duplicates were removed, as were | |
| non-food commodities (4.6 million rows) and 90,130 flagged rows (unit slips, outliers and non-positive prices). | |
| ## Source data | |
| Derived from 1 resource published on the Open Government Data Platform India (data.gov.in), snapshot May 2026, | |
| under the [Government Open Data License - India](https://data.gov.in/government-open-data-license-india). | |
| Providers: Directorate of Marketing and Inspection (Agmarknet), Ministry of Agriculture and Farmers Welfare. | |
| - Directorate of Marketing and Inspection (Agmarknet), Ministry of Agriculture and Farmers Welfare. "Variety-wise Daily | |
| Market Prices Data of Commodity". data.gov.in resource | |
| 35985678-0d79-46b4-9ed6-6f13308a1d24, https://api.data.gov.in/resource/35985678-0d79-46b4-9ed6-6f13308a1d24. | |
| Snapshot: May 2026. | |
| GODL-India does not cover personal information; this dataset holds market prices only. | |
| <!-- jm:source --> | |
| Original data: published by Directorate of Marketing and Inspection (Agmarknet), Ministry of Agriculture and Farmers Welfare on the Open Government Data Platform India ([data.gov.in](https://data.gov.in)) and, where marked, NITI Aayog's National Data and Analytics Platform ([NDAP](https://ndap.niti.gov.in)), under the [Government Open Data License - India](https://data.gov.in/government-open-data-license-india) (GODL-India). The original public data remains under GODL-India; the CC BY-NC-SA 4.0 licence of this repository covers JudicialMind's compilation, derived fields, annotations, benchmarks and models. | |
| <!-- /jm:source --> | |
| ## Citation | |
| ```bibtex | |
| @misc{judicialmind2026mandibench, | |
| title = {MandiBench: a probabilistic forecasting benchmark for daily mandi prices in India}, | |
| author = {JudicialMind}, | |
| year = {2026}, | |
| publisher = {Hugging Face}, | |
| howpublished = {\url{https://huggingface.co/datasets/judicialmind/MandiBench}} | |
| } | |
| ``` | |
| <!-- jm:license --> | |
| ## License | |
| [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) (see `LICENSE`): research, academic, personal and other non-commercial use, with attribution to JudicialMind and to the original data publishers; adaptations must be shared under the same licence. Commercial use requires a separate licence. | |
| Commercial use: contact surya@judicialmind.ai or hello@judicialmind.ai. | |
| <!-- /jm:license --> | |