Overview
The Model Metadata API provides endpoints to retrieve information about trained demand prediction models, including version, performance metrics, training timestamp, and dataset statistics.Base URL
Get Latest Model
Response
Model version identifier
Training completion timestamp (ISO 8601)
Model performance metrics
Mean Absolute Error
Root Mean Square Error
Mean Absolute Percentage Error
R-squared coefficient
Number of training samples
Number of test samples
Total number of samples in dataset
Machine learning algorithm used (e.g., “Prophet”, “ARIMA”, “XGBoost”)
List of feature names used in the model
Number of vehicle segments with sufficient data for predictions
Status Codes
200 OK- Model metadata retrieved successfully401 Unauthorized- Missing or invalid authentication403 Forbidden- Insufficient permissions404 Not Found- No trained model available
Example
No Model Available Response
If no model has been trained yet, the API returns:Model Metadata Fields
Version
Unique identifier for the model following semantic versioning with timestamp:- Format:
v{major}.{minor}.{patch}-{YYYYMMDD} - Example:
v1.3.0-20260306 - Purpose: Track model lineage and enable rollback
Trained At
ISO 8601 timestamp indicating when training completed:- Format:
YYYY-MM-DDTHH:MM:SSZ - Timezone: UTC
- Example:
2026-03-06T14:35:22Z
Metrics
Performance metrics calculated on the test set:Mean Absolute Error (MAE)
- Description: Average absolute prediction error
- Units: Number of vehicles
- Interpretation: Lower is better
- Good value: < 2.0
Root Mean Square Error (RMSE)
- Description: Standard deviation of prediction errors
- Units: Number of vehicles
- Interpretation: Lower is better, penalizes large errors
- Good value: < 3.0
Mean Absolute Percentage Error (MAPE)
- Description: Average percentage error
- Units: Decimal (0-1)
- Interpretation: Lower is better
- Good value: < 0.20 (20%)
R-squared (R²)
- Description: Proportion of variance explained
- Range: 0-1 (can be negative)
- Interpretation: Higher is better
- Good value: > 0.75
Dataset Statistics
Train Samples
Number of data points used for training the model.Test Samples
Number of data points held out for validation.Total Samples
Sum of training and test samples. Typical split: 80% train, 20% testAlgorithm
The machine learning or statistical algorithm used:- Prophet - Facebook’s time series forecasting library
- ARIMA - Auto-Regressive Integrated Moving Average
- XGBoost - Gradient boosting for regression
- LSTM - Long Short-Term Memory neural network
Features
List of input variables used by the model: Common features:vehicle_type- CAR or MOTORCYCLEbrand- Manufacturermodel- Model yearline- Vehicle line/variantmonth- Month of year (seasonality)year- Year (trend)lag_1,lag_3- Previous months’ salesrolling_mean_3- 3-month moving average
Segments Covered
Number of unique vehicle segments (brand/model/line combinations) with sufficient historical data for predictions.- Higher is better - More coverage means predictions available for more vehicles
- Typical range: 100-500 segments
Use Cases
Model Monitoring Dashboard
Display current model status:Model Comparison
Compare metrics before and after retraining to assess improvement:Health Check
Verify that a model is available before making predictions:Model Staleness Detection
Check if the model needs retraining:Model Quality Assessment
API Documentation Link
For interactive API documentation, visit:Error Responses
401 Unauthorized
403 Forbidden
404 Not Found (No Model)
Health Check Endpoint
The ML service also provides a health check endpoint:/health
Authentication: None (public endpoint)
Response
Example
Integration with Gateway
In production, ML endpoints are typically accessed through the API gateway:- JWT token validation
- Request routing
- Rate limiting
- Logging and monitoring