A Comparison node is a node that you can use to compare a value from a predecessor node with a manually entered value. Comparison nodes use operators to determine which value should be used as the output value. The following operators are available:
Each Comparison node requires at least one input, which must be a single value. Boolean, character, and numeric data types are acceptable data types for the input values.
The Properties window for each Comparison node contains the items that are described in the following table.
Item |
Description |
Notes |
---|---|---|
If box | The value from a predecessor node that will be compared. | If the predecessor node is a Classifier node, you can select either the prediction or the score of the prediction. |
Is box | The symbol that corresponds with the comparison operation that is performed by the node. | None |
To box | The manually entered value that is being compared against the value from the predecessor node. | The value that you specify should correspond to the type of input chosen in the If box (e.g., if you chose the prediction's score in the If box, you should enter a number between 0 and 1). |
Use box | If the comparison is true, the available values from predecessor nodes to use as the output value. | None |
Else box | If the comparison is not true, the available values from predecessor nodes to use as the output value. | None |
The following example illustrates how you can use a Comparison node to specify the output value based on a comparison of the input value with a manually entered value. Consider the following nodes and connections.
The maintainableItem.py Classifier node receives values from the Event Long Description and Event Short Description input fields, and then uses the maintainableItem.py script to classify the values.
The maintainableItem.py (Score) > .85 Comparison node receives the predicted target value and its score from the maintainableItem.py Classifier node to determine which value to write to the Maintainable Item output field. The maintainableItem.py (Score) > .85 Comparison node also receives a value from the Unable to Determine Constant node.
The following image shows what the Properties window looks like for the maintainableItem.py (Score) > .85 Comparison node.
Based on these properties, the following logic will be applied when the cognition is executed:
In this example, the following output values would be produced by the Comparison node:
Score from maintainableItem.py Classifier Node |
Predicted Target Value from maintainableItem.py Classifier Node |
Output Value from maintainableItem.py (Score) > .85 Comparison Node |
---|---|---|
.90 | Motor | Motor |
.75 |
Motor | Unable to Determine |
.96 | Gearbox | Gearbox |
.85 | Gearbox | Unable to Determine |
Copyright © 2018 General Electric Company. All rights reserved.