Generate a new prediction using an Analysis that was created in Kraken.
Resource URL
https://api.bigsquid.com/predictionapi/analyses/:id
POST Body
Fields
name | type | required | description |
---|---|---|---|
data | array of objects | Yes | An array of column names and values. The column schema must match the schema of the Analysis created within Kraken |
primaryKey | string | No | A column that acts as a primary key that can be used to link a single record back to the input data used in the request |
Sample Request
Content-Type: application/json
Accept: application/json
Authorization: token [API Key Here]
{
"primaryKey": "Account ID",
"data": [
{
"Account ID": "io97524",
"State": "KS",
"Customer Tenure": 110,
"Repeat Customer": "no",
"Promo Plan": "yes",
"Days to Sale": 25,
"Usage": 244.7,
"Prior Period Usage": 197.4,
"Base Fee": 45.07,
"Purchased Features": 16.78,
"Days Since Last Contact": 99,
"Customer Service Rank": 10,
"Customer Service Calls": 3,
"Taxes & Fees": 2.7,
"Nbr of Penalties": 1,
"Plan Type": "Monthly Auto-Renew"
}
]
}
Sample Response
Returns a predictions object with a predicted value, probabilities for the prediction if applicable, and the primary key if one was provided in the request.
HTTP/1.1 200 Success
Content-Type: application/json
{
"primaryKey": "Account ID",
"predictions": [
{
"Account ID": "io97524",
"prediction": "no",
"probability_no": 0.95755506,
"probability_yes": 0.04244495
}
]
}