Overview
HTTP status codes
ABM uses following HTTP status codes.
The request was completed successfully.
A new resource has been created successfully. The resource’s URI is available from the Location header response.
Existing resource has been deleted successfully
The request was defined incorrectly. The response body will include further explanations.
The requested resource does not exist.
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.
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
.csv file content (required)
csv file settings (required)
Example requests
curl:
Copy $ 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:
Copy $ 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
Import table from data base
A POST
request is used to import file from data base.
Request structure
Body
name of source table (required)
table name in ABM data base (required)
data base host (required)
data base port (required)
data base catalog (depends on db type)
data base type (required)
data base name (depends on db type)
data base scheme (depends on db type)
Example requests
curl:
Copy $ 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:
Copy $ 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
Get list of imported tables
A GET
request is used to get list of imported tables.
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/data' -i -H 'Accept: */*'
httpie:
Copy $ 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
Copy 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}
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/data/tableName1' -i -X DELETE -H 'Accept: */*'
httpie:
Copy $ http DELETE 'https://e-abm.pl/api/v1/data/tableName1' 'Accept:*/*'
Response structure
Response status should be 200
.
Example response
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}
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/data/tableName1?type=csv' -i -H 'Accept: */*'
httpie:
Copy $ 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}
Body
table name after export (required)
data base host (required)
data base port (required)
data base catalog (depends on db type)
data base type (required)
data base name (depends on db type)
data base scheme (depends on db type)
Example requests
curl:
Copy $ 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:
Copy $ 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
Copy 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
Process type ('classification' or 'approximation') (required)
Object with process parameters (required)
processParameters object:
Parameter
Presence
Description
Name of a process method. For approximation task "approximation". In case of classification: "quick","advanced" or "gold"
required for classification
Positive value of target variable (only for classification)
List containing names, roles and types for each of variables
Name of quality measure (for classification): "LIFT", "CAPTURED_RESPONSE", "PRECISION", "ACCURACY", "RECALL", "ROC_AREA", "COST". For approximation: "MAE", "MAPE", "RMSE", "R_SQUARED"
Value of percentile for which "LIFT" or "CAPTURED_RESPONSE" is optimized. (only for classification)
Mode of sampling: "MANUAL", "AUTO_RRL"
samplingStratificationMode
Type of stratification sampling: "NONE", "CONST_RATIO", "CONST_NUM", "OVERSAMPLING". (only for classification)
samplingPositiveTargetCategoryRatio
Expected ratio of positive target. (only for classification)
Value of classification threshold. (only for classification)
classificationThresholdType
Type of setting classification threshold: "MANUAL_PROBABILITY", "COST_MATRIX" or "AUTOMATIC". (only for classification)
Wheter values of cost matrix will be calculated automatically based on a-priori probability. (only for classification)
Currency for profit chart. (only for classification)
Value of True Positive in profit matrix. (only for classification)
profitMatrixFalseNegative
Value of False Negative in profit matrix. (only for classification)
profitMatrixFalsePositive
Value of False Positive in profit matrix. (only for classification)
Value of True Negative in profit matrix. (only for classification)
If false only train and validation table are created, if true: train, validation and test table are created
Example requests
curl:
Copy $ 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:
Copy $ 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
Copy 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:
Body
Example requests
curl:
Copy $ 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:
Copy $ 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
Copy 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
Body
Process method (required)
Name of target variable (required)
Target positive value (only for classification) (required for classification)
List with role for each variable (optional)
Name of quality measure (optional)
Value of percentile on which LIFT or CAPTURED_RESPONSE is optimized (optional)
Size of sample (optional)
samplingStratificationMode
Type of a sampling (only for classification) (optional)
samplingPositiveTargetCategoryRatio
Expectation value for ratio of positive target (only for classification) (optional)
Classification treshold (optional)
classificationThresholdType
Type of selection of classification treshold (optional)
Wheater values of cost matrix will be calculated automatically (optional)
Currency for profit chart (only for classification) (optional)
Value of True Positive (optional)
profitMatrixFalseNegative
Value of False Negative (optional)
profitMatrixFalsePositive
Value of False Positive (optional)
Value of True Negative (optional)
If false only train and validation table are created, if true: train, validation and test table are created (optional)
Example requests
curl:
Copy $ 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:
Copy $ 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:
Copy $ curl 'https://e-abm.pl/api/v1/projects' -i -H 'Accept: */*'
httpie:
Copy $ http GET 'https://e-abm.pl/api/v1/projects' 'Accept:*/*'
Response structure
Response status should be 200
.
Example response
Copy 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
Body
Action to perform: 'start' or 'cancel' (required)
Example requests
curl:
Copy $ 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:
Copy $ 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
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1/build' -i -H 'Accept: */*'
httpie:
Copy $ 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}
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1' -i -X DELETE -H 'Accept: */*'
httpie:
Copy $ 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
Body
Action to perform: 'start' or 'cancel' (required)
Name of table with data for scoring (required for 'start' option)
Result table name with scored data (required for 'start' option)
List with names of variables to copy (required)
Example requests
curl:
Copy $ 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:
Copy $ 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
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1/score' -i -H 'Accept: */*'
httpie:
Copy $ 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
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1/modules' -i -H 'Accept: */*'
httpie:
Copy $ 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
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1/statistics' -i -H 'Accept: */*'
httpie:
Copy $ 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}
Name of module with statistics
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1/statistics/modelStatistics' -i -H 'Accept: */*'
httpie:
Copy $ 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:
Name of language for scoring code exporting: JAVA, SQL, SQL_MSSQL, SQL_TERADATA, SQL_ORACLE, SQL_POSTGRES
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/projects/1/scoringCode?dialect=JAVA' -i -H 'Accept: */*'
httpie:
Copy $ 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
Input data for modelling (required)
URL where result of modelling will be send (required)
Language for scoring code (required)
Type of process: "classification" or "approximation" (required)
Object with process parameters (required)
inputData object:
Data from data base:
Copy {
"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:
Copy {
"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"
}
}
processParameters object: the same as for creating project
Example requests
curl:
Copy $ 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:
Copy $ 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
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/models/1/status' -i -H 'Accept: */*'
httpie:
Copy $ 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
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/models/1/result' -i -H 'Accept: */*'
httpie:
Copy $ 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
Body
If false: existing deployed model with the same id will not be overwrited (deafult: false) (required)
Example requests
curl:
Copy $ 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:
Copy $ 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}
Example requests
curl:
Copy $ curl 'https://e-abm.pl/api/v1/scoring/1' -i -X DELETE -H 'Accept: */*'
httpie:
Copy $ 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
Body
Data row for scoring (required)
Example requests
curl:
Copy $ 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:
Copy $ 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:
Copy $ curl 'https://e-abm.pl/api/v1/scoring' -i -H 'Accept: */*'
httpie:
Copy $ http GET 'https://e-abm.pl/api/v1/scoring' 'Accept:*/*'
Response structure
List with names of models in scoring engine