Retrieving Results

This method retrieves job results for a prediction task with a specified a job id and job code.

The results endpoint retrieves the outcomes and insights of a prediction task using a specified job_id and job_code. This endpoint provides access to a variety of prediction results, including core results that apply to all prediction types and extended results that offer additional details for specific prediction models, such as psr (partial sample regression) and maxfit.

Use this endpoint to request and analyze the outcomes of a completed prediction task, gaining a deeper understanding of how features were weighed and the final predictions generated.

Core Results

The core results are common across all prediction tasks, including grid predictions and base response cases. These include essential metrics like the prediction outcomes, fit, adjusted fit, variable importance, and the prediction weights across observations. The core results provide a foundational understanding of the prediction outcomes and model performance for all types of predictions.

get

Request results and insights for a prediction task.

Authorizations
Header parameters
Content-TypestringOptional

The content type of the request (application/json)

Example: application/json
ConnectionstringOptional

Connection header value (keep-alive)

Example: keep-alive
Body
all ofOptional
Responses
200

Result object(s) of a successful prediction task.

application/json
get
Python Example
import requests
import json

url = "https://api.csanalytics.io/v2/prediction-engine/psr"

payload = {
    "job_id": 1074
    "job_code": "66cfc21f7effa501"
}

headers = {
  'x-api-key': 'CSA_API_KEY',
  'Content-Type': 'application/json',
  'Connection': 'keep-alive'
}

response = requests.request("GET", url, headers=headers, data=json.dumps(payload))

print(response.text)
200

Result object(s) of a successful prediction task.

{
  "yhat": [
    [
      3.285239
    ]
  ],
  "fit": [
    [
      0.08769
    ]
  ],
  "adjusted_fit": [
    [
      1.057741
    ]
  ],
  "kfit": [
    [
      0.08769
    ]
  ],
  "include": [
    [
      1
    ],
    [
      0
    ],
    [
      1
    ],
    [
      1
    ],
    [
      0
    ],
    [
      1
    ],
    [
      1
    ]
  ],
  "weights": [
    [
      -0.191071
    ],
    [
      0.229452
    ],
    [
      -0.268879
    ],
    [
      1.171929
    ],
    [
      -0.046778
    ],
    [
      -0.024025
    ],
    [
      0.129372
    ]
  ],
  "variable_importance": [
    0.326091,
    0.098205,
    0.205904,
    0.189534,
    0.187681
  ],
  "variable_importance_on_yhat": [
    0.188679,
    0.232704,
    0.194969,
    0.308176,
    0.075472
  ],
  "eval_type": "both",
  "most_eval": [
    [
      true
    ]
  ],
  "yhat_linear": "[[7.145171]]"
}

Extended

The extended results section details additional objects included in the response for specific endpoints, such as psr and maxfit. These results offer deeper insights into the behavior and performance evaluation of the prediction task, providing metrics such as relevance, similarity, and informativeness that are specific to each task.

get

Request results and insights for a prediction task.

Authorizations
Header parameters
Content-TypestringOptional

The content type of the request (application/json)

Example: application/json
ConnectionstringOptional

Connection header value (keep-alive)

Example: keep-alive
Body
all ofOptional
Responses
200

Result object(s) of a successful prediction task.

application/json
get
Python Example
import requests
import json

url = "https://api.csanalytics.io/v2/prediction-engine/psr"

payload = {
    "job_id": 1074]
    "job_code": "66cfc21f7effa501"
}

headers = {
  'x-api-key': 'CSA_API_KEY',
  'Content-Type': 'application/json',
  'Connection': 'keep-alive'
}

response = requests.request("GET", url, headers=headers, data=json.dumps(payload))

print(response.text)
200

Result object(s) of a successful prediction task.

{
  "yhat": [
    [
      3.285239
    ]
  ],
  "fit": [
    [
      0.08769
    ]
  ],
  "adjusted_fit": [
    [
      1.057741
    ]
  ],
  "kfit": [
    [
      0.08769
    ]
  ],
  "include": [
    [
      0
    ],
    [
      1
    ],
    [
      0
    ],
    [
      1
    ],
    [
      0
    ],
    [
      0
    ],
    [
      0
    ]
  ],
  "weights": [
    [
      -0.667564
    ],
    [
      1.547883
    ],
    [
      -0.667564
    ],
    [
      2.789935
    ],
    [
      -0.667564
    ],
    [
      -0.667564
    ],
    [
      -0.667564
    ]
  ],
  "variable_importance": [
    0.326091,
    0.098205,
    0.205904,
    0.189534,
    0.187681
  ],
  "variable_importance_on_yhat": [
    0.188679,
    0.232704,
    0.194969,
    0.308176,
    0.075472
  ],
  "agreement": [
    [
      0.081329
    ]
  ],
  "asymmetry": [
    [
      0.240053
    ]
  ],
  "relevance": [
    [
      -3.70579
    ],
    [
      5.606112
    ],
    [
      -11.03232
    ],
    [
      8.749082
    ],
    [
      3.020223
    ],
    [
      -1.302111
    ],
    [
      -1.335196
    ]
  ],
  "similarity": [
    [
      -26.120573
    ],
    [
      -18.117331
    ],
    [
      -34.930252
    ],
    [
      -15.151777
    ],
    [
      -20.736707
    ],
    [
      -24.080001
    ],
    [
      -25.208285
    ]
  ],
  "info_theta": [
    [
      42.669979
    ],
    [
      42.669979
    ],
    [
      42.669979
    ],
    [
      42.669979
    ],
    [
      42.669979
    ],
    [
      42.669979
    ],
    [
      42.669979
    ]
  ],
  "info_x": [
    [
      2.159588
    ],
    [
      4.776907
    ],
    [
      5.125885
    ],
    [
      5.131739
    ],
    [
      4.843881
    ],
    [
      2.885802
    ],
    [
      5.076199
    ]
  ],
  "K": [
    [
      5
    ]
  ],
  "n": [
    [
      1
    ]
  ],
  "outlier_influence": [
    [
      0.102385
    ]
  ],
  "r_star": [
    [
      0.102385
    ]
  ],
  "r_star_percent": [
    [
      0.8
    ]
  ],
  "eval_type": [
    [
      "relevance"
    ]
  ],
  "most_eval": [
    [
      true
    ]
  ],
  "yhat_linear": [
    [
      7.145171
    ]
  ]
}

Last updated