Spaces:
Sleeping
Sleeping
metadata
title: Pricing Optimization API
emoji: π
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
license: mit
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
]]
}