How to Transform a Number Field to a Categorical Field for Machine Learning Models with Aidy
#basics
#beginners
#machine learning
When building a model to predict categories, a numeric field may contain too many unique values, making classification difficult. You can solve this by transforming the numeric data into categorical data using Transformation → Field Engineering (Add Fields) in Aidy. This helps create a more suitable dataset for modeling and can improve the model’s F-score.

Two key steps for transforming numeric data into categorical data:
1. Apply Rule-Based Logic
Conditional expressions are used to define new features based on your data’s values. By setting up IF/ELSE IF rules, you can group numeric values into categories that reflect your business logic or analytical objectives.

Grouping Example:
Based on the histograms of the imported dataset, there are 11 distinct age values. You plan to group them into four categories: under 30, between 30 and 40, over 40 and others.
Setting Up Demonstration:
The video demonstrates how to set up the grouping rules and create a new categorical field for the selected dataset using Aidy.
Operation: If / Else If
Field: Age
New Field Name: Age_group
Category Values: A / B / C/ Others
Rules:
1. If (Age < 30),
then (Age_group = ‘A’)
2. Else If (Age ≥ 30 and Age ≤40),
then (Age_group = ‘B’)
3. Else If (Age> 40),
then (Age_group = ‘C’)
4. Else (Age_group = ‘Others’)
2. Review the Transformed Data in a New Dataset
After applying the transformation rules, export, download, and view the new dataset to confirm the new categories were created as intended. This step allows you to verify the logic and transformation results align with your modeling goals.

which was transformed from the original “Age” field.
By following the data transformation steps above, you can group the numeric data into categories and build more accurate, reliable machine learning models using Aidy.
Aidy also supports other data transformation operations, such as:
– Aggregation
– Changing Data Types
– Filtering
– Joining Datasets
– Merging Datasets
– Splitting Dataset
– Under-sampling
Not a data scientist? Can a layman use Machine Learning? Yes — absolutely! You can do it easily with the right tool, like Aidy.