N Smallest Values
This transform returns the first n smallest values of a specific column in the ascending order.
tags: [“EDA”]
Parameters
The table gives a brief description about each parameter in N Smallest Values 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. (Required: True, Multiple: False)
- Output Dataset:
The file name with which the output dataset is created. This contains the dataset with the given number of smallest values sorted in the ascending order. (Required: True, Multiple: False)
- n:
The total number of largest numbers to be returned after sorting by the lowest value for a particular column.
(Required: True, Multiple: False, Datatypes: [“LONG”], Options: [“CONSTANT”])
- columns:
The name of the column to which the nth smallest transform must be applied.(Required: True, Multiple: True, Datatypes: [‘ANY’], Options: [“FIELDS”], Datasets: [“df”])
The sample input for this transform looks as shown in the screenshot.
The output after running the N Largest Values transform on the dataset appears as below:
How to use it in Notebook
template=TemplateV2.get_template_by('N Smallest Values')
recipe_N_Smallest_Values= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='N Smallest Values')
transform=Transform()
transform.templateId = template.id
transform.name='N Smallest Values'
transform.variables = {
'input_dataset':'car',
'output_dataset':'car_nsmallest',
'value_1':1,
'value_2':"carlength"}
recipe_N_Smallest_Values.add_transform(transform)
recipe_N_Smallest_Values.run()
Requirements
pandas