REST API Access (for disabled DSP only)
When Prediction is enabled, REST API Access to the model is also enabled automatically. With REST API Access users can send new data for predictions to the hosted model from anywhere on the web, for example, you have developed your own application which you would like to augment with Neuton AI capabilities by sending prediction requests to the Neuton platform. Click Access Instructions (see picture below) on the Prediction tab to copy request codes.
In the pop-up window, you will find the following instructions:
/v2/predict
send a request for prediction of a single line;
/v2/predict/file
send a request for prediction of a whole file;
/v2/predict/status/{uuid}
possible returned statuses;
/v2/predict/result/{uuid}
get request example for prediction results.
REST API Access
You can expand instructions and view URL, Content-Type, Request, and Response codes.
REST API Access Instructions Expanded
Additionally, you can download the code samples by clicking “Samples”. You can find code samples for predicting on a whole file for multiple programming languages including Scala, C#, Java, and Python to access the deployed model via the REST API service.
To predict on the new data, you should specify the following parameters in code samples before running it:
URL
the URL from the Access Instructions, which is equal to the URL address of the hosted model before the 4th slash, but not including it (eg, url='https://solution. neuton.ai/699de50c-11df-2742-85e0-5dad58e3197b’).
file_path
the path to test the dataset or new data (eg, file_path=' test.csv’)
If the Web Predictions and/or REST API Access to the model is no longer required users should disable the prediction service to optimize the use of infrastructure.