mode function in the Factory
The mode is the most frequent value in an attribute.
For example, the mode in the list [23; 26; 26; 26; 4; 7; 7; 98] is 26.
The Mode function is available also by:
Selecting the column in the Data Manager and finding the mode in the Info panel.
Dragging the attribute in the Apply area of the Data Manager’s query panel.
Selecting it in the Sheets tab of the Data Manager.
Function and parameters Parameter Description column It identifies the column to which you want to apply the formula. The column parameter is mandatory. group It allows you to group the results by a certain column. usemissing A Boolean which indicates whether missing values should be considered or not in the computation of the statistics. The default value, if not otherwise specified, is True. Example The following example uses the HR-employee-attrition dataset. Description Screenshot In the example here, we want to retrieve the mode of the Job Role attribute. We write the following formula: The mode of the Job Role attribute is Sales Executive. Then ,we want to group our results by the Education Field attribute, and to have a 0 when a value is missing. So the formula is: The results are as follows: The mode of the Job Role for the Life Sciences education field is Research Scientist. The mode of the Job Role for the Other education fields is Laboratory Technician.mode(column, group, usemissing)
mode($"JobRole")
mode($"JobRole",$"EducationField")