REST API

This is our Python Guide for ML development. See Tables. Below


Table 1. client()

Method Description
client.create_organization() This method is used to create organization for user.
client.update_name() This method is used to update user's first name and last name.
client.update_password() This method is used to update user password.



Table 2. pipeline()

Method Description
pipeline.create_pipeline() This method is used to create pipeline of provided user.
pipeline.create_alert() This method is used to create alert for given pipeline of user.
pipeline.create_table() This method is used to create table for given pipeline of user.
pipeline.delete_table() This method is used to delete table for given pipeline of user.
pipeline.get_table() This method is used to get tables of given pipeline of user.
pipeline.list_alerts() This method is used to get the list of alerts for given pipeline of user.
pipeline.set_default_table() This method is used to set default table for given pipeline of user.
pipeline.update_table() This method is used to update table name for given pipeline of user.



Table 3. data()

Method Description
data.delete_data() This method is used to delete dataset data for given range in pipeline of user.
data.download_csvs() This method is used to download dataset for given pipeline of user.
data.list_labels() This method is used to get labels for given pipeline of user.
data.set_labels() This method is used to set labels for given pipeline of user.
data.set_relations() This method is used to set relations between tables of given pipeline of user.
data.upload_data() This method is used to upload data for given pipeline of user.



Table 4. model()

Method Description
model.explain() This method is used to get explanability values of specific record for given pipeline of user with the model trained having timeseries off.
model.explain_timeseries() This method is used to get explanability values of specific record for given pipeline of user with the model trained having timeseries on.
model.explain_link() This method is used to get explanability values of of next link.
model.predict_time() This method is used to get prediction of table count.
model.predict_next_link() This method is used to get prediction of next link model.
model.train_mixed() This method is used to train model with timeseries off for given pipeline of user.
model.train_timeseries() This method is used to train model with timeseries on for given pipeline of user.
model.next_link() This method is used to create model next link type.
model.delete_model() This method is used to delete given model.
model.retrain_model() This method is used to retrain given model.


Our RESTAPI is one API call with one-to-one lineup with the Python API. The methods are values for the key "func" and the

Method

curl -X post https://dev-cloud-api.virtuousai.com/vai-toolkit

Payload:

https://dev-cloud-api.virtuousai.com/vai-toolkit




client


create_organization

Method Details :

This metod is used to create organization for user.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

Payload :

"functionName": "create_organization"

It is the function name to identify request.

"name": "ORGANIZATION_NAME"

It is the name of organization.

"users":  {  "EMAIL_TO_ASSIGN" :"ROLE_OF_THAT_USER" }

Password to provide which is to be use while login in platform.

Example's argument:

{ "functionName": "create_organization", "name": "ORGANIZATION_NAME", "users":{ "EMAIL_TO_ASSIGN" :"ROLE_OF_THAT_USER" } }

Output:

{
    "user": "61efccd707170700131a87c2",
    "name": "ORGANIZATION_NAME",
    "datasetS3TotalSize": 0,
    "isDeleted": false,
    "createdAt": "2023-07-19T05:34:13.391Z",
    "updatedAt": "2023-07-19T05:34:13.391Z",
    "_id": "64b775d5f0a90246a2a2c31a"
}

update_name

Method Details :

This method is used to update user's first name and last name.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

Payload :

"functionName": "update_name"

It is the function name to identify request.

"firstName": String

First name of the user to update.

"lastName":  String

Last name of the user to update.

Example's argument:

{ "functionName": "update_name", "firstName": "John", "lastName": "Deo" }

Output:

{
    "email": "john.deo@gmail.com",
    "_id": "61efccd707170700131a87c2",
    "firstName": "John",
    "lastName": "Deo",
}



update_password

Method Details :

This method is used to update user password.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

Payload :

"functionName": "update_password"

It is the function name to identify request.

"password":  "PASSWORD"

New password to the account.

Example's argument:

{ "functionName": "update_password", "password": "NEW_SECURE_PASSWORD" }

Output:

{
    "message": "Password changed successfully!.."
}







pipeline


create_pipeline

Method Details :

This method is used to create pipeline of provided user.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

Payload :

"functionName": "create_pipeline"

It is the function name to identify request.

"title":  "PIPELINE_NAME"

