Schema Management
Overview
Understanding Schemas
Schema Structure
{
"model_id": "my_model",
"fields": {
"age": {
"type": "int",
"min": 0,
"max": 120
},
"income": {
"type": "float",
"min": 0.0,
"max": 1000000.0,
"mean": 55000.0,
"std": 25000.0,
"missing_count": 0
},
"region": {
"type": "category",
"choices": ["north", "south", "east", "west"],
"allow_new_categories": False,
"n_unique": 4,
"missing_count": 0
}
},
"metadata": {
"created_at": "2025-10-11T12:00:00",
"n_features": 3,
"n_samples": 10000,
"model_type": "RandomForestClassifier"
}
}Automatic Schema Generation
Basic Schema Generation
Controlling Category Handling
Custom Schema Definition
Defining Schemas Manually
Updating Schema Fields
Schema Validation
Using SchemaValidator
Validating Data Against Schema
Non-Strict Validation
Schema Comparison
Comparing Schemas
Detecting Breaking Changes
Generating Migration Plans
Schema Export and Import
Exporting Schemas
Export to JSON
Export to Markdown Documentation
Importing Schemas
Schema Versioning
Version Control Best Practices
API Integration
Uploading Schemas to ViewAI
Fetching Schemas from ViewAI
Saving Schemas Locally
ModelSchemaManager Reference
Initialization
Core Methods
Handling Missing Values
Configuring Missing Value Rules
Complete Example
Best Practices
Troubleshooting
Next Steps
Was this helpful?