SymetryML Documentation

Third Party Model Rest API

SymetryML allows you to build third party models. Currently only XGBoost models can be built. These models are different than SymetryML models in the following:

  • Third party models do not belong to a particular project. They belong to the user who creates them.
  • They are built using 2 data sources:
    • In Sample data source
    • Out of sample data source

Third Party Model Build

Build a new third party model for a given user.

URL

POST /symetry/rest/{cid}/tmodels/build [body=MLContext]

Query Parameters

ParameterRequired / OptionalDescription
modelidRequiredID to assign to the new model.
algoRequiredAlgorithm to use to build the model. Only xgb_model is supported for now.
isdfRequiredIn sample data source to be used to build the model.
oosdfRequiredOut of sample data source to be used to build the model.

MLContext Build Parameters

Many parameters can be passed to this methods depending on what type of XGBoost model one wants to build. See Sample Request for an example. Basically, XGBoost parameters are passed as extraParameters inside the MLContext data structure.

ParameterRequired/Optional?TypeDescription
missing_valOptionalFloatXGBoost missing value parameter.

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

Sample Request Response

The following is an example on how to set XGBoost parameters with the MLContext structure when building a xgboost model:

Request:
POST url="http://charm:8080/symetry/rest/c1/tmodels/build/modelid=xgbM1&modelType=xgb_model&isds=inputDS&oosds=oosDS

Body:
{"targets":[],"inputAttributes":[],"inputAttributeNames":["sepal_length","sepal_width","petal_length"],"targetAttributeNames":["petal_width"],"extraParameters":{"eta":"0.5","eval_metric":"rmse","max_depth":"4","objective":"reg:linear"}}

Third Party Model Prediction

URL

POST /symetry/rest/{cid}/tmodels/{modelid}/predict [body=DataFrame]

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.
500INTERNAL SERVER ERRORInvalid model ID. {"statusCode":"INTERNAL_SERVER_ERROR","statusString":"Generic Exception \u003cError no such model \u003cm3\u003e\u003e","values":{}}

HTTP Response Entity

HTTP Response EntityExample
KSVSMapContain information about the prediction.

Sample Request Response

Request:
POST url="http://charm:8080/symetry/rest/c1/tmodels/xgbmodel1/predict"

Body:
{"attributeNames":["petal_length","sepal_width"],"data":[["1.5","5"]],"attributeTypes":["C","C"]}

Third Party Model Information

URL

GET /symetry/rest/{cid}/tmodels/{modelid}/info

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

HTTP Response Entity

For information about the ModelInfo JSON data structure see the section ModelInfo.

HTTP Response EntityDescription
ModelInfoContains information about model.

Sample Request/Response

Request:
GET url="http://charm:8080/symetry/rest/c1/tmodels/xgbmodel1/info"

Response:
{"statusCode":"OK","statusString":"OK","values":{"modelInfo":{"modelId":"xgb-model1","modelType":"xgb_model","modelBuilt":1,"buildTime":7026012,"attributeNames":["sepal_length","sepal_width","petal_length"],"targetNames":["petal_width"],"info":{},"creationDate":1605813840224,"useShortDesc":false}}}

Delete a Third Party Model

Delete a particular model

URL

DELETE /symetry/rest/{cid}/tmodels/{modelid}

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess

List Third Party Model

List all third party models that belong to a user.

URL

GET /symetry/rest/{cid}/tmodels

HTTP Responses

HTTP Status CodeHTTP Status MessageDescription
200OKSuccess.

HTTP Response Entity

HTTP Response EntityExample
StringListSee bellow for more details

Sample Request/Response TModel Create

GET url="http://charm:8080/symetry/rest/c1/tmodels"

Response:
{"statusCode":"OK","statusString":"OK","values":{"stringList":{"values":["xgbmodel1","xgbmodel2"]}}}

On this page