File size: 1,793 Bytes
31954ac
 
 
 
 
 
 
 
 
 
4e47a55
 
 
 
 
 
 
 
 
 
 
 
 
58d71f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e47a55
 
 
 
 
58d71f3
4e47a55
 
 
 
 
58d71f3
4e47a55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7ba4981
4e47a55
 
 
 
 
 
31954ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: Fastapi Get
emoji: 🏢
colorFrom: yellow
colorTo: green
sdk: docker
pinned: false
license: apache-2.0
---

🚗 Getaround Car Rental - API de Prédiction

Cette API permet de prédire le prix journalier de location d’un véhicule sur Getaround, en fonction de ses caractéristiques techniques (marque, type de carburant, puissance moteur, etc.).

Elle est basée sur un modèle XGBoost optimisé et hébergée sur Hugging Face Spaces avec FastAPI.

⚡ Endpoints disponibles
🔹 POST /predict

Prédit le prix de location journalier.

Méthode : POST

curl -X POST "https://gdleds-api-gat.hf.space/predict" \
-H "Content-Type: application/json" \
-d '{
  "model_key": "Audi",
  "mileage": 100000,
  "engine_power": 120,
  "fuel": "diesel",
  "paint_color": "black",
  "car_type": "estate",
  "private_parking_available": true,
  "has_gps": true,
  "has_air_conditioning": false,
  "automatic_car": false,
  "has_getaround_connect": true,
  "has_speed_regulator": false,
  "winter_tires": true
}'


Sortie (JSON) :

{
  "predicted_price_per_day":124.9
}

🔹 GET /docs

Accès à la documentation interactive (Swagger UI).
👉 Exemple : https://gdleds-api-get.hf.space/docs

🛠️ Stack technique

Python 3.10

FastAPI + Uvicorn

XGBoost

scikit-learn

Hugging Face Spaces

Stockage du modèle sur S3 (Amazon)

🚀 Exemple avec curl
curl -X POST "https://ton-espace.hf.space/predict" \
-H "Content-Type: application/json" \
-d '{"input": [[100000, 120, "diesel", "black", "estate", 1, 1, 0, 0, 1, 0, 1]]}'

📦 Déploiement local (optionnel)

Pour tester localement :

uvicorn app:app --reload --host 0.0.0.0 --port 8000


Puis tester avec :
👉 http://127.0.0.1:8000/docs


Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference