Overview

HTTP status codes

ABM uses following HTTP status codes.

Status code Usage

200 OK

The request was completed successfully.

201 Created

A new resource has been created successfully. The resource’s URI is available from the Location header response.

204 No Content

Existing resource has been deleted successfully

400 Bad Request

The request was defined incorrectly. The response body will include further explanations.

404 Not Found

The requested resource does not exist.

409 Conflict

Indicates that the request could not be processed due to the conflict in the request, such as creation of new resource with already existing id.

422 Unprocessable Entity

The request was well-formed but was unable to be followed due to semantic errors.

Scheme

REST API is availble through HTTPS protocol. All requests must be preceded with /api/v1 prefix. All responses have JSON format.

Autorization and authentication

Each requst must contain authorization header with acces token:
-H 'Authorization: Bearer <ACCES-TOKEN>'

Resources

Data

Import table from .csv file

A POST request is used to import .csv file.

Request structure

Body
Path Type Description

content

String

.csv file content (required)

fileName

String

file name (required)

tableName

String

table name (required)

csvSettings

Object

csv file settings (required)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/data?type=csv' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "content" : "var1,var2,target\\n1,2,1",
  "fileName" : "fileName.csv",
  "tableName" : "tableName1",
  "csvSettings" : {
    "columnSeparator" : ",",
    "decimalSeparator" : ".",
    "textSeparator" : "\\\"",
    "hasHeader" : "true",
    "encoding" : "UTF-8"
  }
}'

httpie:

$ echo '{
  "content" : "var1,var2,target\\n1,2,1",
  "fileName" : "fileName.csv",
  "tableName" : "tableName1",
  "csvSettings" : {
    "columnSeparator" : ",",
    "decimalSeparator" : ".",
    "textSeparator" : "\\\"",
    "hasHeader" : "true",
    "encoding" : "UTF-8"
  }
}' | http POST 'https://e-abm.pl/api/v1/data?type=csv' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Response status should be 200.

Example response

HTTP/1.1 200 OK

Import table from data base

A POST request is used to import file from data base.

Request structure

Body
Path Type Description

sourceTableName

String

name of source table (required)

tableName

String

table name in ABM data base (required)

host

String

data base host (required)

port

String

data base port (required)

catalog

String

data base catalog (depends on db type)

dbUser

String

user name (required)

dbPassword

String

password (required)

dbType

String

data base type (required)

dbName

String

data base name (depends on db type)

schema

String

data base scheme (depends on db type)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/data?type=db' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "sourceTableName" : "german_credit",
  "tableName" : "tableNameDb",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdbase",
  "dbName" : "",
  "schema" : ""
}'

httpie:

$ echo '{
  "sourceTableName" : "german_credit",
  "tableName" : "tableNameDb",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdbase",
  "dbName" : "",
  "schema" : ""
}' | http POST 'https://e-abm.pl/api/v1/data?type=db' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Response status should be 200.

Example response

HTTP/1.1 200 OK

Get list of imported tables

A GET request is used to get list of imported tables.

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/data' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/data' 'Accept:*/*'

Response structure

List with names of imported tables. Response status should be 200.

Example response

HTTP/1.1 200 OK

[ {
  "tableName" : "tableName1",
  "fileName" : "fileName.csv",
  "importDate" : "2016-10-02"
} ]

Delete table

A DELETE request is used to delete table.

Request structure

The request path contains following parameters:
./api/v1/data/{tableName}

Parameter Description

tableName

Name of table to delete

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/data/tableName1' -i -X DELETE -H 'Accept: */*'

httpie:

$ http DELETE 'https://e-abm.pl/api/v1/data/tableName1' 'Accept:*/*'

Response structure

Response status should be 200.

Example response

HTTP/1.1 200 OK

Export table to .csv file

A GET request is used to export table to .csv file.

Request structure

The request path contains following parameters:
./api/v1/data/{sourceTableName}

Parameter Description

sourceTableName

Name of source table

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/data/tableName1?type=csv' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/data/tableName1?type=csv' 'Accept:*/*'

Response structure

Response contains content of .csv file. Response status should be 200.

Export table to data base

A POST request is used to export table to data base.

