For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create an Analysis Group

Creating an Analysis Group allows to aggregate Feature Importance for a number of Analyses

Create an Analysis Group

post

Creating an Analysis Group allows to aggregate Feature Importance for a number of Analyses

Authorizations
AuthorizationstringRequired

Enter your PredictHQ API key. The Bearer prefix is added automatically.

When calling the API directly, send: Authorization: Bearer <YOUR_API_KEY> as documented at https://docs.predicthq.com/api/overview/authenticating

Body
namestring · min: 1 · max: 256Required

Name of an analysis group.

Example: My Analysis Group 1
analysis_idsstring[] · max: 1200Required

The list of existing analysis IDs to include in the group.

Analyses can belong to multiple groups. Analyses must have the same demand type (the interval must match and, for weekly analyses, week_start_day must also be consistent). Every analysis in the group must have the same industry, if set.

Example: ["zRa_kk7MlAA","3aR-gbJp98I","JBb08XsZqAo","q9iX2XqFBxM"]
Responses
201

Successful Response

application/json
group_idstringOptional

The autogenerated identifier for the analysis group.

post/v1/beam/analysis-groups
POST /v1/beam/analysis-groups HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 148

{
  "name": "My Analysis Group 1",
  "analysis_ids": [
    "zRa_kk7MlAA",
    "3aR-gbJp98I",
    "JBb08XsZqAo",
    "q9iX2XqFBxM"
  ],
  "demand_type": {
    "unit_descriptor": "bookings"
  }
}
{
  "group_id": "text"
}

Examples

curl -X POST "https://api.predicthq.com/v1/beam/analysis-groups" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $API_TOKEN" \
     --data @<(cat <<EOF
    {
        "name": "Analysis Group 1",
        "analysis_ids": [
            "zRa_kk7MlAA",
            "3aR-gbJp98I",
            "JBb08XsZqAo",
            "q9iX2XqFBxM"
        ]
    }
    EOF
    )
import requests

response = requests.post(
    url="https://api.predicthq.com/v1/beam/analysis-groups",
    headers={
        "Authorization": "Bearer $API_TOKEN",
        "Accept": "application/json"
    },
    json={
        "name": "Analysis Group 1",
        "analysis_ids": [
            "zRa_kk7MlAA",
            "3aR-gbJp98I",
            "JBb08XsZqAo",
            "q9iX2XqFBxM",
        ],
    }
)

print(response.json())

Best Practices

Please refer to this guide for the best practices on grouping analyses: Grouping Analyses in Beam

OpenAPI Spec

The OpenAPI spec for Beam API can be found here.

Last updated

Was this helpful?