Updating Model Schema
Learn how to modify your model's schema after initial creation by adding new columns.
Overview
Sometimes you need to add new columns to an existing model in production. Common scenarios include:
Adding new features that weren't in the original training data
Including additional metadata for monitoring purposes
Extending the model with derived features
Adding tracking columns for business metrics
Fiddler allows you to update your model schema programmatically using the Python client's add_column() method.
Prerequisites
An existing model in Fiddler
Python client installed and initialized (version 3.11+)
Appropriate permissions to modify the model
Adding a Column
Use the add_column() method on your model instance to add a new column:
Basic Example
Column Types
The column_type parameter specifies where the column will be used in your model. Available types:
'inputs': Model input features used for predictions'outputs': Model prediction outputs (probabilities, scores, etc.)'targets': Ground truth labels for evaluation'metadata': Tracking/monitoring data (default)
Data Type Examples
Fiddler supports the following data types for model columns:
Integer (
DataType.INTEGER): Whole numbers (e.g., age, count)Float (
DataType.FLOAT): Decimal numbers (e.g., price, score, probability)Category (
DataType.CATEGORY): Categorical values from a predefined setString (
DataType.STRING): Text dataBoolean (
DataType.BOOLEAN): True/false valuesVector (
DataType.VECTOR): Multi-dimensional numerical arrays (embeddings)Timestamp (
DataType.TIMESTAMP): Date and time values
Numeric Column (Integer)
Numeric Column (Float)
Categorical Column
String Column
Boolean Column
Vector Column (Embeddings)
Timestamp Column
Important Considerations
Historical Data
Adding a column doesn't automatically populate historical data. The new column will have null values for all past events. Only newly published events will contain values for the added column.
Additionally, the baseline dataset won't have data for this new column. If you need to compute drift metrics for the new column, upload a new baseline dataset that includes the column data:
Schema Validation
The column definition must pass Fiddler's validation rules:
Column names must be unique within the model
Data types must be valid
Numeric columns should specify min/max ranges
Categorical columns should specify categories
Vector columns must specify dimensions
Publishing Data
After adding a column, remember to include it when publishing new events:
Common Use Cases
Adding Multiple Columns
Adding a Feature Column
Error Handling
Duplicate Column Names
Complete Example
Here's a complete workflow for adding columns to an existing model:
Related Documentation
Frequently Asked Questions (FAQ)
Q: Can I modify an existing column?
A: No, add_column() is only for adding new columns. To modify an existing column's properties (like ranges or categories) after a model has been created, you must use the Fiddler UI. Programmatic modification of existing columns is not currently supported.
Q: What happens to existing alerts and monitors?
A: Existing alerts and monitors continue to work. However, you may want to create new monitors for the added columns.
Q: Can I add multiple columns at once?
A: You need to call add_column() separately for each column. The method updates the model after each addition.