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.

get
List allowed objectives and libraries

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.
Request
Response
Request
Headers
access-token
required
string
Active JWT token
Content-Type
required
string
Value: "application/json"
Response
200: OK
{
"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)

post
Create a Model

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.
Request
Response
Request
Path Parameters
project_id
required
string
Unique ID from the project where data must be stored
Headers
access-token
required
string
Active JWT token
Form Data Parameters
model_file
required
object
File containing the exported model
model_name_des
required
string
Unique name for the model
model_objective_des
required
string
Objective for the model. See previous endpoint for details.
model_prediction_type_des
required
string
Prediction type. See previous endpoint for details.
model_cutoff_num
optional
string
For binary classifiers, you can indicate a custom decision boundary. Default for binary models is 0.5.
model_summary_des
optional
string
Description for the model.
output_classes_des
optional
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"]
Response
201: Created
Successful project creation
{
"code": "success",
"http_code": 201,
"id": 1,
"message": "Resource created",
"model_id": "baea116d-ff6e-44ea-915a-ceac30f43e72"
}

get
List all Models

https://api.expai.io/api/projects/<project_id>/model/list
List all the models in your project
Request
Response
Request
Path Parameters
project_id
required
string
Unique ID from the project where you want to search
Headers
access-token
required
string
Active JWT token
Content-Type
required
string
Value: "application/json"
Response
200: OK
Example of a project list containing 1 element.
{
"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"
}
]
}

get
Search Models by name

https://api.expai.io/api/projects/<project_id>/model/list/contains/<text>
List all models in your project containing a string in their names
Request
Response
Request
Path Parameters
project_id
required
string
Unique ID from the project where you want to search
text
required
string
String to search Models by
Headers
access-token
required
string
Active JWT token
Content-Type
required
string
Value: "application/json"
Response
200: OK
Example of a project list containing 1 element.
{
"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"
}
]
}

patch
Update Model

https://api.expai.io/api/projects/<project_id>/model/<model_id>
Update some existing model in your project.
Request
Response
Request
Path Parameters
model_id
required
string
Unique ID from the model to be updated
project_id
required
string
Unique ID from the project where data must be stored
Headers
access-token
required
string
Active JWT token
Form Data Parameters
model_file
optional
object
File containing the new model
model_name_des
optional
string
Unique name for the model
model_objective_des
optional
string
Objective for the model. See previous endpoint for details.
model_prediction_type_des
optional
string
Prediction type. See previous endpoint for details.
model_cutoff_num
optional
string
For binary classifiers, you can indicate a custom decision boundary. Default for binary models is 0.5.
model_summary_des
optional
string
Description for the model.
output_classes_des
optional
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"]
Response
201: Created
Successful project creation
{
"code": "success",
"http_code": 204,
"message": "success"
}

delete
Delete Model

https://api.expai.io/api/projects/<project_id>/model/<model_id>
Delete a Model in a Project
Request
Response
Request
Path Parameters
project_id
required
string
Unique ID for the project containing the sample
model_id
required
string
Unique ID for the model to be deleted
Headers
access-token
required
string
Active JWT token
Response
204: No Content
Successful deletion
{
"code": "success",
"http_code": 204,
"message": "success"

get
List Model target classes

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.
Request
Response
Request
Path Parameters
model_id
required
string
Model ID to list classes
project_id
required
string
Unique ID for the project containing the sample
Headers
access_token
required
string
Valid access token
Response
200: OK