Max Fit Predictions

Post a maxfit prediction task to the CSA Prediction Engine

The maxfit endpoint focuses on maximizing the fit of a relevance-based partial sample regression by evaluating psr across a range of censors and censor thresholds. Whether you’re forecasting or analyzing outcomes, maxfit ensures that your results align closely with the underlying data patterns with confidence.

Quick Start

Getting started with the maxfit endpoint is simple. Supply the access ID along with prediction inputs such as dependent variable, independent variables, and prediction settings. The API processes the task to optimize fit, offering valuable insights with minimal setup.

post

Essential input arguments for invoking relevance-based maxfit predictions.

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

Response body of a successful post job (maxfit).

application/json
post
Python Example
import requests
import json

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

payload = {
    "y": [[18.8], [2.3], [3.0], [6.7], [15.2], [20.9], [4.0]],
    "X": [[25.0,2.0,76.0,53.7,23.1],[29.0,1.0,78.0,39.1,5.7],[32.0,2.0,77.0,54.1,5.3],[30.0,5.0,82.0,68.7,8.7],[24.0,1.0,69.0,51.0,20.3],[25.0,2.0,79.0,50.2,20.0],[35.0,3.0,80.0,51.5,9.4]],
    "theta": [[24.0, 5.0, 81.0, 60.0, 11.0]]
}

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

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

200

Response body of a successful post job (maxfit).

{
  "job_id": 1074,
  "job_code": "66cfc21f7effa501"
}

Custom Settings

With the maxfit endpoint, you can fine-tune various settings to achieve optimal fit for your prediction tasks. Customize options like the threshold range and step-size resolution to optimize your results. This makes it ideal for users who need precision and control in their prediction task.

post

Extended specifications for invoking relevance-based maxfit predictions.

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

Response body of a successful post job (maxfit).

application/json
post
Python Example
import requests
import json

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

payload = {
    "y": [[18.8], [2.3], [3.0], [6.7], [15.2], [20.9], [4.0]],
    "X": [[25.0, 2.0, 76.0, 53.7, 23.1], [29.0, 1.0, 78.0, 39.1, 5.7], [32.0, 2.0, 77.0, 54.1, 5.3], [30.0, 5.0, 82.0, 68.7, 8.7], [24.0, 1.0, 69.0, 51.0, 20.3], [25.0, 2.0, 79.0, 50.2, 20.0], [35.0, 3.0, 80.0, 51.5, 9.4]],
    "theta": [[24.0, 5.0, 81.0, 60.0, 11.0]],
    "threshold_range": [0, 0.20, 0.50, 0.80],
    "is_threshold_percent": true,
    "most_eval": true,
    "eval_type": "both",
    "stepsize": 0.2
}

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

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

print(response.text)
200

Response body of a successful post job (maxfit).

{
  "job_id": 1074,
  "job_code": "66cfc21f7effa501"
}

Last updated