Encode Column

This transform allows to encode a column in a dataset.

tags: [“Data Preparation”]

Parameters

The table gives a brief description about each parameter in Encode Column transform.

Name:

By default, the transform name is populated. You can also add a custom name for the transform.

Input Dataset:

The file name of the input dataset. You can select the dataset that was uploaded from the drop-down list to encode every element in a column.(Required: True, Multiple: False)

Output Dataset:

The file name with which the output dataset is created with an encoded Column. (Required: True, Multiple: False)

Column:

The name of the column to be encoded in the dataset. (Required: True, Multiple: False, Options: [‘FIELDS’], Datasets: [‘df’])

The sample input for this transform looks as below:

Projects/templates_docs/templates_UI_images/encodecolumn_input.png

The output after running the Encode Column transform on the dataset appears as below:

Projects/templates_docs/templates_UI_images/encodecolumn_output.png

How to use it in Notebook

The following is the code snippet you must use in the Jupyter Notebook editor to run the Encode Column transform:

template=TemplateV2.get_template_by('Encode Column')

recipe_Encode_Column= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Encode Column')

transform=Transform()
transform.templateId = template.id
transform.name='Encode Column'
transform.variables = {
'input_dataset':'car',
'output_dataset':'encoded',
'col':"fueltype"}
recipe_Encode_Column.add_transform(transform)
recipe_Encode_Column.run()

Requirements

scikit-learn pandas