Name of pipeline to assign.

"type":  "TABULAR" or "GRAPH"

Type of the pipeline

Example's argument:

{ "functionName": "create_pipeline", "title": "PIPELINE_NAME", "type": "PIPELINE_TYPE" }

Output:

{
    "_id": "64b776fbf0a90246a2a2c3c0",
    "title": "PIPELINE_NAME",
    "apiKey": "62388816-b26e-4eff-bae7-1b361dccb194-1689745147818"
}



create_alert

Method Details :

This method is used to create alert of provided user and pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "create_alert"

It is the function name to identify request.

"name" : String

It is the name of alert to give.

"type" :"DATASET"

Type of alert.

"from" : Date

It is the from date, from which date alert is consider.

"to" : Date

It is the to date, to which date alert is consider.

"columnFields" :Array

It is the list of numeric column fields to which include in alert.

"week" : 2

It is the number of weeks, weeks of previous data to consider.

"thresholdLimit" : 49

It is limit value, if uploaded data cross the limit of provided thresholdLimit then send mail.

Example's argument:

{ "functionName": "create_alert", "data" : { "name":"ALERT_NAME", "type":"DATASET", "from": "1/1/2023", "to": "12/31/2023", "columnFields": ["race", "hours-per-week", "age"], "week": 2, "thresholdLimit": 49 } }

Output:

{
    "name": "ALERT_NAME",
    "type": "DATASET",
    "pipelineId": null,
    "modelId": null,
    "from": "1/1/2023",
    "to": "12/31/2023",
    "columnFields": [
        "race",
        "hours-per-week",
        "age"
    ],
    "week": 2,
    "thresholdLimit": 49,
    "timeWindow": {
        "window": null,
        "startTime": null,
        "endTime": null,
        "column": null,
        "dates": [],
        "times": [],
        "isHoliday": null,
        "holidays": [],
        "step": null
    },
    "createdAt": "2023-07-19T05:59:30.634Z",
    "updatedAt": "2023-07-19T05:59:30.634Z",
    "_id": "64b77bc26f7131868c0776a4"
}



create_table

Method Details :

This method is used to create table for given pipeline of user.

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "create_table"

It is the function name to identify request.

"name" :String

It is the name of table to give.

Example's argument:

{ "functionName": "create_table", "name": "TABLE NAME" }

Output:

    {
        'success': True,
        'table': {'name': 'Table Name','pipeline': 'Pipeline id', '_id': 'Table Id'}
    }



delete_table

Method Details :

This method is used to delete table for given pipeline of user.

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "delete_table"

It is the function name to identify request.

"name" :String

It is the name of table to delete.

Example's argument:

{ "functionName": "delete_table", "name": "TABLE NAME" }

Output:

    {
        "success":true, 
        "message": "Table deleted successfully."
    }



get_table

Method Details :

This method is used to get tables of given pipeline of user.

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "get_table"

It is the function name to identify request.

Example's argument:

{ "functionName": "get_table" }

Output:

    [
        {
            name : 'TABLE NAME',
            _id : 'Table id',
            pipeline : 'Pipeline id'
        },
        {
            name : 'TABLE NAME 2',
            _id : 'Table id',
            pipeline : 'Pipeline id'
        },
    ]



list_alerts

Method Details :

This method is used to get list of alerts provided user and pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "list_alerts"

It is the function name to identify request.

Example's argument:

{ "functionName": "list_alerts" }

Output

[
    {
        "name": "ALERT_NAME",
        "type": "DATASET",
        "pipelineId": null,
        "modelId": null,
        "from": "1/1/2023",
        "to": "12/31/2023",
        "columnFields": [
            "race",
            "hours-per-week",
            "age"
        ],
        "week": 2,
        "thresholdLimit": 49,
        "timeWindow": {
            "window": null,
            "startTime": null,
            "endTime": null,
            "column": null,
            "dates": [],
            "times": [],
            "isHoliday": null,
            "holidays": [],
            "step": null
        },
        "createdAt": "2023-07-19T05:59:30.634Z",
        "updatedAt": "2023-07-19T05:59:30.634Z",
        "_id": "64b77bc26f7131868c0776a4"
     }
]



set_default_table

Method Details :

This method is used to set default table for given pipeline of user.

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "set_default_table"

