> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How Categorical Data is Handled in Tabular Models

> How tabular models automatically encode categorical columns using one-hot encoding.

## Overview

When training tabular models (Random Forest, Neural Network, Linear/Polynomial Regression, Gaussian Process Regression), the platform automatically handles categorical (string) columns for you. No manual encoding is needed. Simply include your categorical column as a model input and the platform takes care of the rest.

***

## How It Works

When you include a categorical column as an input to a tabular model, the platform automatically:

1. **Identifies categorical columns**: any column set to a string/categorical type via the Data Types step is recognised as categorical.
2. **One-hot encodes them**: each unique category value becomes its own binary column (1 if that row matches the category, 0 otherwise). All unique categories present in your training data are encoded.
3. **Drops one category per column**: to avoid redundancy, the first category (alphabetically) is excluded. For example, if a column has values `["aluminium", "copper", "steel"]`, only two binary columns are created internally (`copper` and `steel`). When both are 0, the model knows the value is `aluminium`.
4. **Scales your original numeric columns**: your non-categorical input columns (for example, temperature, pressure) are automatically centred and scaled so that features with different ranges contribute equally to the model. The binary columns created by one-hot encoding are not scaled.

This preprocessing is applied consistently across all tabular model types.

***

## How to Use Categorical Data

1. **Import your data** using the Tabular Loader.
2. **Check column types** in the Data Types step. Ensure your categorical column is set to **Categorical** (string) type. The platform usually detects this automatically, but you can adjust it here if needed.
3. **Add the categorical column as a model input**: select it alongside your numeric columns when configuring the model.
4. **Train the model**: the platform handles the encoding internally.

***

## Things to Be Aware Of

* **All categories are used.** Every unique value in the categorical column is encoded during training. If a column has many unique values (high cardinality), this increases the number of features the model sees internally.
* **One category is always dropped.** The first category alphabetically is excluded to avoid redundancy. This is particularly important for Linear and Polynomial Regression where including all categories can cause training issues. For tree-based models like Random Forest, this has minimal impact.
* **New categories at prediction time.** If a category appears during prediction that was not present in the training data, the platform handles this gracefully: the unknown category is treated as if none of the known categories match. Predictions can still be made without errors.
* **Feature importance may not be available.** When categorical columns are included, the number of features the model sees internally differs from the number of input columns you selected. As a result, per-column feature importance values may not be displayed for some model types.
