> For the complete documentation index, see [llms.txt](https://docs.predicthq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.predicthq.com/getting-started/data-science-notebooks.md).

# Data Science Notebooks

PredictHQ features exist to make forecasts more accurate. Adding event features to a demand forecasting model reduces forecast error in a way you can measure and attribute - and what a point of accuracy is worth is relative to your business: at enterprise scale, even a fraction of a percent less forecast error can mean millions of dollars in better staffing, inventory, and pricing decisions. These Jupyter notebooks show how to capture that lift in your own models: calibrating with Beam, retrieving model-ready features, and training and forecasting with them.

If you're new, work through the first four notebooks in order—they follow the recommended workflow: Beam identifies which event categories drive demand at each location, the Features API turns them into model-ready signals, and your model (or the Forecasts API) does the rest. Before you backtest, read [Data Leakage in Backtesting](/getting-started/core-concepts/data-leakage-in-backtesting.md) so historical evaluation reflects what the model sees in production.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Forecasts API Notebook</strong></td><td>Use the Forecasts API to get event-driven forecasts without building your own model - it applies Beam automatically and returns forecasts with a baseline comparison so you can measure the accuracy lift.</td><td><a href="/files/qapbKtZxFuPXFH6KeJvm">/files/qapbKtZxFuPXFH6KeJvm</a></td><td></td><td><a href="https://github.com/predicthq/phq-data-science-docs/blob/master/forecasts-api/demand_forecasting_with_phq_forecasts_api.ipynb">https://github.com/predicthq/phq-data-science-docs/blob/master/forecasts-api/demand_forecasting_with_phq_forecasts_api.ipynb</a></td></tr><tr><td><strong>Beam Notebooks</strong></td><td>Run Beam to identify which event categories drive demand at each of your locations - the calibration step that configures feature selection for everything downstream. Start here.</td><td><a href="/files/ZiHUXUhQV4UcLVmteaBj">/files/ZiHUXUhQV4UcLVmteaBj</a></td><td></td><td><a href="/pages/Gue0Nq6lLgbIaWCATKRw">/pages/Gue0Nq6lLgbIaWCATKRw</a></td></tr><tr><td><strong>Features API Notebook</strong></td><td>Retrieve model-ready event features keyed by your Beam analysis - historical windows for training, future-dated windows at inference.</td><td><a href="/files/MSoXowQNtUJuRunoGuau">/files/MSoXowQNtUJuRunoGuau</a></td><td></td><td><a href="/pages/JHoYyfYNHkXBdP5y1UaD">/pages/JHoYyfYNHkXBdP5y1UaD</a></td></tr><tr><td><strong>Demand Forecasting Notebook</strong></td><td>Step-by-step guide on how to use PredictHQ event features in your existing demand forecasting models.</td><td><a href="/files/H4emh2xTl3AJ0f78ngym">/files/H4emh2xTl3AJ0f78ngym</a></td><td></td><td><a href="/pages/5wdf9fTc3lfbAIrVi9ZK">/pages/5wdf9fTc3lfbAIrVi9ZK</a></td></tr><tr><td><strong>Attendance-Based Events Notebooks</strong></td><td>Attended Events are scheduled to occur at a specific location and usually depend on attendance, such as conferences, expos, concerts, festivals, performing-arts, sports and community.</td><td><a href="/files/H9jrO1kxkXokOx0fCaaG">/files/H9jrO1kxkXokOx0fCaaG</a></td><td></td><td><a href="/pages/Pb3JPsAemm9MRBR8hTIC">/pages/Pb3JPsAemm9MRBR8hTIC</a></td></tr><tr><td><strong>Non-Attendance-Based Events Notebooks</strong></td><td>Non-Attendance-Based Events are events with a start and end date, but are more fluid and distributed in impact, such as observances or school holidays.</td><td><a href="/files/r5RA9bFa4w241GLO1TZr">/files/r5RA9bFa4w241GLO1TZr</a></td><td></td><td><a href="/pages/BUExzXpRh4sAIcMpdXJM">/pages/BUExzXpRh4sAIcMpdXJM</a></td></tr><tr><td><strong>Severe Weather Event Notebooks</strong></td><td>Severe weather is any dangerous meteorological phenomenon with the potential to cause damage, serious social disruption, or loss of human life.</td><td><a href="/files/I34A4myxZDqUv14T6N09">/files/I34A4myxZDqUv14T6N09</a></td><td></td><td><a href="/pages/6YT2c5aESF59QDIXcZd4">/pages/6YT2c5aESF59QDIXcZd4</a></td></tr><tr><td><strong>Academic Events Notebooks</strong></td><td>Academic Events are captured from an individual higher education institute’s academic calendar. They outline the general undergraduate activities, for example instruction period, break, exams, graduation, social, etc.</td><td><a href="/files/NjTp3S9DBxTYrkIlITT1">/files/NjTp3S9DBxTYrkIlITT1</a></td><td></td><td><a href="/pages/6nQnlpznMZpKYRZkRef6">/pages/6nQnlpznMZpKYRZkRef6</a></td></tr><tr><td><strong>Live TV Events Notebooks</strong></td><td>Live TV Events covers live broadcast sports games with a large number of people watching at a particular time across different counties across the United States.</td><td><a href="/files/SETkfZGFrUVNTJ8yk4B3">/files/SETkfZGFrUVNTJ8yk4B3</a></td><td></td><td><a href="/pages/0PdDLiIzew6PeuSoKzP8">/pages/0PdDLiIzew6PeuSoKzP8</a></td></tr><tr><td><strong>Working with Venues Notebook</strong></td><td>Guide to exploring PredictHQ’s venue information.</td><td><a href="/files/NPZNo47gAB6TE2hsVeyF">/files/NPZNo47gAB6TE2hsVeyF</a></td><td></td><td><a href="/pages/WU99fOMEenTo26v1nq1y">/pages/WU99fOMEenTo26v1nq1y</a></td></tr></tbody></table>

All our Data Science Notebooks can be found in our [GitHub repo](https://github.com/predicthq/phq-data-science-docs/tree/master).

For the concepts behind the workflow, see [Which API Should I Use?](/getting-started/core-concepts/which-api-should-i-use.md) Using a pre-trained forecasting model instead of training your own? See [Using event features with time series foundation models](/getting-started/guides/features-api-guides/using-event-features-with-time-series-foundation-models.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.predicthq.com/getting-started/data-science-notebooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
