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
add_column() method.
Availability: This feature requires Fiddler Python Client SDK version 3.11 or later.For detailed API reference, see Model.add_column().
Prerequisites
- An existing model in Fiddler
- Python client installed and initialized (version 3.11+)
- Appropriate permissions to modify the model
Adding a Column
Use theadd_column() method on your model instance to add a new column:
Basic Example
Column Types
Thecolumn_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 set - String (
DataType.STRING): Text data - Boolean (
DataType.BOOLEAN): True/false values - Vector (
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 havenull 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
- Numeric columns may optionally specify custom bins (must span [min, max], be strictly increasing, at most 16 boundary values; integer columns require integer bin values)
- 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
- Create a Project and Model
- Customizing Your Model Schema
- Publishing Production Data
- Model Task Types
Frequently Asked Questions (FAQ)
Q: Can I modify an existing column? A:add_column() is only for adding new columns. To modify an existing column’s properties (like min, max, bins, or categories), update the property on the schema and call model.update():
Note: Bin boundaries must span the column’s existing [min, max] range. If you are also changing the range, update min and max in the same call.See Customizing Your Model Schema for details. 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.