URL Params
Required: None
Optional: Any datasource component may be passed as a query parameter if a binding property exists for that datasource. For example, see the RASON example code snippet below.
"datasources": {
"srcCustomers": {
"type": "csv",
"connection": "customers_dt.txt",
"selection": "custID = $parCustID1 or custID = $parCustID2",
"parameters": {
"parCustID1": {
"binding": "get",
"value": "c1"
},
"parCustID2": {
"binding": "get",
"value": "c3"
}
}
}
},
To query custID =$parCustID1 or custID=$parCustID2 outside of the RASON model environment, use:
$.get(https://rason.net/api/datamine?parCustID1=c1&parCustID2=c2…
Or in general,
$.get(https://rason.net/api/datamine?par1=val1&par2=val2.....
RASON Server will map "custID=$parCustID1" with "parCustID1=c1" and "custID = $parCustID2" with "parCustID2=c3". A query can return any number of rows that satisfy the filtering condition, from 0 to infinity.
Data Params:
A RASON Data Science Model Example:
{
modelName: "oneHotEncodingInLineData",
modelType: "datamining",
modelDescription: 'transformation: one-hot encoding',
datasets: {
trainData: {
value: [
[ '1', 2.0 ],
[ '0', 3.0 ],
[ '1', 6.0 ]
]
},
newData: {
value: [
[ '0', 3.0 ],
[ '1', 6.0 ],
[ '1', 6.0 ]
]
}
},
estimator: {
myEncoder: {
type: 'transformation',
algorithm: 'oneHotEncoding'
}
},
actions: {
encoderModel: {
trainData: 'trainData',
estimator: 'myEncoder',
action: 'fit'
},
encodedTrainData: {
data: 'trainData',
fittedModel: 'encoderModel',
action: 'transform',
evaluations: [
'transformation'
]
},
encodedNewData: {
data: 'newData',
fittedModel: 'encoderModel',
action: 'transform',
evaluations: [
'transformation'
]
}
}
}
Success Response: Code: 200 (OK)
Example Response
{
"status": {
"id": "2590+2019-11-18-20-23-58-998833",
"code": 0,
"codeText": "Success"
},
"results": [
"encodedTrainData.transformation",
"encodedNewData.transformation"
],
"encodedTrainData": {
"transformation": {
"objectType": "dataFrame",
"name": "Encoded - traindata",
"order": "col",
"rowNames": [
"Record 1",
"Record 2",
"Record 3"
],
"colNames": [
"Feature 1_0",
"Feature 1_1",
"Feature 2_2",
"Feature 2_3",
"Feature 2_6"
],
"colTypes": [
"integer",
"integer",
"integer",
"integer",
"integer"
],
"indexCols": null,
"data": [
[0, 1, 0],
[1, 0, 1],
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]
]
}
},
"encodedNewData": {
"transformation": {
"objectType": "dataFrame",
"name": "Encoded - newdata",
"order": "col",
"rowNames": [ "Record 1", "Record 2", "Record 3" ],
"colNames": [ "Feature 1_0", "Feature 1_1", "Feature 2_2", "Feature 2_3", "Feature 2_6" ],
"colTypes": [ "integer", "integer", "integer", "integer", "integer" ],
"indexCols": null,
"data": [
[ 1, 0, 0 ],
[ 0, 1, 1 ],
[ 0, 0, 0 ],
[ 1, 0, 0 ],
[ 0, 1, 1 ]
]
}
}
}