It is the function name to identify request.

"name" :String

It is the name of table to set as default.

Example's argument:

{ "functionName": "update_password", "name": "TABLE NAME" }

Output:

    {
        "success":true, 
        "message": "Default table successfully."
    }



update_table

Method Details :

This method is used to update table name for given pipeline of user.

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "update_table"

It is the function name to identify request.

"oldName": :String

It is the name of current name of table.

"newName":String

It is the new name of table to update.

Example's argument:

{ "functionName": "update_password", "oldName": "TABLE NAME", "newName": "NEW NAME" }

Output:

{
    "success":true, 
    "message": "Name updated successfully."
}






data


delete_data

Method Details :

This method is used to delete dataset data for given range in pipeline of user.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "delete_data"

It is the function name to identify request.

"from_date" : "09/05/2023"

It is from date value in 'MM-DD-YYYY' format.

"to_date" : "09/05/2023"

It is to date value in 'MM-DD-YYYY' format.

"table" : "TABLE_NAME"

It is name of table to delete data.

Example's argument:

{ "functionName": "delete_data", "from_date" : "09/05/2023", "to_date" : "09/05/2023", "table" : "TABLE_NAME" }

Output:

{
"message": "Deleted successfully!.."
}




download_csvs

Method Details :

This method is used to download dataset of provided user and pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "download_csvs"

It is the function name to identify request.

fromDate:  "DATE"

Date from which download consider.

toDate: "DATE"

Date to which download consider.

"table" : "TABLE_NAME"

It is name of table of you want to download data by defualt active table is selected.

Example's argument:

{ "functionName": "download_csvs", "fromDate": "07-07-2023", "toDate": "07-15-2023", "table": "TABLE NAME" }



list_labels

Method Details :

This method is used to get labels of provided pipeline and user.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "list_labels"

It is the function name to identify request.

"table" : "TABLE_NAME"

It is name of table of you want to see labels by defualt active table is selected.

Example's argument:

{ "functionName": "list_labels", "table":"TABLE NAME" }

Output:

{
  "success": true,
  "details": {
    "Table Name": "Table NAME",
    "Column Names": LIST OF COLUMN NAMES,
    "Column Types": LIST OF COLUMN TYPES,
    "Column Labels": LIST OF COLUMN LABELS
  }
}



set_labels

Method Details :

This method is used to set labels of provided user and pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "set_labels"

It is the function name to identify request.

"columnLabels" : { "ID" : "Input", "EDUCATION": "Protected", "LOAN-APPROVED": "Output"  }

It is dictionary containing the keys as the column of provided pipeline and values are Input, Protected and Output of that column as column label.

"columnTypes" : { "ID" : "NUMBER", "EDUCATION": "STRING", "LOAN-APPROVED": "CATEGORICAL" }

It is dictionary containing the keys as the column of provided pipeline and values are NUMBER, STRING, CATEGORICAL and TIME of that column as column type.

"table" : "TABLE_NAME"

It is name of table of you want to set labels by defualt active table is selected.

Example's argument:

{ "functionName": "set_labels", "columnLabels" : { "ID" : "Input", "EDUCATION": "Protected", "LOAN-APPROVED": "Output" }, "columnTypes" : { "ID" : "NUMBER", "EDUCATION": "STRING", "CAPITAL-GAIN": "CATEGORICAL" }, "table":"TABLE NAME" }

Output:

{
    'tableName': 'TABLE NAME',
    'columnLabels': [None, 'Output', None, None, 'Input', None, None, None, None],
    'columnNames': ['A1', 'DimItemkey', 'RestaurantCustomerName', 'PLU', 'ItemDescription', 'ItemSubcategory', 'ItemCategory', 'ItemReportingCategory', 'ItemFNBCategory'],
    'columnTypes': ['CATEGORY', 'CATEGORY', 'CATEGORY', 'CATEGORY', 'STRING', 'CATEGORY', 'CATEGORY', 'CATEGORY', 'CATEGORY']
    'pipeline': 'pipeline id',
    '_id': 'Table id'
}




set_relations

Method Details :

This method is used to set relations between tables of given pipeline of user.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "set_relations"

It is the function name to identify request.