Request structure

The request path contains following parameters:
./api/v1/data/{sourceTableName}

Parameter Description

sourceTableName

Name of source table

Body
Path Type Description

tableName

String

table name after export (required)

host

String

data base host (required)

port

String

data base port (required)

catalog

String

data base catalog (depends on db type)

dbUser

String

user name (required)

dbPassword

String

password (required)

dbType

String

data base type (required)

dbName

String

data base name (depends on db type)

schema

String

data base scheme (depends on db type)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/data/ABMKDDCupTable?type=db' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "tableName" : "ExportedKDDCupTable",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdBase",
  "dbName" : "",
  "schema" : ""
}'

httpie:

$ echo '{
  "tableName" : "ExportedKDDCupTable",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdBase",
  "dbName" : "",
  "schema" : ""
}' | http POST 'https://e-abm.pl/api/v1/data/ABMKDDCupTable?type=db' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Response status should be 200.

Example response

HTTP/1.1 200 OK

{
  "id" : 3,
  "database" : "ABMKDDCupTable",
  "filename" : "1_ABMKDDCupTable",
  "status" : "RUNNING",
  "errorMessage" : null,
  "confirmMessage" : false
}

Projects

Creating project

A POST request is used to create project.

Request structure

Body
Path Type Description

name

String

project name (required)

tableName

String

table name (required)

processType

String

Process type ('classification' or 'approximation') (required)

processParameters

Object

Object with process parameters (required)

processParameters object:
Parameter Presence Description

processMethod

required

Name of a process method. For approximation task "approximation". In case of classification: "quick","advanced" or "gold"

target

required

Name of target variable

positiveTargetValue

required for classification

Positive value of target variable (only for classification)

variableRoles

optional

List containing names, roles and types for each of variables

qualityMeasure

optional

Name of quality measure (for classification): "LIFT", "CAPTURED_RESPONSE", "PRECISION", "ACCURACY", "RECALL", "ROC_AREA", "COST". For approximation: "MAE", "MAPE", "RMSE", "R_SQUARED"

cutoff

optional

Value of percentile for which "LIFT" or "CAPTURED_RESPONSE" is optimized. (only for classification)

samplingMode

optional

Mode of sampling: "MANUAL", "AUTO_RRL"

samplingSize

optional

Size of sample

samplingStratificationMode

optional

Type of stratification sampling: "NONE", "CONST_RATIO", "CONST_NUM", "OVERSAMPLING". (only for classification)

samplingPositiveTargetCategoryRatio

optional

Expected ratio of positive target. (only for classification)

classificationThreshold

optional

Value of classification threshold. (only for classification)

classificationThresholdType

optional

Type of setting classification threshold: "MANUAL_PROBABILITY", "COST_MATRIX" or "AUTOMATIC". (only for classification)

profitMatrixOptimized

optional

Wheter values of cost matrix will be calculated automatically based on a-priori probability. (only for classification)

profitMatrixCurrency

optional

Currency for profit chart. (only for classification)

profitMatrixTruePositive

optional

Value of True Positive in profit matrix. (only for classification)

profitMatrixFalseNegative

optional

Value of False Negative in profit matrix. (only for classification)

profitMatrixFalsePositive

optional

Value of False Positive in profit matrix. (only for classification)

profitMatrixTrueNegative

optional

Value of True Negative in profit matrix. (only for classification)

useTestData

optional

If false only train and validation table are created, if true: train, validation and test table are created

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "name" : "project1",
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}'

httpie:

$ echo '{
  "name" : "project1",
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}' | http POST 'https://e-abm.pl/api/v1/projects' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Response status should be 201.

Example response

HTTP/1.1 201 Created

{
  "id" : 2,
  "name" : "project1",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}

Copying project

A POST request is used to copy project.

Request structure

The request path contains following parameters:

Parameter Description

sourceProjectId

Id of source project

Body
Path Type Description

projectName

String

Name of a new project

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects?source=1' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "projectName" : "project1Copied"
}'

httpie:

$ echo '{
  "projectName" : "project1Copied"
}' | http POST 'https://e-abm.pl/api/v1/projects?source=1' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Response status should be 201.

Example response

