Introducing the Forecasts API — Event-driven forecasts for precise demand planning. Fast, accurate, and easy to run.
Explore Now
LogoLogo
Visit websiteWebAppGet DemoTry for Free
  • Tech Docs
  • API Reference
  • WebApp Support
  • API Reference
  • Swagger UI
  • Overview
    • Authenticating
    • API Specs
    • Rate Limits
    • Pagination
    • API Changes
    • Attribution
    • Troubleshooting
  • Events
    • Search Events
    • Get Event Counts
  • Broadcasts
    • Search Broadcasts
    • Get Broadcasts Count
  • Features
    • Get ML Features
  • Forecasts
    • Overview
    • Models
      • Create Model
      • Update Model
      • Replace Model
      • Delete Model
      • Search Models
      • Get Model
      • Train Model
    • Demand Data
      • Upload Demand Data
      • Get Demand Data
    • Forecasts
      • Get Forecast
    • Algorithms
      • Get Algorithms
  • Beam
    • Overview
    • Analyses
      • Create an Analysis
      • Update an Analysis
      • Partially Update an Analysis
      • Delete an Analysis
      • Search Analyses
      • Get an Analysis
      • Refresh an Analysis
      • Upload Demand Data
      • Get Correlation Results
      • Get Feature Importance
    • Analysis Groups
      • Create an Analysis Group
      • Update an Analysis Group
      • Partially Update an Analysis Group
      • Delete an Analysis Group
      • Search Analysis Groups
      • Get an Analysis Group
      • Refresh an Analysis Group
      • Get Feature Importance for an Analysis Group
  • Suggested Radius
    • Get Suggested Radius
  • Saved Locations
    • Overview
    • Create a Saved Location
    • Update a Saved Location
    • Delete a Saved Location
    • Search Saved Locations
    • Get a Saved Location
    • Search Events for a Saved Location
  • Loop
    • Loop Links
      • Create a Loop Link
      • Search Loop Links
      • Get a Loop Link
      • Update a Loop Link
      • Delete a Loop Link
    • Loop Settings
      • Get Loop Settings
      • Update Loop Settings
    • Loop Submissions
      • Search Submitted Events
    • Loop Feedback
      • Search Feedback
  • Places
    • Search Places
    • Get Place Hierarchies
  • Demand Surge
    • Get Demand Surges
Powered by GitBook

PredictHQ

  • Terms of Service
  • Privacy Policy
  • GitHub

© 2025 PredictHQ Ltd

On this page
  • Request
  • HTTP Request
  • Path Parameters
  • Response
  • Response Fields
  • Examples
  • Guides

Was this helpful?

  1. Beam
  2. Analyses

Get Feature Importance

Get relevant ML features based on a Beam Analysis.

This endpoint provides the relevant ML features (based on feature importance testing) that are shown to impact the demand for the Beam Analysis. These are the features you should take into your forecasting model to improve your model accuracy.

These values represent each group of features' statistical significance when it comes to impacting observable incremental/decremental changes in demand.

The easiest way to get these ML features from our Features API to be used in your models is by using the Beam analysis_id in your Features API request.

Request

HTTP Request

GET https://api.predicthq.com/v1/beam/analyses//feature-importance

Path Parameters

Parameter
Description

analysis_id

An existing Beam Analysis ID.

Response

Response Fields

Field
Description

feature_importance array

List of Feature Importance groups. Please refer to the Feature Importance Response Fields section below for the structure of each record.

Feature Importance Response Fields

Field
Description

feature_group string

The name of the group. This typically aligns to an event category. E.g. severe-weather, concerts

features array

The names of the features in the feature group. These refer directly to features available in Features API.

E.g.

p_value float

The p-value associated with this feature group for this analysis. It indicates how important the features in the group are in terms of demand. The lower the p-value, the more important the feature group is. E.g. 0.312

important boolean

A true of false value indicating whether the feature group is considered important for this analysis. Equivalent to p_value < 0.1 We suggest using this value to determine whether or not to include this group of features in your modeling.

Example response

Below is an example response:

{
    "feature_importance": [
        {
            "feature_group": "expos",
            "features": [
                "phq_attendance_expos"
            ],
            "p_value": 0.0,
            "important": true
        },
        {
            "feature_group": "school-holidays",
            "features": [
                "phq_attendance_school_holidays"
            ],
            "p_value": 0.0,
            "important": true
        },
        {
            "feature_group": "concerts",
            "features": [
                "phq_attendance_concerts"
            ],
            "p_value": 0.0002,
            "important": true
        },
        {
            "feature_group": "sports",
            "features": [
                "phq_attendance_sports"
            ],
            "p_value": 0.0039,
            "important": true
        },
        {
            "feature_group": "severe-weather",
            "features": [
                "phq_impact_severe_weather_air_quality_retail",
                "phq_impact_severe_weather_blizzard_retail",
                "phq_impact_severe_weather_cold_wave_retail",
                "phq_impact_severe_weather_cold_wave_snow_retail",
                "phq_impact_severe_weather_cold_wave_storm_retail",
                "phq_impact_severe_weather_dust_retail",
                "phq_impact_severe_weather_dust_storm_retail",
                "phq_impact_severe_weather_flood_retail",
                "phq_impact_severe_weather_heat_wave_retail",
                "phq_impact_severe_weather_hurricane_retail",
                "phq_impact_severe_weather_thunderstorm_retail",
                "phq_impact_severe_weather_tornado_retail",
                "phq_impact_severe_weather_tropical_storm_retail"
            ],
            "p_value": 0.1523,
            "important": false
        }
    ]
}

Examples

curl -X GET "https://api.predicthq.com/v1/beam/analyses/$ANALYSIS_ID/feature-importance" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $ACCESS_TOKEN"
import requests

response = requests.get(
    url="https://api.predicthq.com/v1/beam/analyses/<analysis_id>/feature-importance",
    headers={
      "Authorization": "Bearer $ACCESS_TOKEN",
      "Accept": "application/json"
    }
)

print(response.json())

Guides

Below are some guides relevant to this API:

  • https://github.com/predicthq/gitbook-tech-docs/blob/main/docs/getting-started/guides/beam-guides/README.md

PreviousGet Correlation ResultsNextAnalysis Groups

Last updated 2 days ago

Was this helpful?

{
  "features": ["phq_attendance_concerts"]
}