General Scripts

Access a Script

About This Task

Tip: You can also access a script from the Classifiers section of the Cognitive Analytics Overview page.

Procedure

  1. Access the Scripts page.
  2. In the Scripts grid, in the row for the script that you want to access, select the link in the Path cell.

    -or-

    Browse the Catalog to select a script. To do so:

    1. On the upper-right corner of the page, select Browse.

      The Select a script from the catalog window appears.

    2. Navigate to and select a script, and then select Open.

    The Workbench workspace of the selected script appears.

Create a New Script

About This Task

These steps describe how to create a completely new script from the Scripts page.

Tip:

  • You can alternatively create a script by copying a script. For example, you can copy a script that is delivered in the GE Digital APM baseline Catalog to use as a starting point for your script. These scripts already contain an initial set of training data.
  • You can also create a new script from the Classifiers section of the Cognitive Analytics Overview page.

Procedure

  1. Access the Scripts page.
  2. In the upper-right corner of the page, in the drop-down list box, select the type of script that you want to create, and then select .

    A page for the new script appears. The specific options that appear depend on the type of script you are creating.

  3. Select .

    The Save As window appears.

  4. In the Catalog pane, navigate to the location to which you want to save the script.
  5. Enter values in the Name, Caption, and Description boxes.
    Note: The script's name cannot contain any spaces or special characters.
  6. Select Save.

    The script is created.

What To Do Next

Copy a Script

Procedure

  1. Access the script that you want to copy.
    Tip: The GE Digital APM baseline Catalog folder \\Public\Meridium\Modules\Cognitive Analytics\Scripts contains several scripts that you may want to copy to use as a starting point for your script. These scripts already contain an initial set of training data.
  2. Select .

    The Save As window appears.

  3. In the Catalog pane, navigate to the location to which you want to save the script.
  4. Enter values in the Name, Caption, and Description boxes.
    Note: The script's name cannot contain any spaces or special characters.
  5. Select Save.

    The script is saved, and you can modify the script as needed.

What To Do Next

Configure and Test a Fuzzy Logic Script

Before You Begin

  • Create a query or dataset of your data that contains fields that are relevant to the script being tested. See the table below for details.

Procedure

  1. Access the fuzzy logic script that you want to configure and test.
  2. Configure the script as described in the following table.
    SectionDescriptionRequired / Optional
    Standard List Select the standard list that is relevant to the script that you are testing.Required
    Query or Dataset

    Select to browse the Catalog and select an appropriate query or dataset that includes data relevant to the script.

    Notes:
    • Fields that are used in a query but hidden from display will be ignored by the script.
    • Hyperlinks defined for columns in a query will appear on the Test Results tab. This feature allows you to easily access associated records while testing a script. For example, a column containing work order numbers could be configured with a link to the full work order.
    • Ensure that the query you use is a Select query. Other types of queries will cause errors to occur.
    Required
    Standard List Reference Field

    Select a column from the query or dataset that contains values that identify sub-sets of the specified Standard List (e.g., Equipment Class values).

    When the script is run, values in the specified field are compared to values in the List Reference field in Classifier Standard List records to determine which sub-set(s) of the script’s Standard List to use.

    Optional
    Classifier Input Fields

    Select the check box for each column in the query that you want to use as an input to the script.

    Tip: By default, the field selected in the Standard List Reference Field box is not included as an input to the script. If you want the script to process values in this field, include the column twice in your query or dataset.
    Required

    The script is configured.

  3. Select .

    -or-

    Select the Test Results tab.

    The script processes the data and then predicts the result for each record. The Test Results workspace appears with 50 results per page.

    Tip: To view a single row of the test results, select . To navigate through the test results, in the Details window, select and .

    The following columns appear in the grid: 

    • Prediction: Predicted value produced by the script.
    • Score: The score of the prediction produced by the script. Scores are presented as a percentage between 0.0% and 100.0%.
    • A column for each field you selected in the Classifier Input Fields section.
  4. Review the results to ensure they are as expected.

Define Python Code and Specify Parameters for a General Script

Before You Begin

