Save PredictionΒΆ
The save_prediction
session, is an implementation that saves a supplied prediction
result, into the applications database, via the /save-prediction
endpoint:
Note: the content of each of the above examples, can be substituted for
the data
attribute, in a given POST
request:
import requests
endpoint = 'https://192.168.99.101:9090/save-prediction'
headers = {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json'
}
requests.post(endpoint, headers=headers, data=json_string_here)
Note: more information, regarding how to obtain a valid token
, can be further
reviewed, in the /login
documentation.
The following properties define the above data
attribute:
status
: provides the application utilizing this programmatic-api, an additional layer to perform conditional sanity checks, before storing the corresponding results:valid
: indication to proceed storing result into the database
model_type
: corresponds to the desired model type:svm
: pertains only to the support vector machine model typesvr
: pertains only to the suppport vector regression model type
title
: desired name to assign the proposed prediction result.data
:result
: the computed result of the predictionclasses
: applies only to the svm predictionprobability
: applies only to the svm predictiondecision_function
: applies only to the svm predictionr2
: applies only to the svr prediction