HTTP/1.1 201 Created

{
  "id" : 3,
  "name" : "project1Copied",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "gerr",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}

Change project settings

A PUT request is used to change project settings.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/parameters

Parameter Description

projectId

Project id

Body
Path Type Description

processMethod

String

Process method (required)

target

String

Name of target variable (required)

positiveTargetValue

String

Target positive value (only for classification) (required for classification)

variableRoles

Array

List with role for each variable (optional)

qualityMeasure

String

Name of quality measure (optional)

cutoff

Number

Value of percentile on which LIFT or CAPTURED_RESPONSE is optimized (optional)

samplingMode

String

Sampling mode (optional)

samplingSize

Number

Size of sample (optional)

samplingStratificationMode

String

Type of a sampling (only for classification) (optional)

samplingPositiveTargetCategoryRatio

Number

Expectation value for ratio of positive target (only for classification) (optional)

classificationThreshold

Number

Classification treshold (optional)

classificationThresholdType

String

Type of selection of classification treshold (optional)

profitMatrixOptimized

Boolean

Wheater values of cost matrix will be calculated automatically (optional)

profitMatrixCurrency

String

Currency for profit chart (only for classification) (optional)

profitMatrixTruePositive

Number

Value of True Positive (optional)

profitMatrixFalseNegative

Number

Value of False Negative (optional)

profitMatrixFalsePositive

Number

Value of False Positive (optional)

profitMatrixTrueNegative

Number

Value of True Negative (optional)

useTestData

Boolean

If false only train and validation table are created, if true: train, validation and test table are created (optional)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/parameters' -i -X PUT -H 'Accept: */*' -H 'Content-Type: text/plain; charset=ISO-8859-1' -d '{
  "processMethod" : "quick",
  "target" : "Class",
  "positiveTargetValue" : "good",
  "variableRoles" : [ {
    "name" : "var1",
    "role" : "ACTIVE",
    "type" : "NUMERICAL"
  }, {
    "name" : "var2",
    "role" : "ACTIVE",
    "type" : "CATEGORICAL"
  } ],
  "samplingSize" : 30000,
  "samplingStratificationMode" : "CONST_NUM",
  "samplingPositiveTargetCategoryRatio" : 0.5,
  "samplingMode" : "MANUAL",
  "classificationThreshold" : 0.5,
  "cutoff" : 0.1,
  "qualityMeasure" : "LIFT",
  "useTestData" : true,
  "classificationThresholdType" : "MANUAL PROBABILITY",
  "profitMatrixOptimized" : false,
  "profitMatrixCurrency" : "euro",
  "profitMatrixTruePositive" : 1,
  "profitMatrixFalseNegative" : 0,
  "profitMatrixFalsePositive" : 0,
  "profitMatrixTrueNegative" : 1
}'

httpie:

$ echo '{
  "processMethod" : "quick",
  "target" : "Class",
  "positiveTargetValue" : "good",
  "variableRoles" : [ {
    "name" : "var1",
    "role" : "ACTIVE",
    "type" : "NUMERICAL"
  }, {
    "name" : "var2",
    "role" : "ACTIVE",
    "type" : "CATEGORICAL"
  } ],
  "samplingSize" : 30000,
  "samplingStratificationMode" : "CONST_NUM",
  "samplingPositiveTargetCategoryRatio" : 0.5,
  "samplingMode" : "MANUAL",
  "classificationThreshold" : 0.5,
  "cutoff" : 0.1,
  "qualityMeasure" : "LIFT",
  "useTestData" : true,
  "classificationThresholdType" : "MANUAL PROBABILITY",
  "profitMatrixOptimized" : false,
  "profitMatrixCurrency" : "euro",
  "profitMatrixTruePositive" : 1,
  "profitMatrixFalseNegative" : 0,
  "profitMatrixFalsePositive" : 0,
  "profitMatrixTrueNegative" : 1
}' | http PUT 'https://e-abm.pl/api/v1/projects/1/parameters' 'Accept:*/*' 'Content-Type:text/plain; charset=ISO-8859-1'

Get list of all projects