"primaryKeys" :{ "dim_item": "PLU", "check": "CheckKey", "check_item": "CheckItemKey" }

It is an object where key represents the name of table, and it's value is considered as primary key column.

"toTable" : "TABLE_NAME"

It is the table name of which you want to set main table to bind other tables.

"relations" : [{"from": "dim_item","toColumn": "ItemNumber"} ]

It is an array consists of relation object, where object is { "from":"From table name", "toColumn": "Where column of to table want to bind"}.

Example's argument:

{ "functionName": "set_relations", "primaryKeys": { "dim_item": "PLU", "check": "CheckKey", "check_item": "CheckItemKey" }, "toTable": "check_item", "relations": [ { "from": "dim_item", "toColumn": "ItemNumber" }, { "from": "check", "toColumn": "CheckKey" } ] }

Output:

{
  "success": true,
  "messsage": "Updated successfully."
}




upload_data

Method Details :

This method is used to add data of provided user and pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "upload_data"

It is the function name to identify request.

"data": { "id" : [0, 1, 2, 3], "Capital Gain" : [10000, 20000, 30000, 40000]}

It is object containing keys as column names name values as list of values

"date": ["09-10-2023", "09-10-2023", "09-10-2023", "09-10-2023" ]

It is the list containing the list of date of the data

"time": ["11:08:50", "11:08:50", "11:08:50", "11:08:50" ]

It is the list containing the list of times of the data

allowNewColumns

It is the boolean value. If you want to allow new columns pass as true otherwise false

allowDuplicate

It is the boolean value. If you want to allow duplicate values then pass true otherwise false

allowNewCategory

It is the boolean value. If you want to allow new category pass as true otherwise false

"table" : "TABLE_NAME"

It is name of table of you want to upload data.

Example's argument:

{ "functionName": "upload_data", "data": { "id" : [0, 1, 2, 3], "Capital Gain" : [10000, 20000, 30000, 40000]}, "date":["09-10-2023", "09-10-2023", "09-10-2023", "09-10-2023" ], "time" : ["11:08:50", "11:08:50", "11:08:50", "11:08:50" ], "allowNewColumns" : true, "allowDuplicate" : true, "allowNewCategory" : true, "table" : "TABLE NAME" }

Output:

{
    "success": true,
    "data": "{\"dates\":[\"09-10-2023\"]}",
    "warning": "We insert the duplicate data if we found."
}



model


explain

Method Details :

This method is used to get explanability values of specific record for provided user pipeline with the model trained having timeseries off.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "explain"

It is the function name to identify request.

datasetData: Object

It is object containing keys as column names and values as it respective value of the row.

modelId: ObjectId

It is the model key which you want to get prediction.

dataset: Date

It is the dataset date which you want to get prediction.

Example's argument:

{ "functionName": "explain", "datasetData" : { "Capital Gain" : 100, "Loan Approved" : "true"}, "modelId" : "ID of MODEL", "dataset" : "07-15-2023" }

Output:

{
    "success": true,
    "output": {
        "loan-approved": {
            "inputs": {
                "age": [
                    0.056
                ],
                "capital-loss": [
                    0
                ],
                "education": [
                    -0.037
                ],
                "education-num": [
                    -0.008
                ],
                "hours-per-week": [
                    0.113
                ],
                "native-country": [
                    -0.006
                ],
                "occupation": [
                    -0.019
                ],
                "relationship": [
                    0.05
                ],
                "workclass": [
                    -0.011
                ]
            },
            "outputs": [
                0.138
            ]
        }
    },
    "payload": {
        "model": "dev/models/5e99761f522f057aeb4ed3c4/64412fa37a5a840c036a3fce/64a526df900b514e57881ef5_0.1_100_1000_1_17",
        "x": {
            "age": {
                "type": "NUMBER",
                "values": [
                    48
                ]
            },
            "capital-loss": {
                "type": "CATEGORY",
                "values": [
                    0
                ]
            },
            "hours-per-week": {
                "type": "NUMBER",
                "values": [
                    60
                ]
            },
            "workclass": {
                "type": "CATEGORY",
                "values": [
                    "Self-emp-not-inc"
                ]
            },
            "education": {
                "type": "CATEGORY",
                "values": [
                    "HS-grad"
                ]
            },
            "education-num": {
                "type": "CATEGORY",
                "values": [
                    9
                ]
            },
            "occupation": {
                "type": "CATEGORY",
                "values": [
                    "Craft-repair"
                ]
            },
            "relationship": {
                "type": "CATEGORY",
                "values": [
                    "Husband"
                ]
            },
            "native-country": {
                "type": "CATEGORY",
                "values": [
                    "England"
                ]
            }
        },
        "y": {
            "loan-approved": {
                "type": "CATEGORY"
            }
        },
        "file_paths": [
            "dev/dataset-files/5e99761f522f057aeb4ed3c4/64412fa37a5a840c036a3fce/64412fd67a5a840c036a40fd/04-14-2023.csv"
        ]
    },
    "response": {
        "StatusCode": 200,
        "ExecutedVersion": "$LATEST",
        "Payload": "{\"errorMessage\": \"\", \"traceback\": \"\", \"data\": {\"loan-approved\": {\"inputs\": {\"age\": [0.056], \"capital-loss\": [0.0], \"education\": [-0.037], \"education-num\": [-0.008], \"hours-per-week\": [0.113], \"native-country\": [-0.006], \"occupation\": [-0.019], \"relationship\": [0.05], \"workclass\": [-0.011]}, \"outputs\": [0.138]}}}"
    }
}



