curl --request POST \
--url https://api.example.com/batch_predict \
--header 'Content-Type: application/json' \
--data '
{
"records": [
{}
]
}
'{
"predictions": [
{}
]
}curl --request POST \
--url https://api.example.com/batch_predict \
--header 'Content-Type: application/json' \
--data '
{
"records": [
{}
]
}
'{
"predictions": [
{}
]
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/RaviTejaMedarametla/Data-Science-AI-Portfolio/llms.txt
Use this file to discover all available pages before exploring further.
POST /batch_predict
min_length=1Each record must be a valid PredictRequest object.Show Record Schema
records array must contain:Show Prediction Schema
curl -X POST "http://localhost:8000/batch_predict" \
-H "Content-Type: application/json" \
-H "accept: application/json" \
-d '{
"records": [
{
"student_country": "United States",
"days_on_platform": 45,
"minutes_watched": 320.5,
"courses_started": 3,
"practice_exams_started": 5,
"practice_exams_passed": 3,
"minutes_spent_on_exams": 87.2
},
{
"student_country": "Canada",
"days_on_platform": 12,
"minutes_watched": 45.0,
"courses_started": 1,
"practice_exams_started": 0,
"practice_exams_passed": 0,
"minutes_spent_on_exams": 0.0
},
{
"student_country": "United Kingdom",
"days_on_platform": 90,
"minutes_watched": 1250.0,
"courses_started": 8,
"practice_exams_started": 12,
"practice_exams_passed": 10,
"minutes_spent_on_exams": 340.5
}
]
}'
{
"predictions": [
{
"predicted_purchase_probability": 0.7834,
"predicted_purchase": 1
},
{
"predicted_purchase_probability": 0.2145,
"predicted_purchase": 0
},
{
"predicted_purchase_probability": 0.9512,
"predicted_purchase": 1
}
]
}
{
"detail": "practice_exams_passed cannot exceed practice_exams_started."
}
{
"detail": [
{
"loc": ["body", "records"],
"msg": "ensure this value has at least 1 items",
"type": "value_error.list.min_items"
}
]
}
{
"detail": "Model is not loaded."
}
src/api.py:292-297
Request Model: BatchPredictRequest (src/api.py:42-43)
class BatchPredictRequest(BaseModel):
records: List[PredictRequest] = Field(..., min_length=1)
BatchPredictResponse (src/api.py:46-47)
class BatchPredictResponse(BaseModel):
predictions: List[PredictResponse]
/predict multiple times.
artifacts/prediction_log.jsonl