Heimdall ML
Build & Deploy custom classification or regression machine learning models with your data.
File Specifications
In order to build a ML object, you will need to first upload your customer checkout data. This data will need to be in a specific format in order to be ingested by the ML upload process. Below is a high-level list of specifications for your data:
- File type has to be .csv
- The first row needs to be column headers
- File should have a minimum of a 1000 rows.
- Max file size of 10 MB.
1, "Id,MSSubClass,MSZoning,LotFrontage,LotArea,Street, SalePrice"
2, "1,60,RL,65,8450,Pave,181500"
3, "3,60,RL,68,11250,Pave,223500"
You can also upload your data from your Databricks SQL Warehouse
API Specifications
Endpoint
POST https://predict.heimdallapp.org/predict/
Request Headers
- x-api-key - API key that is issued when the endpoint is configured.
- x-username - Username associated with your account.
- x-model-id - Unique identifier associated with the model.
All request headers are required. Model ID can be found on the model details page.
API Keys are issued one time and cannot be retrieved. If you lose your API key, please disable the endpoint in the model details page and reconfigure to get a new API key.
Request Body
- features - Nested dictionary of features. The keys are the names of the columns or features from your data and the values are the new values for those columns.
Below is a high-level structure of the nested features dictionary
features : { features : { {name: value}}}
Response Object
- prediction The prediction value based on the features that are passed in.
{
"prediction": "0"
}
Predictions can either be numerical or text based on if you trained a regression or classification model.
You will receieve a 422 error your request body structure is incorrect.
Sample Request
Use the below sample request in Python to get started. You can also use the code editor in the model details page to test your specific model endpoint.
This is just a sample. The features in your request will be custom to your data. You will also need to fill in your specific header values.
import requests
url = 'https://predict.heimdallapp.org/predict/'
headers = {
'X-api-key': 'YOUR-API-KEY',
'X-username': 'YOUR-USERNAME',
'x-model-id': 'YOUR-MODEL-ID'
}
# Sample features for a insurance model
data = {
"features": {
"features": {
"age": 0,
"sex": "",
"bmi": 0,
"children": 0,
"smoker": "",
"region": "",
}
}
}
response = requests.post(url, headers=headers, json=data)