avraux
commited on
Commit
·
f280f60
1
Parent(s):
0a95fff
bug corrigé
Browse files- README.md +31 -3
- __pycache__/app.cpython-313.pyc +0 -0
- __pycache__/inference.cpython-313.pyc +0 -0
- app.py +2 -1
README.md
CHANGED
@@ -16,7 +16,11 @@ Les données d'entrée du modèle sont les suivantes :
|
|
16 |
- lib_mrq_VOLKSWAGEN
|
17 |
- typ_boite_nb_rapp_A 5
|
18 |
- typ_boite_nb_rapp_A 6
|
19 |
-
-
|
|
|
|
|
|
|
|
|
20 |
- Carrosserie_BREAK
|
21 |
- Carrosserie_COUPE
|
22 |
- Carrosserie_MINIBUS
|
@@ -36,11 +40,25 @@ Pour faciliter la réception d'information, on va demander des informations plus
|
|
36 |
"masse_ordma_max": 1500,
|
37 |
"marque": "BMW",
|
38 |
"typ_boite": "A 5",
|
39 |
-
"champ_v9":
|
40 |
"carrosserie": "COUPE",
|
41 |
"gamme": "LUXE"
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
## Exemple d'utilisation
|
46 |
```python
|
@@ -51,6 +69,16 @@ import numpy as np
|
|
51 |
model = joblib.load("model.joblib")
|
52 |
|
53 |
# Effectuer une prédiction
|
54 |
-
input_data =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
prediction = model.predict([input_data])
|
56 |
print(f"Prédiction : {prediction}")
|
|
|
16 |
- lib_mrq_VOLKSWAGEN
|
17 |
- typ_boite_nb_rapp_A 5
|
18 |
- typ_boite_nb_rapp_A 6
|
19 |
+
- champ_v9_"715/2007*195/2013EURO5
|
20 |
+
- champ_v9_"715/2007*195/2013EURO6
|
21 |
+
- champ_v9_"715/2007*566/2011EURO5
|
22 |
+
- champ_v9_"715/2007*630/2012EURO5
|
23 |
+
- champ_v9_715/2007*195/2013EURO5
|
24 |
- Carrosserie_BREAK
|
25 |
- Carrosserie_COUPE
|
26 |
- Carrosserie_MINIBUS
|
|
|
40 |
"masse_ordma_max": 1500,
|
41 |
"marque": "BMW",
|
42 |
"typ_boite": "A 5",
|
43 |
+
"champ_v9": "715/2007*195/2013EURO5",
|
44 |
"carrosserie": "COUPE",
|
45 |
"gamme": "LUXE"
|
46 |
}
|
47 |
|
48 |
+
puiss_admin_98 : Puissance administrative de la voiture (Entier)
|
49 |
+
conso_urb : Consommation d'essence en ville L/1OOkm (Entier à 1 décimale)
|
50 |
+
conso_exurb : Consommation d'essence en campagne L/1OOkm (Entier à 1 décimale)
|
51 |
+
masse_ordma_max : Masse du véhicule
|
52 |
+
marque : Marque du véhicule parmi
|
53 |
+
["BMW", "MERCEDES", "VOLKSWAGEN"]
|
54 |
+
typ_boite : Type de boite de vitesse parmi
|
55 |
+
["A 5", "A 6", "A 7", "A 8", "M 5", "M 6"]
|
56 |
+
champ_v9 : type de norme parmi
|
57 |
+
["715/2007*195/2013EURO5", "715/2007*630/2012EURO5", "715/2007*692/2008EURO5"]
|
58 |
+
carrosserie : type de carrosserie parmi
|
59 |
+
["BREAK", "COUPE", "MINIBUS", "TS TERRAINS/CHEMINS"]
|
60 |
+
gamme : gamme du véhicule parmi
|
61 |
+
["INFERIEURE", "LUXE", "MOY-INFERIEURE", "MOY-SUPER", "SUPERIEURE"]
|
62 |
|
63 |
## Exemple d'utilisation
|
64 |
```python
|
|
|
69 |
model = joblib.load("model.joblib")
|
70 |
|
71 |
# Effectuer une prédiction
|
72 |
+
input_data = {
|
73 |
+
"puiss_admin_98": 7,
|
74 |
+
"conso_urb": 5.6,
|
75 |
+
"conso_exurb": 4.3,
|
76 |
+
"masse_ordma_max": 1500,
|
77 |
+
"marque": "BMW",
|
78 |
+
"typ_boite": "A 5",
|
79 |
+
"champ_v9": "715/2007*195/2013EURO5"
|
80 |
+
"carrosserie": "COUPE",
|
81 |
+
"gamme": "LUXE"
|
82 |
+
}
|
83 |
prediction = model.predict([input_data])
|
84 |
print(f"Prédiction : {prediction}")
|
__pycache__/app.cpython-313.pyc
ADDED
Binary file (1.17 kB). View file
|
|
__pycache__/inference.cpython-313.pyc
ADDED
Binary file (2.85 kB). View file
|
|
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from pydantic import BaseModel
|
|
|
3 |
|
4 |
# Définir l'API
|
5 |
app = FastAPI()
|
@@ -12,7 +13,7 @@ class InputData(BaseModel):
|
|
12 |
masse_ordma_max: float
|
13 |
marque: str
|
14 |
typ_boite: str
|
15 |
-
champ_v9 :
|
16 |
carrosserie: str
|
17 |
gamme: str
|
18 |
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from pydantic import BaseModel
|
3 |
+
from inference import preprocess_and_predict
|
4 |
|
5 |
# Définir l'API
|
6 |
app = FastAPI()
|
|
|
13 |
masse_ordma_max: float
|
14 |
marque: str
|
15 |
typ_boite: str
|
16 |
+
champ_v9 : str
|
17 |
carrosserie: str
|
18 |
gamme: str
|
19 |
|