explain_timeseries

Method Details :

This method is used to get explanability values of specific record for provided user pipeline with the model trained having timeseries on.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "explain_timeseries"

It is the function name to identify request.

"panel": ObjectId

It is the object id of custom panel widget of which you want to get prediction.

"model": ObjectId

It is the model key which you want to get prediction.

"fromDate" :Date

It is the date of dataset in pipeline from which model will create.

"toDate" : Date

It is the date of dataset in pipeline to which model will create.

Example's argument:

{ "functionName": "explain_timeseries", "panel" : "PANEL_ID", "model" : "MODEL_ID", "fromDate" : "07-07-2023", "toDate" : "07-15-2023" }

Output:

{
    "data": {
        "errorMessage": "",
        "traceback": "",
        "data": {
            "y": [
                {
                    "date": "01-16-2022",
                    "counts": "[{\"tableCount\":22.3249225616,\"time\":11},{\"tableCount\":15.3308525085,\"time\":12},{\"tableCount\":6.0051803589,\"time\":13},{\"tableCount\":6.4271569252,\"time\":14},{\"tableCount\":3.3630287647,\"time\":15},{\"tableCount\":2.7648005486,\"time\":16},{\"tableCount\":5.4221305847,\"time\":17},{\"tableCount\":21.0307579041,\"time\":18},{\"tableCount\":17.9799308777,\"time\":19},{\"tableCount\":11.0987033844,\"time\":20},{\"tableCount\":7.7918105125,\"time\":21}]"
                },
                {
                    "date": "01-17-2022",
                    "counts": "[{\"tableCount\":4.3347301483,\"time\":11},{\"tableCount\":13.7139158249,\"time\":12},{\"tableCount\":22.5580196381,\"time\":13},{\"tableCount\":17.7829666138,\"time\":14},{\"tableCount\":10.4020938873,\"time\":15},{\"tableCount\":2.7406756878,\"time\":16},{\"tableCount\":4.4894299507,\"time\":17},{\"tableCount\":3.9393897057,\"time\":18},{\"tableCount\":2.5602560043,\"time\":19},{\"tableCount\":5.2975172997,\"time\":20},{\"tableCount\":24.4320220947,\"time\":21}]"
                },
                {
                    "date": "01-18-2022",
                    "counts": "[{\"tableCount\":25.5556297302,\"time\":11},{\"tableCount\":21.6066265106,\"time\":12},{\"tableCount\":16.9466266632,\"time\":13},{\"tableCount\":13.0571289062,\"time\":14},{\"tableCount\":22.881313324,\"time\":15},{\"tableCount\":34.0851211548,\"time\":16},{\"tableCount\":28.8900508881,\"time\":17},{\"tableCount\":23.1612758636,\"time\":18},{\"tableCount\":13.7236795425,\"time\":19},{\"tableCount\":12.1094703674,\"time\":20},{\"tableCount\":8.7841835022,\"time\":21}]"
                },
                {
                    "date": "01-19-2022",
                    "counts": "[{\"tableCount\":6.8754734993,\"time\":11},{\"tableCount\":9.8974742889,\"time\":12},{\"tableCount\":29.4479675293,\"time\":13},{\"tableCount\":33.2332077026,\"time\":14},{\"tableCount\":26.8839187622,\"time\":15},{\"tableCount\":22.5158405304,\"time\":16},{\"tableCount\":21.4588184357,\"time\":17},{\"tableCount\":31.3786964417,\"time\":18},{\"tableCount\":41.555103302,\"time\":19},{\"tableCount\":38.0847129822,\"time\":20},{\"tableCount\":33.7989006042,\"time\":21}]"
                },
                {
                    "date": "01-20-2022",
                    "counts": "[{\"tableCount\":21.2980632782,\"time\":11},{\"tableCount\":16.9026260376,\"time\":12},{\"tableCount\":9.3885774612,\"time\":13},{\"tableCount\":5.1352725029,\"time\":14},{\"tableCount\":8.3074045181,\"time\":15},{\"tableCount\":26.5341453552,\"time\":16},{\"tableCount\":32.1234817505,\"time\":17},{\"tableCount\":29.40417099,\"time\":18},{\"tableCount\":25.5267181396,\"time\":19},{\"tableCount\":18.9728393555,\"time\":20},{\"tableCount\":21.9795360565,\"time\":21}]"
                },
                {
                    "date": "01-21-2022",
                    "counts": "[{\"tableCount\":26.9185009003,\"time\":11},{\"tableCount\":23.7499847412,\"time\":12},{\"tableCount\":19.7978839874,\"time\":13},{\"tableCount\":10.8758878708,\"time\":14},{\"tableCount\":9.7679300308,\"time\":15},{\"tableCount\":4.2197132111,\"time\":16},{\"tableCount\":0.0849183798,\"time\":17},{\"tableCount\":2.3076190948,\"time\":18},{\"tableCount\":18.9048557281,\"time\":19},{\"tableCount\":22.7209529877,\"time\":20},{\"tableCount\":19.5034141541,\"time\":21}]"
                },
                {
                    "date": "01-22-2022",
                    "counts": "[{\"tableCount\":16.1986370087,\"time\":11},{\"tableCount\":9.5400733948,\"time\":12},{\"tableCount\":11.5875263214,\"time\":13},{\"tableCount\":16.3533973694,\"time\":14},{\"tableCount\":13.4710626602,\"time\":15},{\"tableCount\":9.5767259598,\"time\":16},{\"tableCount\":3.3179194927,\"time\":17},{\"tableCount\":6.832379818,\"time\":18},{\"tableCount\":5.7702031136,\"time\":19},{\"tableCount\":3.5545077324,\"time\":20},{\"tableCount\":4.9158325195,\"time\":21}]"
                }
            ],
            "x": "",
            "note": "predicting without explanation"
        }
    }
}