A GET request is used to obtain list of projects.

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects' 'Accept:*/*'

Response structure

Response status should be 200.

Example response

HTTP/1.1 200 OK

[ {
  "id" : 3,
  "name" : "project1Copied",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "gerr",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}, {
  "id" : 2,
  "name" : "project1",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}, {
  "id" : 1,
  "name" : "6b10726ec1504f4ab8e8ac7a2ebc47f1",
  "creationDate" : "2016-10-02",
  "lastRun" : "2016-10-02",
  "tableName" : "gerr",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "ERROR",
  "errorMessage" : "biz.sc.gornik.common.g: Error during script execution\n\tat biz.sc.gornik.server.g.j.execute(j.java:234)\n\tat biz.sc.gornik.server.a.q.run(q.java:359)\n\tat biz.sc.gornik.server.a.i.run(i.java:85)\n\tat biz.sc.gornik.common.ab.run(ab.java:84)\nCaused by: /gornik/Server/config.current.xml:259: Java returned: 255\n\tat org.apache.tools.ant.taskdefs.Java.execute(Java.java:112)\n\tat org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)\n\tat sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:497)\n\tat org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)\n\tat org.apache.tools.ant.Task.perform(Task.java:348)\n\tat org.apache.tools.ant.Target.execute(Target.java:435)\n\tat org.apache.tools.ant.Target.performTasks(Target.java:456)\n\tat org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)\n\tat org.apache.tools.ant.Project.executeTarget(Project.java:1376)\n\tat biz.sc.gornik.server.g.wb.a(wb.java:176)\n\tat biz.sc.gornik.server.g.wb.run(wb.java:106)\n",
  "readOnly" : false
} ]

Starting and cancelling project

A PUT request is used to start/cancel project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/build

Parameter Description

projectId

Project id

Body
Path Type Description

action

String

Action to perform: 'start' or 'cancel' (required)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/build' -i -X PUT -H 'Accept: */*' -H 'Content-Type: text/plain; charset=ISO-8859-1' -d '{
  "action" : "start"
}'

httpie:

$ echo '{
  "action" : "start"
}' | http PUT 'https://e-abm.pl/api/v1/projects/1/build' 'Accept:*/*' 'Content-Type:text/plain; charset=ISO-8859-1'

Check build status of a project

A GET request is used to check build status of a project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/build

Parameter Description

projectId

Project id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/build' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects/1/build' 'Accept:*/*'

Response structure

Information about project status

Deleting project

A DELETE request is used to delete project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}

Parameter Description

projectId

Project id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1' -i -X DELETE -H 'Accept: */*'

httpie:

$ http DELETE 'https://e-abm.pl/api/v1/projects/1' 'Accept:*/*'

Scoring data with model

A PUT request is used for scoring data with model.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/score

Parameter Description

projectId

Project id

Body
Path Type Description

action

String

Action to perform: 'start' or 'cancel' (required)

inputTable

String

Name of table with data for scoring (required for 'start' option)

outputTable

String

Result table name with scored data (required for 'start' option)

copyColumnList

Array

List with names of variables to copy (required)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/score' -i -X PUT -H 'Accept: */*' -H 'Content-Type: text/plain; charset=ISO-8859-1' -d '{
  "action" : "start",
  "inputTable" : "KDDCupTable",
  "outputTable" : "scoringOutputTable",
  "copyColumnList" : [ "Class", "age" ]
}'

httpie:

$ echo '{
  "action" : "start",
  "inputTable" : "KDDCupTable",
  "outputTable" : "scoringOutputTable",
  "copyColumnList" : [ "Class", "age" ]
}' | http PUT 'https://e-abm.pl/api/v1/projects/1/score' 'Accept:*/*' 'Content-Type:text/plain; charset=ISO-8859-1'

Checking scoring status of a project

A GET request is used for checking status of scoring project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/score

Parameter Description

projectId

Project id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/score' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects/1/score' 'Accept:*/*'

Response structure

Information about scoring status

Getting list of modules in project

A GET request is used for getting list of modules in project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/modules

Parameter Description

projectId

Project id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/modules' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects/1/modules' 'Accept:*/*'

Response structure

List with names of modules for which result is available

Exporting statistics for all modules in project

