Add Data CSV

import requests
url = "https://api.obviously.ai/v3/add-data/csv?file_name={file_name}&timeseries=false"
payload = {"csv_file": open('/path/to/file','rb')}
headers = {
    "Authorization": <api_key>
}
response = requests.post(url,files=payload, headers=headers)
print(response.text)

The endpoints allow you to upload dataset spreadsheet to your Obviously AI account. The response object consist of 2 ids:

  • process_id - process_id can be used in /add-data/status to fetch the most recent status on your uploaded file.
  • dataset_id - dataset_id is a unique identifier string for the uploaded dataset to your Obviously AI account. It will be used with /predict endpoints to train a model

In order to upload time series dataset, set timeseries = true in the url.

PREDICT CSV AUTOML

import requests

url = "https://api.obviously.ai/v3/predict/csv/automl"

payload = {

        "dataset_id": "<id of the uploaded dataset>",
        "identifier_column": "name of the identifier column>",
        "prediction_column": "<name of the prediction column>",         
        
        "config": {
        "remove_outliers": True,
        "auto_clean": True,
        "normalize": True,
        "auto_impute": False,
        "auto_sampling": True,
        "synthetic_smote": False
    }}
headers = {
    "Accept": "application/json",
    "Authorization": "ApiKey <your_api_key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Predict DB AutoML

import requests

url = "https://api.obviously.ai/v3/predict/db/automl"

payload = {

        "dataset_id": "<id of the uploaded dataset>",
              "table_name": "<name of the table in the dabase>"
        "identifier_column": "<name of the identifier column>",
        "prediction_column": "<name of the prediction column>",         

                "config": {
        "remove_outliers": True,
        "auto_clean": True,
        "normalize": True,
        "auto_impute": False,
        "auto_sampling": True,
        "synthetic_smote": False
    }}
headers = {
    "Accept": "application/json",
    "Authorization": "<your_api_key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Predict CSV timeseries

import requests

url = "https://api.obviously.ai/v3/predict/csv/timeseries"

payload = {
        "dataset_id": "<id of the uploaded dataset>",
        "date_column": "<name of the date column>",
        "prediction_column": "<name of the prediction column>",

                "config": {
        "frequency": "<frequency of the data-Hourly/Daily/Monthly/Weekly/Quarterly>",
        "aggregation": "<Sum/Average> ",
        "seasonality": <value of seasonal periods>
    }}
headers = {
    "Accept": "application/json",
    "Authorization": "ApiKey <your_api_key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Seasonality

Values

Hourly

24/168

Daily

7/30/365

Monthly

12

Weekly

52

Quarterly

4

Predict DB timeseries

import requests

url = "https://api.obviously.ai/v3/predict/db/timeseries"

payload = {

        "dataset_id": "<id of the uploaded dataset>",
        "date_column": "<name of the date column>",
        "prediction_column": "<name of the prediction column>",
                
        "config": {
        "frequency": "<frequency of the data-Hourly/Daily/Monthly/Weekly/Quarterly>",
        "aggregation": "<Sum/Average> ",
        "seasonality": <value of seasonal periods>
    }}
headers = {
    "Accept": "application/json",
    "Authorization": "ApiKey <your_api_key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)