Spinner logo OtasAI


Did You Know?

Categorical data - One Hot Encoding


Handling categorical data effectively is crucial for many machine learning models. One hot encoding is a popular technique that transforms categorical variables into a format suitable for machine learning algorithms. OtasML, a visual machine learning tool, offers a comprehensive Categorical Data - One Hot Encoding feature within its data preparation model. This tool provides various configurations to tailor the encoding process, ensuring that the transformed data meets the specific needs of your machine learning workflows. This article explores the different options available and how they can be configured to optimize your data preprocessing.


The One Hot Encoding tool in OtasML offers flexible options for encoding categorical data, allowing users to customize their datasets to enhance model performance. Below are the key configurations and options available:


  • Default Value: None
  • Description: This option allows users to select specific columns for one hot encoding. This ensures that only the desired categorical columns are transformed, providing more control over the preprocessing step.


  • Default Value: None
  • Description: Specifies a methodology to drop one of the categories per feature, which is useful for avoiding multicollinearity in models such as unregularized linear regression. The available options include:
    • None: Retain all features.
    • First: Drop the first category in each feature. If only one category is present, the feature will be dropped entirely.
    • If binary: Drop the first category in each feature with two categories. Features with one or more than two categories are left intact.

Data Type

  • Default Value: Float
  • Description: Specifies the desired data type of the output. The available options include:
    • Float: Will return float number type in the output.
    • Int: Will return integer number type in the output.

Handle Unknown

  • Default Value: Error
  • Description: Specifies the way unknown categories are handled during transformation. The available options include:
    • Error: Raise an error if an unknown category is present during the transformation.
    • Ignore: When an unknown category is encountered, the resulting one-hot encoded columns for this feature will be all zeros.
    • Infrequent if exists: Map unknown categories to the infrequent category if it exists, placing it in the last position in the encoding.

Minimum Frequency

  • Default Value: None
  • Description: Specifies the minimum frequency at which a category will be considered infrequent. This allows users to group infrequent categories together, ensuring that rare categories do not overly influence the model.

Maximum Frequency

  • Default Value: None
  • Description: Specifies an upper limit to the number of output features for each input feature when considering infrequent categories. If there are infrequent categories, max_categories will include the category representing the infrequent categories along with the frequent categories.

Interactive Buttons: Preview and Save

To enhance user experience and provide greater control over the one hot encoding process, the tool includes two essential buttons:

  • Preview: This button allows users to see the effects of the selected one hot encoding configuration in real-time without permanently applying the changes. By clicking Preview, users can visually assess how the dataset will be transformed based on the current configurations, ensuring that the encoding method is appropriate before committing to any changes.
  • Save: Once users are satisfied with their configurations and the preview results, they can click the Save button to permanently apply their chosen settings. This action saves the configuration, which will then be applied to the data during the training process, ensuring that the one hot encoding aligns with the user's expectations and requirements.


The One Hot Encoding tool in OtasML provides a flexible and robust solution for transforming categorical data into a format suitable for machine learning models. By offering a variety of encoding options and the ability to selectively apply them to specific columns, users can effectively tailor the preprocessing step to their specific needs. The inclusion of interactive Preview and Save buttons further enhances control and confidence in the one hot encoding process. OtasML continues to empower users with intuitive and powerful tools, making data preparation a seamless and integral part of the machine learning workflow.


A+ A-