> 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/predicthq-data/impact-patterns.md).

# Predicted Impact Patterns

This field shows the impact of leading days (days before the event), lagging days (days after an event), and the days the event occurs. For example, if someone is taking a flight to a location to attend a concert, they are typically not going to be arriving on the day of the event. They will often arrive a couple of days before and check into their hotel before the concert begins. The Predicted Impact Patterns for accommodation reflects the fact that this demand will be felt before the event starts and often after it ends. Predicted Impact Patterns are industry-specific and reflect the varying leading and lagging impact of events on different industries.

{% hint style="success" %}
We recommend that if you operate in the supported industries you use Predicted Impact features instead of the generic features as these result in greater forecast accuracy as they include the impact before an event starts and after it finishes. In our testing we have found significant forecasting accuracy improvements from using Predicted Impact features in demand forecast machine learning models.
{% endhint %}

The following diagram shows Predicted Impact Patterns:

<figure><img src="https://2312509647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtNhzHETmXsrWeVBndqqJ%2Fuploads%2F9kVflaqtBHe0wRROwWEI%2Fimage.png?alt=media&amp;token=489c051b-e2df-4c81-9669-22eb58336116" alt="Diagram of a Predicted Impact Pattern showing impact on leading days before an event, on event days, and on lagging days after it"><figcaption></figcaption></figure>

You can use Predicted Impact Patterns in your demand forecasting so that your machine learning models account for the impact on leading and lagging days. In our testing we have found using Predicted Impact Patterns increases forecasting accuracy.

#### Vertical, type, and category mapping

Predicted Impact Patterns are available for these industry segments and categories:

{% tabs %}
{% tab title="Accommodation" %}

| Impact Type      | Category          |
| ---------------- | ----------------- |
| `phq_rank`       | `public-holidays` |
|                  | `observances`     |
| `phq_attendance` | `community`       |
|                  | `concerts`        |
|                  | `conferences`     |
|                  | `expos`           |
|                  | `festivals`       |
|                  | `performing-arts` |
|                  | `sports`          |
| {% endtab %}     |                   |

{% tab title="Retail" %}

| Impact Type      | Category          |
| ---------------- | ----------------- |
| `phq_rank`       | `public-holidays` |
|                  | `observances`     |
|                  | `severe-weather`  |
| `phq_attendance` | `community`       |
|                  | `concerts`        |
|                  | `conferences`     |
|                  | `expos`           |
|                  | `festivals`       |
|                  | `performing-arts` |
|                  | `sports`          |
| {% endtab %}     |                   |

{% tab title="Hospitality (Restaurants)" %}
Predicted Impact Patterns features for this industry use the name `hospitality` but this category covers food & beverage including restaurants.

| Impact Type      | Category          |
| ---------------- | ----------------- |
| `phq_rank`       | `public-holidays` |
|                  | `observances`     |
| `phq_attendance` | `community`       |
|                  | `concerts`        |
|                  | `conferences`     |
|                  | `expos`           |
|                  | `festivals`       |
|                  | `performing-arts` |
|                  | `sports`          |
| {% endtab %}     |                   |
| {% endtabs %}    |                   |

## Predicted Impact Patterns in the Events API

The [Events API](/api/events/search-events.md) returns Predicted Impact Patterns in the `impact_patterns` field of its response. This shows the Predicted Impact Patterns for each event. The following are the details of the data structure of that field.

`impact_patterns` is an array of impact pattern objects. The same event can have different Predicted Impact Patterns for different industry verticals. It contains the following fields:

* `vertical` - The industry vertical the impact pattern applies to.
* `impact_type` - Indicates the type of impact shown in the impact pattern. This applies to either `phq_rank` or `phq_attendance`, depending on the vertical.

`impacts` is an array of objects with one entry for each day that contains the following values:

* `date_local` - the date in the local timezone of the event.
* `value` - the value of the `impact_type` for that given day. For example, if the `impact_type` was `phq_rank` the value would be the PHQ Rank value on the given day. In the case for `accommodation` or `hospitality` where the `impact_type` is `phq_attendance`, the API returns the `phq_attendance` value in this field.
* `position` - is `leading`, `event_day`, or `lagging`. `leading` are the days before the event occurs, `event_day` are the days the event occurs, and `lagging` are the days after the event has occurred.

For `accommodation` and `hospitality` events:

```json
"impact_patterns": [
    {
        "vertical": "accommodation",
        "impact_type": "phq_attendance",
        "impacts": [
            {"date_local": "2018-02-26", "value": 14250, "position": "leading"},
            {"date_local": "2018-02-27", "value": 14250, "position": "leading"},
            {"date_local": "2018-02-28", "value": 85500, "position": "leading"},
            {"date_local": "2018-03-01", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-02", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-03", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-04", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-05", "value": 33250, "position": "lagging"},
            {"date_local": "2018-03-06", "value": 4750, "position": "lagging"},
        ],
    }, {
        "vertical": "hospitality",
        "impact_type": "phq_attendance",
        "impacts": [
            {"date_local": "2018-02-26", "value": 16151, "position": "leading"},
            {"date_local": "2018-02-27", "value": 40850, "position": "leading"},
            {"date_local": "2018-02-28", "value": 40850, "position": "leading"},
            {"date_local": "2018-03-01", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-02", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-03", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-04", "value": 95000, "position": "event_day"},
            {"date_local": "2018-03-05", "value": 14250, "position": "lagging"},
        ],
    }
]

```

For `retail` severe weather events:

```json
"impact_patterns": [
    {
        "vertical": "retail",
        "impact_type": "phq_rank",
        "imputed_impact_pattern": true,
        "impact_range_start_dt": "2018-02-03T15:00:00+00:00",
        "impact_range_end_dt": "2018-02-07T14:59:59+00:00",
        "impacts": [
            {"date_local": "2018-02-04", "value": 40, "position": "leading"},
            {"date_local": "2018-02-05", "value": 64, "position": "event_day"},
            {"date_local": "2018-02-06", "value": 50, "position": "lagging"},
            {"date_local": "2018-02-07", "value": 50, "position": "lagging"},
        ],
    }
]

```

## Predicted Impact Patterns in the Features API

You can also use Predicted Impact Patterns with the Features API. The Features API provides pre-built machine learning features for demand forecasting. See the [Features API](/api/features/get-features.md) documentation. For more accurate forecasting results, use the features for your industry. We have a generic feature without Predicted Impact Patterns for sports called `phq_attendance_sports` but that does not include Predicted Impact Patterns so only shows the impact on the days of the event. To use Predicted Impact Patterns with the Features API, use the features for your industry. For example, if you are in the accommodation segment and are using the Features API to find the impact of sports events on your location you would use `phq_attendance_sports_accommodation`. If you were in the Hospitality Segment you would use `phq_attendance_sports_hospitality`.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.predicthq.com/getting-started/predicthq-data/impact-patterns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
