Methods
# addSubheaders(subheaders, matrix) → {Array.<Array>}
Overview
Adds subheaders to the first row and column of a provided matrix.Parameters:
Name | Type | Description |
---|---|---|
subheaders |
Array.<string> | Array.<number> | Additional information added to first row and column of a matrix. |
matrix |
Array.<Array.<number>> | Data set that is going to have subheaders added to it. |
- The matrix with added subheaders.
# conjugateContent(number, base) → {string}
Overview
Conjugates a provided word based on a provided number.Parameters:
Name | Type | Description |
---|---|---|
number |
number | Used to conjugate word. |
base |
string | A word that will be conjugated. |
- Conjugated word.
# async downloadFunction(link)
Overview
Downloads data from provided link.Parameters:
Name | Type | Description |
---|---|---|
link |
string | URL | The link to download data from. |
AlertError
# async downloadMatrix(pathParams, queryParamsopt, baseopt)
Overview
UtilizesdownloadFunction
to download matrix from
/projects/{projectId}/misclassificationMatrix/download
where projectId
is the identifier of a selected project.
Usage
In order to download matrix from second fold from cross-validation specifyqueryParams
accordingly: { typeOfMatrix: crossValidationFold, foldIndex: 1 }
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object |
<optional> |
The query parameters in the URL of an API call. |
|
typeOfMatrix |
string |
<optional> |
The type of a matrix download. |
|
numberOfFold |
string |
<optional> |
The index of a fold from cross-validation. |
|
base |
string |
<optional> |
http://localhost:8080 | The host in the URL of an API call. |
# async downloadRules(pathParams, queryParams, baseopt)
Overview
UtilizesdownloadFunction
to download rules from /projects/{projectId}/rules/download
where projectId
is the identifier of a selected project.
Usage
In order to download rules in XML format specifyqueryParams
accordingly:
{ format: "xml" }
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object | The query parameters in the URL of an API call. |
||
format |
"txt" | "xml" | The format in which rules should be downloaded. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
InvalidPathParamsException
# estimateMatrixHeight(matrix, cellHeightopt) → {number}
Overview
Estimates the height of aVirtualizedMatrix
for given data.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
matrix |
Array.<Array> | A matrix that is going to be displayed in |
||
cellHeight |
number |
<optional> |
64 | Height of a cell from the matrix. |
An estimated height of a matrix.
# estimateMatrixWidth(matrix, cellWidthopt) → {number}
Overview
Estimates the width of aVirtualizedMatrix
for given data.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
matrix |
Array.<Array> | A matrix that is going to be displayed in |
||
cellWidth |
number |
<optional> |
64 | Width of a cell from the matrix. |
An estimated width of a matrix.
# estimateTableHeight(data, rowHeightopt) → {number}
Overview
Estimates height of theVirtualizedTable
for given data.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data |
Array | An array of objects that is going to be displayed in |
||
rowHeight |
number |
<optional> |
48 | Height of a row from the table. |
An estimated height of the table.
# async exportProject(pathParams, baseopt) → {Promise.<void>}
Overview
UtilizesdownloadFunction
to download project from /project/{projectId}/export
where projectId
is the identifier of a selected project.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
InvalidPathParamsException
# async fetchClassification(pathParams, method, body, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or PUT method and a specified body on/projects/{projectId}/classification
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve or calculate classification for a selected project.Example response
{
"objectNames": [
"Object 1",
"Object 2"
],
"externalData": false,
"Objects": [
{
"originalDecision": "medium",
"suggestedDecision": "medium",
"certainty": 1.0,
"numberOfCoveringRules": 2
},
{
"originalDecision": "medium",
"suggestedDecision": "medium",
"certainty": 1.0,
"numberOfCoveringRules": 3
}
],
"isCurrentData": true
"parameters": {
"classifierType": "SIMPLE_RULE_CLASSIFIER",
"defaultClassificationResultType": "MAJORITY_DECISION_CLASS"
}
}
Usage
In order to calculate with the following parameters:- classifier type - simple rule classifier
- default classification result type - majority decision class
FormData
object and append mentioned parameters to the body using append
method.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
method |
string | The HTTP method of an API call. |
||
body |
Object | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchConeObjects(pathParams, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/cones/{objectIndex}/{coneType}
where projectId
is the identifier of a selected project,
objectIndex
is the index of an object from information table
and coneType
is the type of a selected cone such as: positive, negative,
positive_inverted or negative_inverted.
Goal
The goal of this functions is to retrieve the indices of elements from a selected dominance cone.Example response
[
0,
2,
3,
5
]
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
objectIndex |
number | The index of a selected object from information table. |
||
coneType |
string | The type of a selected cone. |
||
base |
string |
<optional> |
http://localhost:8080 | The host in in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchCones(pathParams, method, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or POST on/project/{projectId}/cones
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve or calculate dominance cones for objects from specified project.Example response
{
"numberOfObjects": 2,
"objectNames": [
"Object 1",
"Object 2"
],
"isCurrentData": true,
"positiveDominanceCones": [
"Object 1"
],
"negativeDominanceCones": [
"Object 2"
],
"positiveInvertedDominanceCones": [
"Object 2"
],
"negativeInvertedDominanceCones": [
"Object 1"
]
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
method |
string | The HTTP method of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchCrossValidation(pathParams, method, body, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or PUT method and a specified body on/projects/{projectId}/crossValidation
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve or calculate cross-validation for a selected project.Example response
{
"isCurrentData": true,
"parameters": {
"typeOfUnions": "MONOTONIC",
"consistencyThreshold": 0.0,
"typeOfRules": "CERTAIN",
"classifierType": "SIMPLE_RULE_CLASSIFIER",
"defaultClassificationResultType": "MAJORITY_DECISION_CLASS",
"numberOfFolds": 10,
"seed": 0
}
}
Usage
In order to calculate cross-validation with the following parameters:- type of unions - monotonic
- consistency threshold - 0.0
- type of rules - certain
- classifier type - simple rule classifier
- default classification result type - majority decision class
- number of folds - 10
FormData
object and append mentioned parameters to the body using append
method.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
string | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
method |
string | The HTTP method of an API call. |
||
body |
Object | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
View Source Utils/utilFunctions/fetchFunctions/fetchCrossValidation/fetchCrossValidation.js, line 51
AlertError
InvalidPathParamsException
# async fetchData(pathParams, method, body, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or PUT method on/projects/{projectId}/data
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve or update information table from specified project.Examples
When method is set to GET
{
"attributes": [ ],
"objects": [ ]
}
When method is set to POST
{
"dominanceCones": {
"isCurrentData": true
},
"unions": {
"isCurrentData": true
},
"rules": {
"externalRules": false,
"isCurrentData": true
},
"classification": {
"externalData": false,
"isCurrentData": true
},
"crossValidation": {
"isCurrentData": true
}
}
Usage
In order to update information table, create aFormData
object and append
attributes and objects to the body using append
method
with keys metadata
and data
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
method |
string | The HTTP method of an API call. |
||
body |
FormData | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
# async fetchDescriptiveAttributes(resource, pathParams, queryParams, method, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or POST method on/projects/{projectId}/{resource}/descriptiveAttributes
where projectId
is the identifier of a selected project
and resource
is the name of a selected resource such as:
cones, unions, rules, classification, classification/rules and crossValidation.
Goal
The goal of this function is to retrieve the name of descriptive attributes from information table or change default visible object name which is the value of a descriptive attribute for a certain object.Example response
{
"available": [
"Name",
"LastName"
],
"actual": null
}
Usage
In order to set default object names to represent values of an attribute "Name" specifyqueryParams
accordingly: { objectVisibleName: "Name" }
and set method to POST.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resource |
string | The name of a selected resource. |
||
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object | The query parameters in the URL of an API call. |
||
objectVisibleName |
string |
<optional> |
The new type of a name that will be used to describe objects. |
|
method |
string | The HTTP method of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchFold(pathParams, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/crossValidation/{foldIndex}
where projectId
is the identifier of a selected project
and foldIndex
is the index of a selected fold from cross-validation.
Goal
The goal of this function is to retrieve the content of a selected fold from cross-validation.Example response
{
"objectNames": [
"Object 1",
"Object 2"
],
"numberOfTrainingObjects": 2,
"numberOfRules": 1,
"objects": [
{
"originalDecision": "bad",
"suggestedDecision": "bad",
"certainty": 1.0,
"numberOfCoveringRules": 1
},
{
"originalDecision": "bad",
"suggestedDecision": "bad",
"certainty": 1.0,
"numberOfCoveringRules": 1
}
]
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
foldIndex |
number | The index of a selected fold from cross-validation |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
# async fetchMatrix(resource, pathParams, queryParamsopt, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/classification/misclassificationMatrix
or /projects/{projectId}/crossValidation/{foldIndex}/misclassificationMatrix
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve information about misclassification matrix from a selected project.Example response
{
"decisionsDomain": [
"bad",
"medium",
"good"
],
"traits": {
"Accuracy": 0.9476492164054684,
"Deviation of accuracy": 0.012053299287963505,
"mae": 0.052350783594531505,
"rmse": 0.22880293615802116,
"gmean": 0.7313837893935226,
"Number of correct assignments": 284.2,
"Deviation of number of correct assignments": 3.6147844564602556,
"Number of incorrect assignments": 15.7,
"Deviation of number of incorrect assignments": 4.854551129266914,
"Number of objects with assigned decision": 299.90000000000003,
"Deviation of number objects with assigned decision": 2.8460498941515415,
"Number of unknown original decisions": 0.0,
"Deviation of number of unknown original decisions": 0.0,
"Number of unknown assignments": 0.0,
"Deviation of number of unknown assignments": 0.0,
"Number of unknown assigned decisions for unknown original decisions": 0.0,
"Deviation of number of unknown assigned decisions for unknown original decisions": 0.0
},
"value": [
[101.60000000000001, 1.4000000000000001, 0]
[0, 173.20000000000002, 0],
[0, 14.3, 9.399999999999999]
],
"Deviation of value": [
[1.1737877907772674, 1.1737877907772674, 0],
[0, 0.6324555320336759, 0],
[0, 4.738729318662921, 3.5023801430836525]
]
}
Usage
In order to retrieve matrix from second fold from cross-validation specifyqueryParams
accordingly: { typeOfMatrix: crossValidationFold, foldIndex: 1 }
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resource |
string | The name of a selected resource. |
||
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object |
<optional> |
The query parameters in the URL of an API call. |
|
typeOfMatrix |
string | The type of a matrix to fetch. |
||
numberOfFold |
string |
<optional> |
The index of a selected fold. |
|
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchObject(resource, pathParams, queryParams, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/{resource}/object
where projectId
is the identifier of a selected project
and resource
is the name of a selected resource such as:
cones, unions, rules, classification, classification/rules or crossValidation.
Goal
The goal of this function is to retrieve an object with a specified index from the information table.Example
WhenisAttributes
is set to true
{
"value": { },
"attributes": [ ]
}
Usage
In order to retrieve information about object with index 0 and receive attributes as well specifyqueryParams
accordingly: { objectIndex: 0, isAttributes: true }
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resource |
string | The name of a selected resource. |
||
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object | The query parameters in the URL of an API call. |
||
objectIndex |
string | The index of a selected object from information table. |
||
isAttributes |
boolean | If |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchObjectNames(resource, pathParams, queryParamsopt, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/project/{projectId}/{resource}/objectNames
where projectId
is the identifier of a selected project
and resource
is the name of a selected resource such as:
cones, unions, rules, classification, classification/rules or crossValidation.
Goal
The goal of this functions is to retrieve visible object names.Example
[
"Object 1",
"Object 2"
]
Usage
In order to retrieve object names for the upper approximation of an union with index 0 specifyqueryParams
accordingly: { subject: 0, set: "upperApproximation" }
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resource |
string | The name of a selected resource. |
||
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object |
<optional> |
The query parameters in the URL of an API call. |
|
subject |
number |
<optional> |
The index of a subject that contains object names. |
|
set |
string |
<optional> |
The name of the set that narrows down object names. |
|
base |
string |
<optional> |
http://localhost:8080 | The host in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchProject(pathParams, method, body, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET, PATCH or DELETE method and specified body on/projects/{projectId}
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve concise information about project, change it's name or delete it.Examples
When method is set to PATCH
{
"id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
"name": "students"
}
When method is set to GET
{
"dominanceCones": {
"isCurrentData": true
},
"unions": {
"isCurrentData": true
},
"rules": {
"externalRules": false,
"isCurrentData": true
},
"classification": {
"externalData": false,
"isCurrentData": true
},
"crossValidation": {
"isCurrentData": true
}
}
Usage
In order to change project's name to "students 2", create aFormData
object
and append your name with name
key.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
method |
string | The HTTP method of an API call. |
||
body |
FormData | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchProjectDetails(pathParams, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/details
.
Goal
The goal of this functions is to retrieve concise details about selected project.Example response
{
"metadataFileName": "students_metadata.json",
"dataFileName": "students_data.csv",
"rulesFileName": "students_rules.xml",
"externalDataFileName": "students_2_data.csv"
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the url of an API call. |
AlertError
InvalidPathParamsException
# async fetchProjects(method, body, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or POST method and specified body on/projects
Goal
The goal of this functions is to retrieve all project from server or create another one.Examples
When method is set to GET
[
{
"id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
"name": "students"
},
{
"id": "bcde2e1c-e76a-433b-862d-469e5bf16a93",
"name": "students 2"
}
]
When method is set to POST
{
"id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
"name": "students"
}
Usage
In order to create project with three files: metadata, data and rules, createFormData
object and append mentioned files to the object using append
method.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
method |
string | The HTTP method of an API call. |
||
body |
FormData | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchRule(resource, pathParams, baseopt, isCoveringObjectsopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/{resource}/{ruleIndex}
where projectId
is the identifier of a selected project,
ruleIndex
is the index of a selected rule
and resource
is the name of a selected resource such as:
rules, classification or cross-validation/{foldIndex}.
Goal
The goal of this functions is to retrieve information about selected rule from specified project.Examples
When resource equals to rules and classification or cross-validation/{foldIndex} but withisCoveringObjects
set to true
{
"objectNames": [
"Object 1"
"Object 2"
],
"indicesOfCoveredObjects": [
0,
1
],
"isSupportingObject": [
true,
true
]
}
When resource equals to classification or cross-validation
{
"ruleCharacteristics": { },
"rule": { }
}
Usage
IfisCoveringObjects
is set to true
function will perform an API call on
/projects/{projectId}/{resource}/{ruleIndex}/coveringObjects
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resource |
string | The name of a selected resource. |
||
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
ruleIndex |
string | The index of a selected rule. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
isCoveringObjects |
boolean |
<optional> |
false | If |
AlertError
InvalidPathParamsException
# async fetchRules(pathParams, method, body, baseopt, uploadopt) → {Promise.<Object>}
Overview
Performs an API call with GET or PUT method and specified body on/projects/{projectId}/rules
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve, upload or calculate decision rules from a selected project.Example response
{
"externalRules": false,
"validityRulesContainer": {
"unions": {
"isCurrentData": true
},
"classification": {
"externalData": false,
"isCurrentData": true
}
},
"Rules": [
{
"ruleCharacteristics": { },
"rule": { }
},
{
"ruleCharacteristics": { },
"rule": { }
}
],
"parameters": {
"typeOfUnions": "MONOTONIC",
"consistencyThreshold": 0.0,
"typeOfRules": "CERTAIN"
},
"isCurrentData": true
}
Usage
In order to calculate rules with the following parameters:- type of unions - monotonic
- consistency threshold - 0.0
- type of rules - certain
FormData
object and append mentioned parameters to the body using append
method.
In order to upload rules create a
FormData
object
and append selected file with rules
key.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
method |
string | The HTTP method of an API call. |
||
body |
FormData | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
upload |
boolean |
<optional> |
false | If |
AlertError
InvalidPathParamsException
# async fetchUnion(pathParams, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method on/projects/{projectId}/unions/{unionIndex}
or /projects/{projectId}/unions/{unionIndex}/{arrayPropertyType}
where projectId
is the identifier of a selected project,
unionIndex
is the index of a selected union
and arrayPropertyType
is the name of a selected union's property such as:
objects, upperApproximation or lowerApproximation.
Goal
The goal of this function is to retrieve properties that belong to a specified union or elements from a selected union's property.Example response
When fetching union:
{
"Objects": 237,
"Lower approximation": 78,
"Upper approximation": 251,
"Boundary": 173,
"Positive region": 78,
"Negative region": 2753,
"Boundary region": 168
}
When fetching union's property:
{
"objectNames": [
"Object 1",
"Object 2"
],
"value": [
0,
1
]
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
unionIndex |
number | The index of a selected union. |
||
arrayPropertyType |
string |
<optional> |
The name of a selected union property. |
|
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# async fetchUnions(pathParams, queryParams, method, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET or PUT method on/projects/{projectId}/unions
where projectId
is the identifier of a selected project.
Goal
The goal of this function is to retrieve or calculate class unions for a selected project.Example response
{
"qualityOfApproximation": 1,
"Unions": [
{
"unionType": "AT_MOST",
"limitingDecision": "good",
"accuracyOfApproximation": 1,
"qualityOfApproximation": 1
}
],
"isCurrentData": true,
"parameters": {
"typeOfUnions": MONOTONIC,
"consistencyThreshold": 0.0
}
}
Usage
In order to calculate monotonic class unions with consistency threshold equal to 0.3 specifyqueryParams
accordingly: { typeOfUnions: "monotonic", consistencyThreshold: 0.3 }
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pathParams |
Object | The path parameters in the URL of an API call. |
||
projectId |
string | The identifier of a selected project. |
||
queryParams |
Object | The query parameters in the URL of an API call. |
||
typeOfUnions |
string |
<optional> |
The value of the type of unions from |
|
consistencyThreshold |
number |
<optional> |
The value of consistency threshold from |
|
method |
"GET" | "PUT" | The HTTP method of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
AlertError
InvalidPathParamsException
# filterFunction(filterText, items) → {Array.<Object>}
Overview
Looks for at least one match in filter features. When filterText contains more than one word, all of them have to be found in at least one filter feature.Parameters:
Name | Type | Description |
---|---|---|
filterText |
string | Input from |
items |
Array.<Object> | The list of items from |
- Filtered list of items.
# getAppropriateColor(attribute) → {Object}
Overview
Returns appropriate styling for given attribute.Parameters:
Name | Type | Description |
---|---|---|
attribute |
Object | An attribute from information table. |
- Style object with background colour and colour.
# getAppropriateSign(object1, object2, attribute, tableIndex) → {string}
Overview
Returns appropriate relation symbol to compare values of attributes from two objects.Parameters:
Name | Type | Description |
---|---|---|
object1 |
Object | The selected object with it's details displayed in |
object2 |
Object | An object from information table. |
attribute |
Object | An attribute from information table. |
tableIndex |
number | The index of dominance cone. |
- Relation symbol.
# getFixed(value) → {string|number}
Overview
Formats number using either a fixed-point notation or an exponential notation. The exponential notation is used if there are three or more zero digits after decimal point and before a non-zero digit. Otherwise, a fixed-point notation is used.If a provided value is an integer, formatting is omitted.
Used in
parseRulesListItems
to prepare rule characteristic to be displayed in ResultList
.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | number | A number that will be formatted accordingly. |
- A formatted number.
# getItemName(index, names, defaultNameopt) → {Object}
Overview
Generates name for items displayed inCones
, Classification
and CrossValidation
.
Function takes user preferences into account. If an 'indexOption' property from project settings is equal to one of
description or identification attributes, a value associated with this attribute will be used as a name.
Used to generate name for
parseConesItems
, parseClassifiedItems
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
index |
number | The index of an object in information table. |
||
names |
Array | The array of object names received from server. |
||
defaultName |
string |
<optional> |
"Object" | The default object name. |
- An item's name as an object.
# getRelationSign(relationSymbol) → {string}
Overview
Returns a unicode for a provided relation symbol.Parameters:
Name | Type | Description |
---|---|---|
relationSymbol |
string | A relation symbol as a simple string. |
- A relation in unicode.
# getRuleName(rule) → {Object}
Overview
Generates name for rules. UsesparseDecisions
and parseDecisions
to obtain decisions and conditions.
Parameters:
Name | Type | Description |
---|---|---|
rule |
Object | A single rule from a rule set. |
- Generated name for provided rule.
# getTitleConditions(conditions) → {Array.<Object>}
Overview
Wraps conditions in round brackets when necessary. Joins conditions with logic AND.Parameters:
Name | Type | Description |
---|---|---|
conditions |
Array.<Object> | The condition's part of a rule. |
- The condition's part of a rule prepared to be displayed in a title.
# getTitleDecisions(decisions) → {Array.<Array.<Object>>}
Overview
Wraps decisions in round brackets then adds square brackets when necessary. Joins decisions with logic AND then with logic OR.Parameters:
Name | Type | Description |
---|---|---|
decisions |
Array.<Array.<Object>> | The decision's part of a rule. |
- The decision's part of a rule prepared to be displayed in a title.
# async handleNotOk(response) → {Promise.<Object>}
Overview
Determines the severity of a thrownAlertError
.
4** - corresponds to 'error' severity,
5** - corresponds to 'warning' severity,
any other will be marked as 'info'.
Parameters:
Name | Type | Description |
---|---|---|
response |
Object | A response from server with status different than 2**. |
AlertError
# hexToRgb(hex, opacity) → {string}
Overview
Converts color in HEX to RGB and adds opacity.Parameters:
Name | Type | Description |
---|---|---|
hex |
string | Colour in HEX that will be converted to RGB. |
opacity |
number | Opacity of a colour that will be added to RGB. |
- Colour in RGB.
# async importProject(body, baseopt) → {Promise.<Object>}
Overview
Performs an API call with GET method and specified body on/projects/import
.
Goal
The goal of this function is to import project from ZIP file.Example response
{
"id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
"name": "students"
}
Usage
In order to import project from ZIP file, createFormData
object
and append mentioned file with importFile
key.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
body |
FormData | The body in the message of an API call. |
||
base |
string |
<optional> |
http://localhost:8080 | The host and port in the URL of an API call. |
# mergeClasses(c1, c2) → {Object}
Overview
Merges two classes objects. Classes object looks something like this:{key-name: "name-of-css_class"}
.
For more information check out Material-UI docs on overriding styles with classes .
Parameters:
Name | Type | Description |
---|---|---|
c1 |
Object | Base classes object. Some values may be overwritten. |
c2 |
Object | Classes object that will be merged into base classes object. |
- Merged classes object.
# nonNullProperty(object, propertyName) → {boolean}
Overview
Checks whether object exists, has it's own property from second argument and that property has a defined value.Parameters:
Name | Type | Description |
---|---|---|
object |
Object | Any javascript object. |
propertyName |
string | The property name as string. |
- If
true
the object has a non null property.
# parseClassificationParams(result) → {Object}
Overview
Retrieves parameters used to perform classification from server response.Parameters:
Name | Type | Description |
---|---|---|
result |
Object | Server response. |
- Retrieved parameters.
# parseClassifiedItems(objects, names) → {Array.<Object>}
Overview
Converts server response to an array of items. Single item can be displayed inClassifiedObjectDialog
.
Uses getItemName
as well as 'settings' to obtain special name for an item.
Parameters:
Name | Type | Description |
---|---|---|
objects |
Array | The array of classified objects received from server. |
names |
Array | The array of object names received from server. |
- The array of items.
# parseClassifiedListItems(items) → {Array.<Object>}
Overview
Converts items to list items that will be displayed inResultList
.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<Object> | An array of items prepared by |
- An array of list items displayed in
ResultList
.
# parseConditions(conditions) → {Array.<Array.<Object>>}
Overview
Converts conditions from server response to conditions used in a rule name.Parameters:
Name | Type | Description |
---|---|---|
conditions |
Array.<Array.<Object>> | Conditions from a single rule received from server. |
- An array of conditions.
# parseConesItems(data, names) → {Array.<Object>}
Overview
Converts server response to an array of items. Single item can be displayed inConesDialog
.
Uses getItemName
as well as 'objects' and 'settings' to obtain special name for an item.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | A response from server. |
names |
Array | The array of object names received from server. |
- The array of items.
# parseConesListItems(items) → {Array.<Object>}
Overview
Converts items to list items that will be displayed inResultList
.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<Object> | An array of items prepared by |
- An array of list items displayed in
ResultList
.
# parseCrossValidationParams(result) → {Object}
Overview
Retrieves parameters used to perform cross-validation from server response.Parameters:
Name | Type | Description |
---|---|---|
result |
Object | Server response. |
- Retrieved parameters.
# parseDecisions(decisions) → {Array.<Array.<Object>>}
Overview
Converts decisions from server response to decisions used in a rule name.Parameters:
Name | Type | Description |
---|---|---|
decisions |
Array.<Array.<Object>> | Decision from a single rule received from server. |
- An array of decisions.
# parseFormData(parameters, files) → {FormData}
Overview
Prepares FormData that will be included in the body of an API call.Parameters:
Name | Type | Description |
---|---|---|
parameters |
Object | The map of parameters to be appended to FormData. |
files |
Object | The map of files to be appended to FormData. |
- FormData with appended parameters and files.
# parseMatrix(matrixObject) → {Object}
Overview
Creates a matrix item to display inMatrixDialog
.
Parameters:
Name | Type | Description |
---|---|---|
matrixObject |
Object | The part of a server response containing misclassification matrix. |
- The matrix item displayed in
MatrixDialog
.
# parseRulesItems(data) → {Array.<Object>}
Overview
Converts server response to an array of items. Single item can be displayed inRulesDialog
.
Uses getRuleName
to obtain special name for an item.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Server response. |
- An array of items.
# parseRulesListItems(items) → {Array.<Object>}
Converts items to list items that will be displayed in ResultList
.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<Object> | An array of items prepared by |
- An array of list items displayed in
ResultList
.
# parseRulesParams(result) → {Object}
Overview
Retrieves parameters used to generate rules from server response.Parameters:
Name | Type | Description |
---|---|---|
result |
Object | Server response. |
- Retrieved parameters.
# parseUnionsItems(data) → {Array.<Object>}
Overview
Converts server response to an array of items. Single item can be displayed inUnionsDialog
.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Server response. |
- An array of items.
# parseUnionsListItems(items) → {Array.<Object>}
Overview
Converts items to list items that will be displayed inResultList
.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<Object> | An array of items prepared by |
- An array of list items displayed in
ResultList
.
# async responseBlob(response) → {Promise.<Object>}
Overview
Returns response from a server parsed to BLOB format.Parameters:
Name | Type | Description |
---|---|---|
response |
Object | A response from a server that can be converted to BLOB format. |
# async responseJson(response) → {Promise.<Object>}
Overview
Returns response from a server parsed to JSON format.Parameters:
Name | Type | Description |
---|---|---|
response |
Object | A response from a server that can be parsed to JSON format. |