A GET request is used for exporting statistics for all modules in project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/statistics

Parameter Description

projectId

Project id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/statistics' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects/1/statistics' 'Accept:*/*'

Response structure

List of statistics for all modules

Exporting statistics for selected module in project

A GET request is used for exporting statistics for selected module in project.

Request structure

The request path contains following parameters:
./api/v1/projects/{projectId}/statistics/{moduleName}

Parameter Description

projectId

Project id

moduleName

Name of module with statistics

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/statistics/modelStatistics' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects/1/statistics/modelStatistics' 'Accept:*/*'

Response structure

List of statistics for selected module

Exporting of scoring code in selected language

A GET request is used for exporting scoring code.

Request structure

The request path contains following parameters:

Parameter Description

projectId

Project id

dialect

Name of language for scoring code exporting: JAVA, SQL, SQL_MSSQL, SQL_TERADATA, SQL_ORACLE, SQL_POSTGRES

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/scoringCode?dialect=JAVA' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/projects/1/scoringCode?dialect=JAVA' 'Accept:*/*'

Models

Creating model in single request

A POST request is used for creating model in single request.

Request structure

Body
Path Type Description

inputData

Object

Input data for modelling (required)

responseURL

String

URL where result of modelling will be send (required)

scoringCodeDialect

String

Language for scoring code (required)

processType

String

Type of process: "classification" or "approximation" (required)

processParameters

Object

Object with process parameters (required)

inputData object:
Data from data base:
{
    "sourceTableName":"Name of table with data",
    "tableName":"Name of result table",
    "host":"Data base host",
    "port":"Data base port",
    "catalog":"Data base catalog",
    "dbUser":"Name of db user",
    "dbPassword":"password",
    "dbType":"data base type"
}
Data from .csv file:
{
    "content":"Content of .csv file",
    "fileName":"Name of file",
    "tableName":"Name of result table after importing data",
    "csvSettings": {
        "columnSeparator":",",
        "decimalSeparator":".",
        "textSeparator":"\"",
        "hasHeader": "true",
        "encoding":"UTF-8"
    }
}

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/models' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "inputData" : {
    "tableName" : "gerr",
    "content" : "\"checking_status\",\"duration\",\"credit_history\",\"purpose\",\"credit_amount\",\"savings_status\",\"employment\",\"installment_commitment\",\"personal_status\",\"other_parties\",\"residence_since\",\"property_magnitude\",\"age\",\"other_payment_plans\",\"housing\",\"existing_credits\",\"job\",\"num_dependents\",\"own_telephone\",\"foreign_worker\",\"Class\"\n\"less 0\",6,\"critical/other existing credit\",\"radio/tv\",1169,\"no known savings\",\"greater 7\",4,\"male single\",\"none\",4,\"real estate\",67,\"none\",\"own\",2,\"skilled\",1,\"yes\",\"yes\",\"good\"\n\"0 less X less 200\",48,\"existing paid\",\"radio/tv\",5951,\"less 100\",\"1 less X less 4\",2,\"female div/dep/mar\",\"none\",2,\"real estate\",22,\"none\",\"own\",1,\"skilled\",1,\"none\",\"yes\",\"bad\"\n\"no checking\",12,\"critical/other existing credit\",\"education\",2096,\"less 100\",\"4 less X less 7\",2,\"male single\",\"none\",3,\"real estate\",49,\"none\",\"own\",1,\"unskilled resident\",2,\"none\",\"yes\",\"good\"",
    "fileName" : "Mojplik",
    "csvSettings" : {
      "columnsSeparator" : ",",
      "decimalSeparator" : ".",
      "textSeparator" : "\"",
      "hasHeader" : "true",
      "encoding" : "UTF-8"
    }
  },
  "responseURL" : "https://e-abm.pl/api/v1/projects/test",
  "scoringCodeDialect" : "JAVA",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}'

httpie:

