Create dummy variables.

Parameters:
See dedicated page for more information.
dummifyVar is a scripted action. Embedded code is accessible and customizable through this tab.
See dedicated page for more information.
The dummifyVar action automatically creates dummy variables (also known as 0/1 indicator variables) for all columns in the input table.
Dummy variables are especially useful for preparing data for predictive modeling or machine learning.
NOTE:
ThedummifyVaraction does not provide a column selector. It applies to all columns of the input table.
While dummifyVar can automatically detect categorical columns, it works best when the columns have the correct meta-type.
Free-text columns (e.g., "Gender", "Country")
No need for manual meta-type changes—dummifyVar will handle these correctly.
Numeric ID columns (e.g., "ID")
If needed, you can explicitly set the meta-type to Key using the ChangeDataType action before applying dummifyVar.
| Step | Action | Description |
|---|---|---|
| 1 | readCSV |
Load the dataset. |
| 2 | (Optional) ChangeDataType |
Convert numeric ID columns to Key meta-type. |
| 3 | dummifyVar |
Automatically generate dummy variables for all categorical columns. |

Do not use ChangeDataType to convert free-text categorical columns to Key.
This will cause pipeline errors because Key meta-type only accepts integer-like strings or numeric values.
Example Error:

dummifyVar directly on tables with text-based categories like Gender or Country.ChangeDataType only on numeric ID columns if needed.