Generate ID (Blending)
Synopsis
This operator adds a new attribute with id role in the input ExampleSet. Each example in the input ExampleSet is tagged with an incremented id. If an attribute with id role already exists, it is overridden by the new id attribute.Description
This operator adds a new attribute with id role in the input ExampleSet. It assigns a unique id to each example. This operator is usually used to uniquely identify each example. Each example in the input ExampleSet is tagged with an incremented id. The number from where the ids start can be controlled by the offset parameter. Numerical and integer ids can be assigned. If an attribute with id role already exists in the input ExampleSet, it is overridden by the new id attribute.
Input
- example set input (Data table)
This input port expects an ExampleSet. It is output of the Retrieve operator in the attached Example Process.
Output
- example set output (Data table)
The ExampleSet with an id attribute is output of this port.
- original (Data table)
The ExampleSet that was given as input is passed without changing to the output through this port. This is usually used to reuse the same ExampleSet in further operators or to view the ExampleSet in the Results Workspace.
Parameters
- create_nominal_idsThis parameter indicates if nominal ids should be created instead of integer ids. By default this parameter is not checked, thus integer ids are created by default. Nominal ids are of the format id_1, id_2, id_3 and so on. Range: boolean
- offsetThis is an expert parameter. It is used if you want to start id from a number other than 1. This parameter is used to set the offset value. It is 0 by default, thus ids start from 1 by default. Range: integer
Tutorial Processes
Overriding the id attribute of the 'Iris' data set
The 'Iris' data set is loaded using the Retrieve operator. The Generate ID operator is applied on it. All parameters are used with default values. The 'Iris' data set already has an id attribute. The old id attribute is overridden when the Generate ID operator is applied on it. Run the process and you can see the ExampleSet with the new id attribute. The type of this new attribute is integer. Set the create nominal ids parameter to true and run the process again, you will see that the ids are in nominal form now (i.e. id_1, id_2 and so on). The offset parameter is set to 0 that is why the ids start from 1. Now set the offset parameter to 10 and run the process again. Now you can see that ids start from 11.