Usage of Variables

Usage of Variables

In Rubiscape, you can add a variable at the workbook or workflow level. Refer to Adding a Variable.
Rubiscape provides variable support, that is, its usage, for all tasks anywhere in workbooks or workflows like creating a dataset, performing data preparation tasks like sorting, filtering, aggregation, and using various algorithms. Any reference to the added variable in the workbook or workflow is supported. Here we take an example of a workbook.

(info)

Notes:

  • The effect of an added variable can be seen in a node that is a successor of the RubiPython node.
  • For example, in the figure below, SSOrderPriority and Support_Vector_Machine are successors nodes of the RubiPython node.

Variable Usage in Workbook and Workflow

To use a variable in a workbook, follow the steps given below.

  1. Create a workbook or open an existing workbook. Refer to Creating a Workflowor or Opening a Workflow.
  2. Build your algorithm flow. Refer to Building Algorithm Flow in a Workflow Canvas.
    For example, we create an algorithm flow using the RubiPython node, Sp_sample_Superstore dataset, and the Support Vector Machine algorithm, as shown below.



    As shown below, in the Support Vector Machine algorithm, there are two advanced properties named Penalty Parameter and Degree, with default values 1.0 and 3, respectively.

    We want to change these values using the added variable.
  3. For this, add variables to be used in the workbook. Refer to Adding a Variable.

    For example, we add two variables, TestPenaltyParameter and TestDegree, corresponding to the two advanced properties Penalty Parameter and Degree of the Support Vector Machine algorithm.

    The figure below shows the two added variables with their default and current values.



  4. Click the RubiPython node.
    The Python Code Editor is displayed.
  5. Type the required code in the editor in the following format.

    TaskName.PropertyName = @@Varible Name@@
    In our example, we write the code as shown below.
    Support_Vector_Machine.PenaltyParameter = @@
    and
    Support_Vector_Machine.Degree = @@



    (info)

    Notes:

    While writing the code, make sure that

    • There is no space between two words in the property name. For example, we write the Penalty Parameter as PenaltyParameter.
    • The task name is written exactly like that in the property pane. For example, we write the task name as Support_Vector_Machine.
  6. Close the editor and to run the entire workbook, click Run.

  7. After the flow is successfully run, click on the Support Vector Machine node.

    The properties pane displays the selected properties of the algorithm. In the pane, you see that the values of Penalty  Parameter and Degree change to the current values of the added variable.


    Thus, the current value of the added variables used in the task overwrites the initial values of properties while exploring and executing the task.

    • Related Articles

    • Usage of Variables

      In Rubiscape, you can add a variable at the workbook or workflow level. Refer to Adding a Variable. Rubiscape provides variable support, that is, its usage, for all tasks anywhere in workbooks or workflows like creating a dataset, performing data ...
    • Mapping Variables

      In Rubiscape, you can create, train, test, and publish models for further use in workbooks or workflows. For this, we configure a model using a dataset. When you publish a trained model, it appears in the model section under Model Studio or Machine ...
    • Mapping Variables

      In Rubiscape, you can create, train, test, and publish models for further use in workbooks or workflows. For this, we configure a model using a dataset. When you publish a trained model, it appears in the model section under Model Studio or Machine ...
    • Geographical Variables

      In RubiSight, you can use Numerical, Textual, Interval, Categorical, and Geographical types of variables. Creating a Dataset with Geographical Variable Type To create a dataset containing a geographical variable type, follow the steps given below Add ...
    • Defining Your Own Variables

      Rubiscape provides the facility to declare a variable at the workbook level. You can add a variable, edit its value, and delete it when it is no longer required. You can use this variable in Custom Components and even in conditional task execution. ...