This repo provide code to understand and build onnx models for use in the Prevision.io Platform.
A complete doc for using onnx model in Prevision.io Platform is available here
Clone this repo and open the prevision-onnx-templates folder :
git clone https://github.com/previsionio/prevision-onnx-templates.git
cd prevision-onnx-templates
If not done, create a virtualenv
python -m venv env
And install the requirements
source env/bin/activate
pip install -r requirements.txt
If you want to use the Prevision SDK yoy may setup an .env
file with the following fields :
DOMAIN=https://cloud.prevision.io
PIO_MASTER_TOKEN=<MASTER_TOKEN>
( see the API doc to get your master token)
Note : a small subset of a fraud transaction dataset is provided in the data
folder.
You can use sktoonnx.py for a basic sklearn classifier exportation to onnx :
python sktoonnx.py
The scripts build a ( very ) basic classifier and export it to onnx model. You can then use the content of data/assets
folder into your Prevision Account. Then see the documentation for importing your own model
You can use ( and inspect ) the sdkimport.py
script to export your models and pipeline programmatically. This script uses several basic sklearn pipeline ( feature engineering + modelisation) , converts them to onnx and create an experiment to benchmark them altogether inside the same experiment into your prevision account
**Warning : this scripts uses ressources generated from the previous one so be sure to launch it before
python sktoonnx.py
python sdkimport.py