Predictions
Overview
Quick Start
from viewai_client import ViewAIClient
# Initialize client
client = ViewAIClient(api_key="your-api-key")
# Single prediction
result = client.execute_single_point_prediction(
data={"age": 35, "income": 50000},
model_id="model-123"
)
# Batch prediction
job = client.execute_batch_prediction(
data=[{"age": 35}, {"age": 42}],
model_id="model-123",
wait_for_completion=True
)Single-Point Predictions
Basic Usage
Using the Service Directly
Input Data Format
Validating Input Data
Batch Predictions
Basic Usage
Using Lists Instead of DataFrames
Asynchronous Batch Processing
Monitoring Job Progress
Retrieving Batch Results
Interpreting Results
Understanding the Prediction Class
Dictionary-Style Access
Classification Results
Regression Results
Error Handling
Common Prediction Errors
Handling Invalid Model IDs
Handling Missing Features
Batch Prediction Error Handling
Performance Considerations
When to Use Single vs. Batch Predictions
Optimizing Single Predictions
Optimizing Batch Predictions
Caching Predictions
Best Practices
See Also
Was this helpful?