Quickstart

Rocket Vector is meant to be easy. There’s only 2 broad classes of operations: upload and query. In the examples below, we use curl commands to show how to execute these operations. Note that you will need an API key to submit the curl commands successfully.

Uploading a file looks like the following. Notice that you have to upload two files; one to specify the learning and deployment specifications; another that is your data.

1curl -X 'POST' \
2    'https://api.rocketvector.io/v2/trigger' \
3    -H "api-key: [YOUR_API_KEY]" \
4    -H 'accept: application/json' \
5    -H 'Content-Type: multipart/form-data' \
6    -F 'param_file=@deployment-specs.json;type=application/json' \
7    -F 'data_file=@data.csv;type=text/csv'

After your model is deployed, you may issue inferences against the model as follows. The deployment_id is the unique identifier of the model deployment.

 1curl -X 'POST' \
 2    'https://api.rocketvector.io/v2/inference' \
 3    -H "api-key: [YOUR_API_KEY]" \
 4    -H 'accept: application/json' \
 5    -H 'Content-Type: application/json' \
 6    -d '{
 7        "deployment_id": "[YOUR_DEPLOYMENT_ID]", 
 8        "evidence": {
 9            "sneezing": "true", 
10            "coughing": "false"
11        }
12    }'

API key

To get an API key, please contact us at info@rocketvector.io. We will determine your needs and issue you an API key as appropriate.

Uploading Files

Your model specification will include information on learning (eg the algorithm to use) and deployment (eg compute specifications such as CPU and memory). In the example below, we specify a model_id that identifies our model (must be unique across your models). The algorithm value specifies the particular algorithm you want to use. The inputs values are key-value pairs of inputs for the algorithm. The Naive Bayes learning algorithm expects at least 1 argument, which is the class variable.

1{
2    "learn": {
3        "model_id": "toy_example_v0.0.1",
4        "algorithm": "naive_bayes",
5        "inputs": {
6            "--clazz": "c"
7        }
8    }
9}

Your data should be in a CSV file. You should avoid special characters in your headers (variable names). You should also avoid long variable names. For now, all your variables should be categorical. We have the capabilities to learn Gaussian and linear conditional Gaussian networks, but these capabilities are not yet available for our preview release.

1a,b,c
2on,on,on
3on,on,off
4on,off,on
5on,off,off
6off,on,on
7off,on,off
8off,off,on
9off,off,off

If you have phenomenally huge files, and have difficulty uploading them, please contact us for better approaches.

Queries

When you issue a query, you must supply the deployment ID. If you supply evidences, these come as key-value pairs (eg variable-value). If you do not supply any evidences, the marginal posteriors will be computed and returned.

1{
2    "deployment_id": "[YOUR_DEPLOYMENT_ID]", 
3    "evidence": {
4        "a": "on"
5    }
6}