Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,28 +111,28 @@ async def predict(predictionFeatures: RentalFeatures):
|
|
| 111 |
Prediction of car daily rental cost for a given properties of a car !
|
| 112 |
"""
|
| 113 |
# Read data
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
car_caracteristic = pd.DataFrame([
|
| 130 |
logger.info('Started')
|
| 131 |
|
| 132 |
logger.info(car_caracteristic)
|
| 133 |
#car_caracteristic = pd.DataFrame({"Car": pf})
|
| 134 |
# Log model from mlflow
|
| 135 |
-
logged_model = "models:/getaround-price-prediction-model
|
| 136 |
#logged_model = "runs:/d3856ef1a2ee42db989496949f47ac74/getaround-price-prediction-model"
|
| 137 |
# Load model as a PyFuncModel.
|
| 138 |
loaded_model = mlflow.pyfunc.load_model(logged_model)
|
|
|
|
| 111 |
Prediction of car daily rental cost for a given properties of a car !
|
| 112 |
"""
|
| 113 |
# Read data
|
| 114 |
+
pf = [
|
| 115 |
+
predictionFeatures.model_key or "Peugeot",
|
| 116 |
+
predictionFeatures.mileage or 0,
|
| 117 |
+
predictionFeatures.engine_power or 0,
|
| 118 |
+
predictionFeatures.fuel or "petrol",
|
| 119 |
+
predictionFeatures.car_type or "sedan",
|
| 120 |
+
predictionFeatures.private_parking_available or 1,
|
| 121 |
+
predictionFeatures.has_gps or 0,
|
| 122 |
+
predictionFeatures.has_air_conditioning or 0,
|
| 123 |
+
predictionFeatures.automatic_car or 0,
|
| 124 |
+
predictionFeatures.has_getaround_connect or 0,
|
| 125 |
+
predictionFeatures.has_speed_regulator or 0,
|
| 126 |
+
predictionFeatures.winter_tires or 0,
|
| 127 |
+
]
|
| 128 |
+
|
| 129 |
+
car_caracteristic = pd.DataFrame([pf])
|
| 130 |
logger.info('Started')
|
| 131 |
|
| 132 |
logger.info(car_caracteristic)
|
| 133 |
#car_caracteristic = pd.DataFrame({"Car": pf})
|
| 134 |
# Log model from mlflow
|
| 135 |
+
logged_model = "models:/getaround-price-prediction-model@champion" # REPLACE WITH YOUR OWN RUN ID
|
| 136 |
#logged_model = "runs:/d3856ef1a2ee42db989496949f47ac74/getaround-price-prediction-model"
|
| 137 |
# Load model as a PyFuncModel.
|
| 138 |
loaded_model = mlflow.pyfunc.load_model(logged_model)
|