Use the Rules module to apply rules to translate or preprocess your data before it is processed by the neural network.
For example, you can use two input variables to create the values for a third input variable. You may believe that if you combine the price of gold and IBM stock and the total is > 400, the economy is improving. You can translate this information into a new network input as follows:
You can also use the Rules module to post-process the network's predictions and classifications. For example, if your outputs are categories and in the range zero to one, and you want any value in column 1 greater than .5 to be true (1), your rule might be:
If column 1 > = .5, then column 1 = 1,
else column 1 = 0.
In this way you can set your own threshold, in this case .5, for determining when the pattern is included in an output category. There are many other uses of applying rules to output data.
When creating rules in NeuroShell 2 to preprocess your data, the basic rule structure is the following:
IF (possibly followed by And, Or)
THEN (possibly followed by And)
ELSE (possibly followed by And)
Each row in the datagrid represents a complete clause in the rule.
Each rule requires a separate rule number, which may be selected by using the scroll bar at the top of the datagrid.
Begin to create a rule by selecting a rule structure from the Template Menu.
Use the File Menu to select a Pattern File or to View the Data to which you want to apply rules.
Use the Edit Menu to insert And/Or clauses into your rule. The insertions appear in the row after the row where the cursor appears. Also use the Edit Menu to delete a row, to copy, to paste or cut an expression, or to clear the rule table. The Edit Menu also allows you to copy, cut, and paste entire rules.
Once a rule template appears on the rule grid, you need to fill in the blank cells for each clause by using the mouse to move to a blank cell.
Expression Edit Center
When the focus goes to a blank cell (usually by a mouse click) beneath an Expression column, the Expression Edit Center will be displayed.
Select a variable that you wish to include in the rule by clicking on the label that appears in the Variable/Column scroll box.
You may want to combine other variables or constants with the first variable into a single expression. The Expression Edit Center allows you to select a mathematical operator and then add a variable/column label and/or a constant value. To enter a constant value, type it in the Constant Edit Box and press enter.
If you need to create a new variable, select the Append New Variable/Column option from the Variable/Column scroll box and type the name of the variable in the edit box.
Use the reverse arrows << to clear the last part of the expression that was added.
Use the Clear All button to erase the expression.
Clicking on the OK button returns the focus to the rule grid.
Use either the mouse, arrow, or Enter key to move to the Rel Column. A scroll box appears that allows you to click on the appropriate mathematical operator. Once you make a selection, the focus returns to the rule grid.
Use either the mouse, arrow, or Enter key to move to the Value/Expression column. The Expression Edit Center is displayed again. Use it the same as above to complete this part of the clause.
Continue filling in each clause in the rule template as above.
To change to a different rule, click on the Rule Number at the top of the screen.
Expressions on the left side of Then and Else clauses are limited to a single value. Expressions in If, And, and Or clauses allow you to combine one or more values and/or constants by using operators. There is a limit of 30 values, constants, and operators in a single expression.
You can expand column width by dragging the bar that separates column names as far as you want to expand the column.
When you have finished creating rules, use the Evaluate Menu and select the Begin Rule Evaluation option to apply the rules to your data file. Use the Evaluate Menu to Interrupt Evaluation.
The rules are saved automatically after evaluation is completed. If you create rules but do not select the Evaluate Option, a message box will be displayed that asks if you want to save the rules.
File Note: When applying Rules to data before it is processed by the neural network, NeuroShell 2 uses the .PAT file as the default setting. When applying Rules to data after it has been processed by the network, NeuroShell 2 uses the .OUT file as the default setting. Use the File Menu to change to a different file.