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.

{
  "features": ["phq_attendance_concerts"]
}

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"

Guides

Below are some guides relevant to this API:

Last updated

Was this helpful?