Method Details :

This method is used to get explanability values of of next link.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "explain_link"

It is the function name to identify request.

model: String

It is the object id of custom panel widget of which you want to get prediction.

config: Object

It is Object consts of seedNodeNameCol, prediction, seedNodeNames, refNodeDict keys.

Example's argument:

{ "functionName": "explain_link", "model": "MODEL KEY", "config": { "seedNodeNameCol": "ItemDescription", "prediction": 10, "seedNodeNames": [ "1", "2" ], "refNodeDict": { "GuestCount": 0, "CheckOpen": "2023-09-08T05:14:05.283Z" } } }



predict_time

Method Details :

This method is used to get prediction of table count.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "predict_time"

It is the function name to identify request.

panel: ObjectId

It is the object id of custom panel widget of which you want to get prediction.

model: String

It is the model key which you want to get prediction.

fromDate :Date

It is the date of dataset in pipeline from which model will create.

toDate : Date

It is the date of dataset in pipeline to which model will create.

Example's argument:

{ "functionName": "predict_time", "panel" : "PANEL_ID", "model" : "MODEL_ID", "fromDate" : "07-07-2023", "toDate" : "07-15-2023" }

Output:

{ "data": { "note": "shape is (output times, output names, input times ) which means (slider value 1-77, output dropdown which is only 1 this time ==tablecount,input times == 1 which I think we should just average)", "x": "", "y": [ { "counts": "[{\"tableCount\":24.3177656418,\"time\":22},{\"tableCount\":22.5132884603,\"time\":23}]", "date": "01-10-2022" } ] }, "errorMessage": "", "traceback": "" }



