Applying Operations on Data in the Query Manager
Apply operations execute an operator selected by the user on the examples in the dataset.
For example, you can compute the average of an attribute, which will then substitute the actual value in all patterns. When used together with grouping the apply operators may become very powerful.
Changes you make can be committed run-time or on request.
Drag and drop the attribute in any cell of the Apply column.
Specify the operator to be used according to the type of the selected attribute.
The operators that can be used are the following:
The following example is based on the Adult dataset.
Scenario data can be found in the Datasets folder in your Rulex installation.
The apply operation becomes very useful and powerful when coupled with groups, where the selected operation is computed for each group independently.
In the following example, the workclass attribute is grouped and subsequently the following apply operations are performed:
an apply operation on age that computes the average of that variable for each group,
an apply operation on fnlwgt that computes the number of patterns for each group (one of the few operators, along with Enumerate, that do not depend on the attribute on which they are computed) and
an apply operation on marital-status that computes the mode on that variable for each group.
This allows to discover, in a single view, for example that the majority of State-gov workers has no family, that the most represented group is that of Private workers (with 22696 elements) and that Without-pay (47.8 years) and Self-emp-inc (46.0 years) are the oldest workers.