Procedure

  1. Access the script that you want to define.
  2. Select the Script tab, and then enter your Python code.

  3. Define each parameter in the script. When you define a parameter, you are specifying whether each parameter in the general script is an input or output parameter, and the type of data that it requires. To do so:
    1. At the bottom of the page, select Parameters.

      The Parameters pane appears.

    2. Select .

      A new row is added to the grid.

    3. In the ID cell, enter the parameter ID exactly as it appears in the script.
    4. In the Name cell, enter a name for the parameter as you want it to appear to the script and to the cognition user (e.g., on the Properties window for the Script node).
    5. In the Type list, select the data type of the parameter.

    6. In the Direction list, specify whether the parameter represents an input or an output.

      Note: Only one output of each type (i.e., value and score) should be specified.
    7. For each parameter in the script, repeat steps b through f.
    8. Select .

      The script parameters are saved.

      Tip: If you want to delete a parameter, in the row for the parameter, select Delete.

What To Do Next

Configure and Test a General Script

Procedure

  1. Access the script that you want to configure and test.
  2. Configure the script as described in the following table.
    SectionDescriptionRequired / Optional
    Query or Dataset

    Select to browse the Catalog and select an appropriate query or dataset that includes data relevant to the script.

    Notes:
    • Fields that are used in a query but hidden from display will be ignored by the script.
    • Hyperlinks defined for columns in a query will appear on the Test Results tab. This feature allows you to easily access associated records while testing a script. For example, a column containing work order numbers could be configured with a link to the full work order.
    • Ensure that the query you use is a Select query. Other types of queries will cause errors to occur.
    Required
    Script Input (SingleValues)

    If you have any single-value input parameters defined in your script, specify which fields in the query will provide values to each of the script inputs.

    Note: One box appears for each single-value input configured in the Scripts section.
    Required if you have single-value input parameters.
    Script Input (List of Values) If you have any list input parameters defined in your script, optionally, in the Classifier Input Fields section, select the check box for each column in the query that you want to include in the script input.Required if you have list input parameters.

    The script is configured.

  3. Select .

    The script is saved.

  4. Select .

    -or-

    Select the Test Results tab.

    The script processes the data and then predicts the result for each record. The Test Results workspace appears with 50 results per page.

    Tip: To view a single row of the test results, select . To navigate through the test results, in the Details window, select and .

    The following columns appear in the grid: 

    • Prediction: Predicted values produced by the script. This is the result of the output defined in the Parameters pane as Output to use as Value.
    • Score: The score of the predictions produced by the script. Each score is presented as a percentage between 0.0% and 100.0%. This is the result of the output defined in the Parameters pane as Output to use as Score. If you did not specify this output parameter, all scores will be 0.0%.
    • A column for each field you specified in the in the Script Input (SingleValues) section or selected in the Classifier Input Fields section.

Access Script History

About This Task

You can access the History workspace to see when a script has been tested or trained.

Procedure

  1. Access the script for which you want to view the history.
  2. Select the History tab.

    The History workspace appears.

    Tip: Select to refresh the information in the table if necessary.

    The grid in this section displays the following information:

    • Job Type: The type of script event recorded in the history.
    • User ID: The GE Digital APM user who tested or trained the script.
    • Start Time: The date and time at which the script event started.
    • Finish Time: The date and time at which the script event finished.
    • Status: The status of the script event.
    • Message: If the script event failed, an automated message is provided by the GE Digital APM system.
    • Job ID: The ID of the script event in the GE Digital APM system.
    Tip: To see a consolidated view of a single row of the table, select . To navigate through the history entries, in the History window, select and .

Access Script Statistics

About This Task

You can access the Statistics section to view a summary of the training results of a machine learning script.

Procedure

  1. Access the machine learning script for which you want to view the statistics.
  2. Select the Statistics tab.

    The Statistics section appears.

    The statistics portion of this section displays the following information:

    • Total Number Reviewed: The number of records that have been reviewed and trained incrementally from the Test Results workspace.
    • Total Number Correctly Predicted: The number of reviewed records for which the script's prediction was correct (i.e., was indicated).
    • Total Number Incorrectly Predicted: The number of reviewed records for which the script's prediction was incorrect (i.e., was indicated).
    Note:
    • When you incrementally train the script from the Test Results workspace, a record is counted in these statistics each time it is included in training (i.e., if it is included in training twice, it is counted twice).
    • These statistics are not reset if you change the query associated with the classifier or if you delete the trained records (via the button under Trained Record Count). If you want to reset the statistics, you should save a copy of the script.

    The training details portion of this section displays the following information:

    • Trained Record Count
    • Last Trained by
    • Last trained on

Delete a Script

Procedure

  1. Access the Catalog page for the folder that contains the script that you want to delete.
  2. Select the check box that corresponds to the script that you want to delete.
  3. In the upper-right corner of the page, select .

    A confirmation message appears, asking if you really want to delete the script.

  4. Select OK.

    The script is deleted.