Method Details :

This method is used to get prediction of next link model.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "predict_next_link"

It is the function name to identify request.

model: String

It is the object id of custom panel widget of which you want to get prediction.

config: Object

It is Object consts of seedNodeNameCol, prediction, seedNodeNames, refNodeDict keys.

Example's argument:

{ "functionName": "predict_next_link", "model": "MODEL KEY", "config": { "seedNodeNameCol": "ItemDescription", "prediction": 10, "seedNodeNames": [ "1", "2" ], "refNodeDict": { "GuestCount": 0, "CheckOpen": "2023-09-08T05:14:05.283Z" } } }



train_mixed

Method Details :

This method is used to train model with timeseries off for provided user's pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "train_mixed"

It is the function name to identify request.

title  : "MODEL_NAME"

It is the name of model you want to give.

fromDate :Date

It is the date of dataset in pipeline from which model will create.

toDate : Date

It is the date of dataset in pipeline to which model will create.

"table" : "TABLE_NAME"

It is name of table of which you want to consider while creating model.

Example's argument:

{ "functionName": "train_mixed", "title" : "MODEL_NAME", "fromDate" :"07-07-2023", "toDate" : "07-15-2023", "table" : "Table name" }

Output:

{ 'status': 'In progress', 'model Id': 'MDOEL ID', 'apiKey': 'MODEL KEY' }



train_timeseries

Method Details :

This method is used to train model with timeseries on for provided user's pipeline.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "train_timeseries"

It is the function name to identify request.

title  : "MODEL_NAME"

It is the name of model you want to give.

fromDate :Date

It is the date of dataset in pipeline from which model will create.

toDate : Date

It is the date of dataset in pipeline to which model will create.

"table" : "TABLE_NAME"

It is name of table of which you want to consider while creating model.

Example's argument:

{ "functionName": "train_timeseries", "title" : "MODEL_NAME", "fromDate" :"07-07-2023", "toDate" : "07-15-2023", "table" : "Table name" }

Output:

{ 'status': 'In progress', 'model Id': 'MDOEL ID', 'apiKey': 'MODEL KEY' }

Method Details :

This method is used to create model next link type.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "next_link"

It is the function name to identify request.

title  : "MODEL_NAME"

It is the name of model you want to give.

settings :Oobject

It is object consist of dates, trainNodeType, dummyNodeType and seedNodeType keys.

Example's argument:

{ "functionName": "train_timeseries", "title" : "MODEL_NAME", "settings" : { "dates": { "dim_item": { "from": "01-01-2023", "to": "12-31-2023", "allDate": false }, "check": { "from": "01-01-2023", "to": "12-31-2023", "allDate": false }, "check_item": { "from": "01-01-2023", "to": "12-31-2023", "allDate": false } }, "trainNodeType": "check", "dummyNodeType": "check", "seedNodeType": "dim_item" } }

Output:

{ 'status': 'In progress', 'model Id': 'MDOEL ID', 'apiKey': 'MODEL KEY' }



delete_model

Method Details :

This method is used to create model next link type.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "delete_model"

It is the function name to identify request.

model  : "MODEL_KEY"

Model unique id to identify the pipeline in our platform.

Example's argument:

{ "functionName": "delete_model", "model" : 'MODEL_KEY' }

Output:

{ success : true, message : 'Model deleted successfully.' }



retrain_model

Method Details :

This method is used to retrain model same as from UI.

Header :

"user-secret": "USER_SECRET"

User unique id to identify the user in our platform.

"pipeline": "PIPELINE_KEY"

Pipeline unique id to identify the pipeline in our platform.

Payload :

"functionName": "retrain_model"

It is the function name to identify request.

model  : "MODEL_KEY"

Model unique id to identify the pipeline in our platform.

Example's argument:

{ "functionName": "retrain_model", "model" : 'MODEL_KEY' }

Output:

{ "success": true, "message": "Model retrained successfully", "title": "TITLE OF NEW TRAINED MODEL" }