Model Making

These are the methods you use to make your models.

Machine Learning Model object

Attributes

Type

Description

model_name

string

The name of the model.

model_type

string

The model type.

description

string

The model description.

features

array

An array of strings with features.

source

string

What is used to query with. Described in the docs as target.

destination

string

The result of the query. Described in the docs as output_type.

training_status

string

A string with the training status. Possible values: CREATED, TRAINING, READY , FAILED , SUCCEEDED. Default is CREATED.

model_evaluations

array

List of objects with evaluations.

live

boolean

Default is False.

Create a Model

Parameters
Request
Response

Body Parameters

Type

Description

model_name

string

The name of the model.

model_type

string

The model type.

description

string

The model description.

features

array

An array of strings with features.

source

string

What is used to query with. Described in docs as target.

destination

string

The result of the query. Described in docs as output_type.

training_status

string

A string with the training status. Possible values: CREATED, TRAINING, READY , FAILED , SUCCEEDED. Default is CREATED.

model_evaluations

array

List of objects with evaluations.

live

boolean

Default is False

POST /ai/models HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
X-Builton-Api-Key: <builton-api-key>
Host: api.builton.dev
{
"model_type": "content_recommender",
"source": "user",
"destination": "product",
"features": ["tags"]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"destination": "product",
"version": 0,
"training_status": "CREATED",
"company": {
"$oid": "59ce1e0a9d3bde0006fa45a9"
},
"_id": {
"$oid": "5c936486cf923300090a0836"
},
"model_type": "content_recommender",
"created": {
"$date": 1553163398269
},
"source": "user",
"deleted": false,
"_cls": "DataScienceBaseModel.RecommendationModel.ContentRecommender",
"live": false,
"modified": {
"$date": 1553163398272
},
"model_evaluations": [],
"features": [
"tags"
],
"active": true
}

Train a Model

Parameters
Request
Response

Path Parameter

Type

Description

model_id

string

The ID of the model to train.

POST /ai/models/<model_id>/train HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
X-Builton-Api-Key: <builton-api-key>
Host: api.builton.dev
HTTP/1.1 200 OK
Content-Type: application/json
{
"destination": "product",
"version": 1,
"training_status": "TRAINING",
"company": {
"$oid": "59ce1e0a9d3bde0006fa45a9"
},
"_id": {
"$oid": "5c936486cf923300090a0836"
},
"model_type": "content_recommender",
"created": {
"$date": 1553163398269
},
"source": "user",
"deleted": false,
"_cls": "DataScienceBaseModel.RecommendationModel.ContentRecommender",
"live": false,
"modified": {
"$date": 1553163443587
},
"model_evaluations": [
{
"results": [],
"created": {
"$date": 1553163443587
},
"job_id": "a6494461-1fc4-4d9f-950f-75f694a2869a",
"version": 1
}
],
"features": [
"tags"
],
"active": true
}

Invoke a Model

Parameters
Request
Response

Path Parameter

Type

Description

model_id

string

The ID of the model to train.

GET /ai/models/<model-id>/invoke HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
X-Builton-Api-Key: <builton-api-key>
Host: api.builton.dev
{
"source": <source-id>
"size": <number-of-recommendations>
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"response": [
{
"object_type": "product",
"score": 0.0032608688,
"rank": 1,
"object": "5a04552ad57ba2056e2f2d78"
},
{
"object_type": "product",
"score": 0.0032608688,
"rank": 2,
"object": "5a045529d57ba2056e2f2d77"
},
{
"object_type": "product",
"score": 0.0032608688,
"rank": 3,
"object": "5a045528d57ba2056e2f2d76"
}
],
"company": {
"$oid": "59ce1e0a9d3bde0006fa45a9"
},
"_id": {
"$oid": "5c939d91cf9233000a96d9e7"
},
"ds_model": {
"$oid": "5c936486cf923300090a0836"
},
"created": {
"$date": 1553178001772
}
}

Retrieve a Model

Parameters
Request
Response

Path Parameter

Type

Description

model_id

string

The ID of the model to train.

GET /ai/models/<model-id> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
X-Builton-Api-Key: <builton-api-key>
Host: api.builton.dev
HTTP/1.1 200 OK
Content-Type: application/json
{
"destination": "product",
"version": 1,
"training_status": "SUCCEEDED",
"company": {
"$oid": "59ce1e0a9d3bde0006fa45a9"
},
"_id": {
"$oid": "5c936486cf923300090a0836"
},
"model_type": "content_recommender",
"created": {
"$date": 1553163398269
},
"source": "user",
"deleted": false,
"_cls": "DataScienceBaseModel.RecommendationModel.ContentRecommender",
"live": true,
"modified": {
"$date": 1553163834729
},
"model_evaluations": [
{
"results": [],
"created": {
"$date": 1553163443587
},
"job_id": "a6494461-1fc4-4d9f-950f-75f694a2869a",
"version": 1
}
],
"features": [
"tags"
],
"active": true
}