Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -17,20 +17,20 @@ def home():
|
|
| 17 |
@sales_revenue_predictor_api.post('/v1/product_sales_revenue')
|
| 18 |
def predict_churn():
|
| 19 |
# Get JSON data from the request
|
| 20 |
-
|
| 21 |
|
| 22 |
# Extract relevant customer features from the input data
|
| 23 |
sample = {
|
| 24 |
-
'Product_Weight':
|
| 25 |
-
'Product_Sugar_Content':
|
| 26 |
-
'Product_Allocated_Area':
|
| 27 |
-
'Product_Type':
|
| 28 |
-
'Product_MRP':
|
| 29 |
-
'Store_Id':
|
| 30 |
-
'Store_Establishment_Year':
|
| 31 |
-
'Store_Size':
|
| 32 |
-
'Store_Location_City_Type':
|
| 33 |
-
'Store_Type':
|
| 34 |
}
|
| 35 |
|
| 36 |
# Convert the extracted data into a DataFrame
|
|
|
|
| 17 |
@sales_revenue_predictor_api.post('/v1/product_sales_revenue')
|
| 18 |
def predict_churn():
|
| 19 |
# Get JSON data from the request
|
| 20 |
+
product_data = request.get_json()
|
| 21 |
|
| 22 |
# Extract relevant customer features from the input data
|
| 23 |
sample = {
|
| 24 |
+
'Product_Weight': product_data.get('Product_Weight'),
|
| 25 |
+
'Product_Sugar_Content': product_data.get('Product_Sugar_Content'),
|
| 26 |
+
'Product_Allocated_Area': product_data.get('Product_Allocated_Area'),
|
| 27 |
+
'Product_Type': product_data.get('Product_Type'),
|
| 28 |
+
'Product_MRP': product_data.get('Product_MRP'),
|
| 29 |
+
'Store_Id': product_data.get('Store_Id'),
|
| 30 |
+
'Store_Establishment_Year': product_data.get('Store_Establishment_Year'),
|
| 31 |
+
'Store_Size': product_data.get('Store_Size'),
|
| 32 |
+
'Store_Location_City_Type': product_data.get('Store_Location_City_Type'),
|
| 33 |
+
'Store_Type': product_data.get('Store_Type')
|
| 34 |
}
|
| 35 |
|
| 36 |
# Convert the extracted data into a DataFrame
|