Train the Model
/utility/train
In the request body, the contents of additional_data depend on the storage_type value:
- When storage_type is set to object_storage, the additional_data object must include the bucket and namespace fields.
- When storage_type is set to pvc, the additional_data object must include the path field set to the path of the metadata.json file.
Request
There are no request parameters for this operation.
- application/json
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
type
Specifies the input parameters for the request.
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
algorithm(required): array
algorithm
Specifies the list of algorithms to train.
-
sample(required): boolean
Indicates whether to apply sample preprocessing. Set this to true to use the default preprocessing script. Set this to false to use the sample script specified in the trainUtilityProcessor.preprocessScript key of your values.yaml file.
-
storage_details(required): array
storage_details
Provides the storage location and access details for the stored data.
array-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Algorithms-allOf[1]
Defines an algorithm and its training configuration.
object-
algo(required): string
Allowed Values:
[ "knn", "dnn", "cosine", "random_forest", "iso" ]Specifies the algorithm name. -
hyper_parameters: object
hyper_parameters
Additional Properties Allowed:
trueSpecifies hyperparameters to override the default values. Available parameters vary by algorithm. -
model_dir(required): string
Specifies the path to store the model files. This field accepts only alphanumeric and underscore (_) characters.
-
model_name(required): string
Specifies the name under which the model is stored.
objecttrue-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
StorageDetails-allOf[1]
Defines the queries to run and the join conditions used to combine them.
object-
output_file_type(required): string
Specifies the file type to use when storing the data: json, csv, or pickle.
-
path: string
Specifies the storage path where the data is saved.
-
storage_connection_details: array
storage_connection_details
Specifies the connection parameters for the storage location.
-
storage_type: string
Specifies the type of storage to use: pvc or object_storage.
array-
Array of:
object items
Additional Properties Allowed:
true
objecttrueResponse
200 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
TrainResponse-allOf[1]
Specifies the output returned by the operation.
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
status(required): string
Indicates the current status of the service.
400 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
401 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
403 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
404 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
405 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
409 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
500 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
501 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
503 Response
-
object
Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "CacheRequest":"#/components/schemas/CacheRequest", "FetchRequest":"#/components/schemas/FetchRequest", "CollectRequest":"#/components/schemas/CollectRequest", "QueryBuilder":"#/components/schemas/QueryBuilder", "QueryList":"#/components/schemas/QueryList", "JoinConditions":"#/components/schemas/JoinConditions", "StorageDetails":"#/components/schemas/StorageDetails", "CollectResponse":"#/components/schemas/CollectResponse", "FetchResponse":"#/components/schemas/FetchResponse", "CacheResponse":"#/components/schemas/CacheResponse", "Error":"#/components/schemas/Error" } }Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`. -
object
Error-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
objectDiscriminator Values
- CacheRequest
- FetchRequest
- CollectRequest
- QueryBuilder
- QueryList
- JoinConditions
- StorageDetails
- CollectResponse
- FetchResponse
- CacheResponse
- Error
-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
(uri)
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
(uri)
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
Examples
This example shows the cURL command for sending a Train the Model request:
curl -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_TOKEN" -H "Accept: application/json" -X POST -d @file.json 'http://hostname:port/utility/train'
where:
-
your_token is your client application's OAuth 2.0 access token.
-
file.json is the JSON file that specifies the details of the data to collect.
-
hostname is the host name for the application server.
-
port is the port for the application server.
Example of Request Body
Following is a sample request body.
{
"@type": "TrainRequest",
"algorithm": [
{
"@type": "Algorithms",
"algo": "knn",
"model_dir": "model/",
"model_name": "recommend_knn",
"hyper_parameters": {
"k_value": 5
}
},
{
"@type": "Algorithms",
"algo": "cosine",
"model_dir": "model/",
"model_name": "recommend_cosine",
"hyper_parameters": {
"k_value": 5
}
},
{
"@type": "Algorithms",
"algo": "dnn",
"model_dir": "model/",
"model_name": "dnn",
"hyper_parameters": {
"test_size": 0.2,
"epochs": 150,
"batch_size": 16,
"loss": "categorical_crossentropy",
"optimizer": "rmsprop",
"learning_rate": 0.001,
"final_activation": "softmax"
}
}
],
"sample": true,
"storage_details": [
{
"@type": "StorageDetails",
"storage_type": "object_storage",
"required_data": [
"account_data",
"balance_group_data",
"service_data",
"purchased_product_data",
"product_data",
"deal_data",
"plan_data",
"rate_data",
"event_data",
"deal_data_2",
"over_usage_data",
"usage_details"
],
"additional_details": {
"bucket": "sample-for-dataflow",
"namespace": "adcdefghijk"
}
}
]
}
Example of Response Body
If successful, the response code 200 is returned with a response body. For example:
[
{
"@type": "TrainResponse",
"status": "Training Complete"
}
]