Set Role (Blending)
SynopsisThis Operator is used to change the role of one or more Attributes.
The role of an Attribute describes how other Operators handle this Attribute. The default role is regular, other roles are classified as special. The different types of roles are explained below in the parameter section.
An ExampleSet can have many special Attributes and you can assign special Attributes multiple times. This comes in handy, for example, if you want to feed the Attributes into a learner that accepts multiple labels. However, please note that some operators expect the special roles to be unique and they might not know how to handle duplicate special roles.
There are several Operator for renaming Attributes (e.g., Rename , Rename by Replacing, ...). Those only change the name of the Attribute and not its role.
This Operator creates a new Attribute with the special role id. In contrast to Set Role this Operator will overwrite an existing Attribute with the id role. Applying Set Role to change the role to regular will keep the original Attribute.
- example set (Data Table)
This input port expects an ExampleSet.
- example set (Data Table)
The ExampleSet with modified role(s) is output of this port.
- original (Data Table)
The ExampleSet, that was given as input is passed through without changes.
This parameter is used to set the roles of one or more Attributes. A click on Edit List opens a menu with Attribute name and target role pairs. The role of an Attribute will be changed to the given target role for each of the pairs. Following target roles are possible:
- regular: Attributes without a special role. Regular Attributes are used as input variables for learning tasks.
- id: This is a special role. An Attribute with the id role acts as an identifier for the Examples. It should be unique for all Examples. Different Blending Operators (Join, Union, Transpose, Pivot, ...) uses the id Attribute to perform their tasks.
- label: This is a special role. An Attribute with the label role acts as a target Attribute for learning Operators. The label is also often called 'target variable' or 'class'.
- prediction: This is a special role. An Attribute with the prediction role is the result of an application of a learning model. The Apply Model Operator adds, for example, a prediction Attribute to the ExampleSet. To evaluate the performance of a model, a label and a prediction Attribute is necessary.
- cluster: This is a special role. An Attribute with the cluster role indicates the membership of Examples to a particular cluster. For example, the k-Means Operator adds an Attribute with the cluster role.
- weight: This is a special role. An Attribute with the weight role indicates the weight of Examples with regard to the label. Weights are used in learning processes to set the importance of Examples. Weights can also be used to evaluate the performance of models; there they assign a severeness for misclassification of single Examples.
- batch: This is a special role. An Attribute with the batch role indicates the membership of Examples to a specific batch.
- outlier: This is a special role. An Attribute with the outlier role indicates how much of an outlier an Example can be considered. For example, the Detect Outlier (LOF) Operator creates an Attribute with this role. It is used, for example, to filter out Examples that are considered outliers.
- score: This is a special role. An Attribute with the score role indicates the quality of predictions. A prediction's confidence is one example of a possible score.
- encoding: This is a special role. An Attribute with the encoding role indicates, that it is a different representation of another Attribute. For example, a text Attribute could be represented as multiple numerical Attributes. Each of the numerical Attributes would be of the role encoding.
- interpretation: This is a special role. An Attribute with the interpretation role indicates, that its values are somehow derived from another attribute. Often this is used in combination with prediction/score Attributes.
- source: This is a special role. An Attribute with the source role indicates, that it is the origin for some other Attribute. It can also be used to identify attributes containing other resources, like images. In that case the source Attribute would contain a file path to an image.
- metadata: This is a special role. It can be used to mark Attributes that contain some information relevant to the user but irrelevant for learners. Attributes with the metadata role are ignored in learning processes but remain in the ExampleSet.
Set Role on Titanic Data Set
This tutorial Process shows the basic usage of the Set Role Operator. First the Titanic data set is retrieved from the Samples folder. Then the role of several Attributes are set. An explanation is given of which Attribute is set to which role and the reason for that is given in the comments.