{"id":23063,"library":"datasetsforecast","title":"datasetsforecast","description":"A Python library providing popular time series forecasting datasets (M3, M4, M5, etc.) with easy loading, splitting, and preprocessing. Current version 1.0.1, released June 2025. Maintained by Nixtla, with monthly releases.","status":"active","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/Nixtla/datasetsforecast","tags":["time-series","forecasting","datasets","M4","M5","Nixtla"],"install":[{"cmd":"pip install datasetsforecast","lang":"bash","label":"pip"},{"cmd":"conda install -c conda-forge datasetsforecast","lang":"bash","label":"conda"}],"dependencies":[{"reason":"Data manipulation","package":"pandas","optional":false},{"reason":"Numerical arrays","package":"numpy","optional":false},{"reason":"Data download","package":"requests","optional":false}],"imports":[{"note":"M4 is a class in the m4 module, not top-level.","wrong":"from datasetsforecast import M4","symbol":"M4","correct":"from datasetsforecast.m4 import M4"},{"note":"M5 is a class in the m5 module.","wrong":"from datasetsforecast import M5","symbol":"M5","correct":"from datasetsforecast.m5 import M5"},{"note":"HierarchicalData is in the hierarchical module.","wrong":"from datasetsforecast import HierarchicalData","symbol":"HierarchicalData","correct":"from datasetsforecast.hierarchical import HierarchicalData"}],"quickstart":{"code":"from datasetsforecast.m4 import M4\ndataset = M4.load('Yearly')\nprint(dataset['train'].head())","lang":"python","description":"Load the M4 yearly dataset and preview the training set."},"warnings":[{"fix":"Remove imports of `losses` and `evaluation`. Use alternative libraries like `numpy` or `scikit-learn` for metrics.","message":"In v1.0.0, the `losses` and `evaluation` modules were removed. Any imports from `datasetsforecast.losses` or `datasetsforecast.evaluation` will fail.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use correct submodule path as shown in the imports section.","message":"Dataset classes (M3, M4, M5, etc.) are not directly importable from the top-level `datasetsforecast` package. You must import from the submodule (e.g., `from datasetsforecast.m4 import M4`).","severity":"gotcha","affected_versions":"all"},{"fix":"Run `pip install datasetsforecast>=1.0.1`.","message":"The `M3` dataset download URL changed in v1.0.1. If you're on an older version, you may get a 404 error. Upgrade to >=1.0.1.","severity":"gotcha","affected_versions":"<1.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Remove any import of `datasetsforecast.losses`. Use another metrics library or compute metrics manually.","cause":"The 'losses' module was removed in v1.0.0 as a breaking change.","error":"ModuleNotFoundError: No module named 'datasetsforecast.losses'"},{"fix":"Change the import to `from datasetsforecast.m4 import M4`.","cause":"M4 is not exported at the top level; it's in `datasetsforecast.m4`.","error":"AttributeError: module 'datasetsforecast' has no attribute 'M4'"},{"fix":"Upgrade to datasetsforecast>=1.0.1: `pip install --upgrade datasetsforecast`.","cause":"Outdated dataset download URL, fixed in v1.0.1 for M3 and other datasets.","error":"requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://zenodo.org/record/..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}