Introduction to RASON
About RASON Models and the RASON Server
Rason Subscriptions
Rason Web IDE
Creating and Running a Decision Flow
Defining Your Optimization Model
Defining Your Simulation Model
Performing Sensitivity Analysis
Defining Your Stochastic Optimization Model
Defining Your Data Science Model
Defining Custom Types
Defining Custom Functions
Defining Your Decision Table
Defining Contexts
Using the REST API
REST API Quick Call Endpoints
REST API Endpoints
Decision Flow REST API Endpoints
OData Endpoints
OData Service for Decision Flows
Creating Your Own Application
Using Arrays, For, Loops and Tables
Organization Accounts

Running a Data Science Algorithm

As with optimization, simulation and stochastic models written in the Rason modeling language, RASON DM models can be ran by calling the RASON REST server by using the RASON Web IDE on the website <www.rason.com> or by using the RASON REST API from within your own application. As with optimization, simulation and stochastic models, no matter how you solve the model, the result will always be valid JSON. Let's run a data science technique using both IDE's starting with the RASON.com Web IDE.

Click back to the RASON Web IDE located on www.rason.com. Open an example data science model by clicking the down arrow next to "Select One" (beneath "RASON Examples") and selecting OneHotEncoding-InlineData.json. The Rason model appears in the blank IDE.

One Hot Encoder Incline Example

Since the model we are solving is a simple model that will solve in just a few seconds, we can use the QuickSolve REST API endpoint POST rason.net/api/datamine. Click the down arrow on the Post rason.net/api/solvetype QuickSolve button on the top right and select Datamine from the list.

Just like the Optimization and Simuation Quick Solve endpoints, this REST API endpoint runs the data science model and immediately returns a Result as shown in the screenshot below.

One Hot Encoder Incline Example Results

Again, as discussed above, the QuickSolve endpoint should only be used with models that solve very quickly due to the time limit of 30 seconds for each operation and the fact that your application will not be responsive until a result is received. This means that if the data science method takes over 30 seconds to complete, the RASON Server will return the result: "status" : { "code" : 10, "codeText" : "Stop chosen when the maximum time limit was reached." }. Quick Solve endpoints do not create a "model resource" which means that a model solved by calling POST rason.net/api/datamine cannot be saved, edited, retrieved or solved at a later time.

What if you are running a data science method on a dataset containing tens of thousands of rows that might take 30 minutes – or longer - to run? Or a model where the input data must be uploaded to the RASON server? With a call to the REST API endpoint POST rason.net/api/model, you can create a "model resource," then perform data science via the REST API endpoint GET rason.net/api/model/id/datamine, check on its progress at any time with the REST API endpoint GET rason.net/api/model/id/status and obtain results when finished with the REST API endpoint GET rason.net/api/model/id/result.

Click Post rason.net/api/model to call the REST API endpoint POST rason.net/api/model to post the model to the RASON Server. In return you will receive a similar result in the output window.

Model submitted to location: https://rason.net/api/model/2590+2019-06-05-21-37-33-457090

Calling this endpoint creates the Model Resource, 2590+2019-06-05-21-37-33-457090. We can now easily retrieve this model by clicking the down arrow next to "Please select a model ID" and selecting this value from the menu.

Click GET rason.net/api/model/id/status to call the REST API endpoint GET rason.net/api/model/id/datamine to perform the data science task. In return you will receive a result similar to the one below.

Model has been placed in the queue to be datamined.

Click Get rason.net/api/model/id/status to call the REST API endpoint GET rason.net/api/model/id/status to obtain the status of the data science method.

Getting model status: GET https://rason.net/api/model/2590+2018-06-05-21-37-33-457090/status {"status": "Complete" }

Status: Complete means that the task has been completed. If the data science method was still in progress we would have received an incomplete status, for example: {"status": "Incomplete" }.

Click Get rason.net/api/model/id/result to call the REST API endpoint GET rason.net/api/model/id/result to obtain the results from the data science method.


  Getting model results: GET https://rason.net/api/model/2590+2018-06-05-21-37-33-457090/result
  {
    "status": {
      "code":0,
      "codeText":"Success"
    },
    "dataStorage":"json",
      "encodermodel": {
      "myencoder": {
        "objectType": "estimator",
        "type": "transformation",
        "algorithm": "oneHotEncoding",
        "parameters": {}
      }
    },
    "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]
         ]
       }
     }
  }

The result "status":"success" means that the data science task completed successfully.

We can also perform a data science technique using the desktop IDE which calls the XLMiner SDK directly (saved on your hard drive or server) to solve a model. Rather than writing code in a programming language such as C++ or C#, we can simply click the Datamine button to solve our data science model.

In a typical installation, this IDE is installed into either C:\Program Files\Frontline Systems\Analytic Solver Platform\Bin (when using Analytic Solver for Excel) or C:\Program Files\Frontline Systems\Solver SDK Platform\Bin (when using Solver SDK). Double click to open RasonIDE.exe.

Click the File Open icon on the toolbar

File Open Toolbar

and browse to C:\Program Files\Frontline Systems\Solver SDK Platform\Examples\RASON (if using Solver SDK) or C:\Program Files\Frontline Systems\Analytic Solver\Bin to open the example, UGForecast.json. The model opens in the IDE Environment.

One Hot Encoder Inline Example

Click the Datamine button on the Ribbon to perform the data science method. The results are printed on the right side of the desktop IDE.