sony9316/getaround-pricing-api
0
Pricing Optimization API
This is a production-ready FastAPI service that serves your scikit-learn Pipeline. It exposes:
POST /predict— batch predictionsGET /docs— interactive Swagger UIGET /— simple health check
Why this setup?
- The saved artifact
RF_model.joblibcontains both preprocessing and the model, so serving is consistent with training. - The API accepts mixed types (strings/ints/bools/floats) and converts them into a pandas DataFrame with the exact column names used at training, allowing
ColumnTransformerto work reliably.
Expected input format
- Body:
{"input": [[f1, f2, ..., fN], ...]}— 2D list (batch of rows). - Order matters: the order must match
feature_namessaved in your bundle. - Booleans must be JSON booleans (
true/false) — not strings.
Example
{
"input": [[
"Peugeot",
174631,
120,
"diesel",
"black",
"convertible",
true,
true,
false,
false,
false,
false,
true
]]
}
