Models management

Endpoints to interact with your models. Since models are contained in projects, you will always need to indicate the project_id in which you want to operate.

List allowed objectives and libraries

GET https://api.expai.io/api/models/get_allowed

Retrieves the current allowed prediction objectives (e.g. classification or prediction) and model formats (e.g. Pickle or Tensorflow) allowed in EXPAI.

Headers

NameTypeDescription

access-token

string

Active JWT token

Content-Type

string

Value: "application/json"

{
    "code": "success",
    "http_code": 200,
    "message": "success",
    "models_library": [
        "pickle",
        "pytorch",
        "tensorflow"
    ],
    "models_objective": [
        "classification",
        "regression"
    ],
    "models_prediction": [
        "regression",
        "categorical",
        "binary"
    ]
}

Models objective and prediction can be combined as follows:

Model objective

Model Prediction

Regression

Regression

Classification

Categorical (>2 classes) or Binary (2 classes)

Create a Model

POST https://api.expai.io/api/projects/<project_id>/model/create

Load a file to create a model in an EXPAI project. Indicate metadata for the correct execution on our platform.

Path Parameters

NameTypeDescription

project_id

string

Unique ID from the project where data must be stored

Headers

NameTypeDescription

access-token

string

Active JWT token

Request Body

NameTypeDescription

model_file

object

File containing the exported model

model_name_des

string

Unique name for the model

model_objective_des

string

Objective for the model. See previous endpoint for details.

model_prediction_type_des

string

Prediction type. See previous endpoint for details.

model_cutoff_num

string

For binary classifiers, you can indicate a custom decision boundary. Default for binary models is 0.5.

model_summary_des

string

Description for the model.

output_classes_des

string

If model is a classifier, indicate the name for the output classes. If classification outputs 0 for "No" and 1 for "Yes", introduce ["No", "Yes"]

{
    "code": "success",
    "http_code": 201,
    "id": 1,
    "message": "Resource created",
    "model_id": "baea116d-ff6e-44ea-915a-ceac30f43e72"
}

List all Models

GET https://api.expai.io/api/projects/<project_id>/model/list

List all the models in your project

Path Parameters

NameTypeDescription

project_id

string

Unique ID from the project where you want to search

Headers

NameTypeDescription

access-token

string

Active JWT token

Content-Type

string

Value: "application/json"

{
    "code": "success",
    "http_code": 200,
    "message": "success",
    "models": [
        {
            "created_on_dt": "Fri, 26 Feb 2021 20:25:59 GMT",
            "model_cutoff_num": 0.7,
            "model_id": "8bdde1be-430a-4741-8006-673005ef0e04",
            "model_name_des": "regression model",
            "model_summary_des": "Car selling value prediction model",
            "model_objective_des": "regression",
            "modified_on_dt": "Fri, 26 Feb 2021 20:25:59 GMT",
            "output_classes_des": "First class, Second class",
            "project_id": "02a40a7e-6aaf-40d1-8032-da39f30a6135",
            "project_name_des": "My first project"
        }
    ]
}

Search Models by name

GET https://api.expai.io/api/projects/<project_id>/model/list/contains/<text>

List all models in your project containing a string in their names

Path Parameters

NameTypeDescription

project_id

string

Unique ID from the project where you want to search

text

string

String to search Models by

Headers

NameTypeDescription

access-token

string

Active JWT token

Content-Type

string

Value: "application/json"

{
    "code": "success",
    "http_code": 200,
    "message": "success",
    "models": [
        {
            "created_on_dt": "Fri, 26 Feb 2021 20:25:59 GMT",
            "model_cutoff_num": 0.7,
            "model_id": "8bdde1be-430a-4741-8006-673005ef0e04",
            "model_name_des": "regression model",
            "model_summary_des": "Car selling value prediction model",
            "model_objective_des": "regression",
            "modified_on_dt": "Fri, 26 Feb 2021 20:25:59 GMT",
            "output_classes_des": "First class, Second class",
            "project_id": "02a40a7e-6aaf-40d1-8032-da39f30a6135",
            "project_name_des": "My first project"
        }
    ]
}

Update Model

PATCH https://api.expai.io/api/projects/<project_id>/model/<model_id>

Update some existing model in your project.

Path Parameters

NameTypeDescription

model_id

string

Unique ID from the model to be updated

project_id

string

Unique ID from the project where data must be stored

Headers

NameTypeDescription

access-token

string

Active JWT token

Request Body

NameTypeDescription

model_file

object

File containing the new model

model_name_des

string

Unique name for the model

model_objective_des

string

Objective for the model. See previous endpoint for details.

model_prediction_type_des

string

Prediction type. See previous endpoint for details.

model_cutoff_num

string

For binary classifiers, you can indicate a custom decision boundary. Default for binary models is 0.5.

model_summary_des

string

Description for the model.

output_classes_des

string

If model is a classifier, indicate the name for the output classes. If classification outputs 0 for "No" and 1 for "Yes", introduce ["No", "Yes"]

{
    "code": "success",
    "http_code": 204,
    "message": "success"
}

Delete Model

DELETE https://api.expai.io/api/projects/<project_id>/model/<model_id>

Delete a Model in a Project

Path Parameters

NameTypeDescription

project_id

string

Unique ID for the project containing the sample

model_id

string

Unique ID for the model to be deleted

Headers

NameTypeDescription

access-token

string

Active JWT token

{
    "code": "success",
    "http_code": 204,
    "message": "success"

List Model target classes

GET https://api.expai.io/api/projects/<project_id>/model/<model_id>/get_target_classes

You can list the output classes for a model using this endpoint.

Path Parameters

NameTypeDescription

model_id

string

Model ID to list classes

project_id

string

Unique ID for the project containing the sample

Headers

NameTypeDescription

access_token

string

Valid access token

Last updated