$ echo '{
  "inputData" : {
    "tableName" : "gerr",
    "content" : "\"checking_status\",\"duration\",\"credit_history\",\"purpose\",\"credit_amount\",\"savings_status\",\"employment\",\"installment_commitment\",\"personal_status\",\"other_parties\",\"residence_since\",\"property_magnitude\",\"age\",\"other_payment_plans\",\"housing\",\"existing_credits\",\"job\",\"num_dependents\",\"own_telephone\",\"foreign_worker\",\"Class\"\n\"less 0\",6,\"critical/other existing credit\",\"radio/tv\",1169,\"no known savings\",\"greater 7\",4,\"male single\",\"none\",4,\"real estate\",67,\"none\",\"own\",2,\"skilled\",1,\"yes\",\"yes\",\"good\"\n\"0 less X less 200\",48,\"existing paid\",\"radio/tv\",5951,\"less 100\",\"1 less X less 4\",2,\"female div/dep/mar\",\"none\",2,\"real estate\",22,\"none\",\"own\",1,\"skilled\",1,\"none\",\"yes\",\"bad\"\n\"no checking\",12,\"critical/other existing credit\",\"education\",2096,\"less 100\",\"4 less X less 7\",2,\"male single\",\"none\",3,\"real estate\",49,\"none\",\"own\",1,\"unskilled resident\",2,\"none\",\"yes\",\"good\"",
    "fileName" : "Mojplik",
    "csvSettings" : {
      "columnsSeparator" : ",",
      "decimalSeparator" : ".",
      "textSeparator" : "\"",
      "hasHeader" : "true",
      "encoding" : "UTF-8"
    }
  },
  "responseURL" : "https://e-abm.pl/api/v1/projects/test",
  "scoringCodeDialect" : "JAVA",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}' | http POST 'https://e-abm.pl/api/v1/models' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Id of the model

Getting model status

A GET request is used for getting model status.

Request structure

The request path contains following parameters:
./api/v1/models/{Id}/status

Parameter Description

Id

Model id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/models/1/status' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/models/1/status' 'Accept:*/*'

Response structure

Information about status of the model

Getting model result

A GET request is used for getting model result.

Request structure

The request path contains following parameters:
./api/v1/models/{Id}/result

Parameter Description

Id

Model id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/models/1/result' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/models/1/result' 'Accept:*/*'

Response structure

List with signature of the model and scoring code

Scoring

Deploying final model to scoring engine

A POST request is used for deploying final model in scoring engine.

Request structure

The request path contains following parameters:
./api/v1/projects/{modelId}/deploy

Parameter Description

modelId

Model id

Body
Path Type Description

overwriteIfExists

Boolean

If false: existing deployed model with the same id will not be overwrited (deafult: false) (required)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/projects/1/deploy' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "overwriteIfExists" : false
}'

httpie:

$ echo '{
  "overwriteIfExists" : false
}' | http POST 'https://e-abm.pl/api/v1/projects/1/deploy' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

Id of the model in scoring engine

Deleting model from scoring engine

A DELETE request is used for deleting model from scoring engine.

Request structure

The request path contains following parameters:
./api/v1/scoring/{modelId}

Parameter Description

modelId

Model id

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/scoring/1' -i -X DELETE -H 'Accept: */*'

httpie:

$ http DELETE 'https://e-abm.pl/api/v1/scoring/1' 'Accept:*/*'

Scoring data row

A POST request is used for scoring data row.

Request structure

The request path contains following parameters:
./api/v1/scoring/{modelId}/score

Parameter Description

modelId

Model id

Body
Path Type Description

dataRow

String

Data row for scoring (required)

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/scoring/1/score' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "dataRow" : "{ \"col1\": \"value1\", \"col2: \"value2\", \"col3\": \"value3\" }"
}'

httpie:

$ echo '{
  "dataRow" : "{ \"col1\": \"value1\", \"col2: \"value2\", \"col3\": \"value3\" }"
}' | http POST 'https://e-abm.pl/api/v1/scoring/1/score' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'

Response structure

List with model id, scoring time, predicted value of target and value of probability for positive target (only for classification)

Listing models in scoring engine

A GET request is used for listing models in scoring engine.

Example requests

curl:

$ curl 'https://e-abm.pl/api/v1/scoring' -i -H 'Accept: */*'

httpie:

$ http GET 'https://e-abm.pl/api/v1/scoring' 'Accept:*/*'

Response structure

List with names of models in scoring engine