Discover the OVH Prescience APIs
Objective
Prescience is an automatic learning tool that can be managed through several APIs to automate a wide range of actions.
This guide is a detailed introduction to those APIs and will show you how to manage your own OVH Prescience platform.
Authentication
Using Prescience requires an authentication token.
Here is an example of an API call:
OVH Prescience API
Sources
The “source” object is the result of a parsing task (analysis). During the API call, the returned object includes the following items:
Resource list:
GET https://prescience-api.ai.ovh.net/source
Source retrieval:
GET https://prescience-api.ai.ovh.net/source/{id_source}
Source deletion:
DELETE https://prescience-api.ai.ovh.net/source/{id_source}
Datasets
The “dataset” object is the result of a “preprocessing” task. During the API call, the returned object will contain the following items:
List of datasets:
GET https://prescience-api.ai.ovh.net/dataset/
Dataset retrieval:
GET https://prescience-api.ai.ovh.net/dataset/{id_dataset}
Deleting a dataset:
DELETE https://prescience-api.ai.ovh.net/dataset/{id_dataset}
Models
The “model” object is the result of a “train” task. During the API call, the returned object will contain the following items:
The “config” object describes the configuration used to generate the machine learning model.
Model list:
GET https://prescience-api.ai.ovh.net/model
Model retrieval:
GET https://prescience-api.ai.ovh.net/model/{id_model}
Deleting a model:
DELETE https://prescience-api.ai.ovh.net/model/{id_model}
Parsing
To create a “source”, you need to launch a parsing task.
POST https://prescience-api.ai.ovh.net/ml/upload/source
For example:
Assuming that the “data-1.csv” and “data-2.csv” CSV files are in the same directory:
parse.json file
The source that was sent back in the response is incomplete. Since the task is asynchronous, it will be completed as it progresses.
Preprocess
To create a "dataset", you must first have generated a "source", and then have created a preprocess task.
POST https://prescience-api.ai.ovh.net/ml/preprocess/{source_id}
For example:
preprocess.json file
The dataset that was sent back in the response is incomplete. Since the task is asynchronous, it will be completed as it progresses.
Optimisation
Once the dataset has been created, it is possible to start optimising it.
POST https://prescience-api.ai.ovh.net/ml/optimize/{dataset_id}
For example:
optimize.json file
The optimisation task returns an object called "Optimization". Once the optimisation is complete, it will be possible to run a query on the "Evaluation-Result" objects to obtain the best possible configuration.
Evaluation Result
The "Evaluation-Result" object is the result of an optimisation task. During the API call, the returned object will contain the following items:
Evaluation list:
GET https://prescience-api.ai.ovh.net/evaluation-result
Training
After choosing the best configuration from the list of "Evaluation-Results" we can train a model:
POST https://jedison.ai.ovh.net/ml/train
For example:
The training task returns an incomplete model object. Indeed, since the task is asynchronous, it will be completed as it progresses.
OVH Prescience Serving API
Model description:
Once a model is trained, it can be used to make inferences.
Both APIs have a "model" object. These do not have the same structure. Only the model_id identifier is common to both.
Model description:
POST https://prescience-serving.ai.ovh.net/model/{model_id}
The returned object describes the "model" object according to Prescience Serving.
Example of result:
Model evaluation
During the preprocessing stage, a data transformation is performed. Since the model is based on the output of this transformation, it is imperative that the data is transformed before using the model. Prescience Serving provides methods of performing both this transformation and the inference.
The Serving platform allows you to perform the following:
- Transformation and evaluation
- Evaluation only
- Transformation only
Example of unit inference:
example.json file
Query
Example of the evaluation of a JSON batch:
example.json file
Query
Go further
Join our community of users on https://community.ovh.com/en/.