Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from flask import Flask, request, jsonify # For creating the Flask API
|
|
| 8 |
store_sales_predictor_api = Flask("SuperKart Store Sales Predictor")
|
| 9 |
|
| 10 |
# Load the trained machine learning model
|
| 11 |
-
model = joblib.load("
|
| 12 |
|
| 13 |
# Define a route for the home page (GET request)
|
| 14 |
@store_sales_predictor_api.get('/')
|
|
@@ -32,15 +32,15 @@ def predict_store_sales():
|
|
| 32 |
|
| 33 |
# Extract relevant features from the JSON data
|
| 34 |
sample = {
|
| 35 |
-
'
|
| 36 |
-
'
|
| 37 |
-
'
|
| 38 |
-
'
|
| 39 |
-
'
|
| 40 |
-
'
|
| 41 |
-
'
|
| 42 |
-
'
|
| 43 |
-
'
|
| 44 |
}
|
| 45 |
|
| 46 |
# Convert the extracted data into a Pandas DataFrame
|
|
|
|
| 8 |
store_sales_predictor_api = Flask("SuperKart Store Sales Predictor")
|
| 9 |
|
| 10 |
# Load the trained machine learning model
|
| 11 |
+
model = joblib.load("store_sales_prediction_model_v1_0.joblib")
|
| 12 |
|
| 13 |
# Define a route for the home page (GET request)
|
| 14 |
@store_sales_predictor_api.get('/')
|
|
|
|
| 32 |
|
| 33 |
# Extract relevant features from the JSON data
|
| 34 |
sample = {
|
| 35 |
+
'product_weight': sales_data['Product_Weight'],
|
| 36 |
+
'product_sugar_content': sales_data['Product_Sugar_Content'],
|
| 37 |
+
'product_allocated_area': sales_data['Product_Allocated_Area'],
|
| 38 |
+
'product_type': sales_data['Product_Type'],
|
| 39 |
+
'product_mrp': sales_data['Product_MRP'],
|
| 40 |
+
'store_id': sales_data['Store_Id'],
|
| 41 |
+
'store_size': sales_data['Store_Size'],
|
| 42 |
+
'store_location_city_type': sales_data['Store_Location_City_Type'],
|
| 43 |
+
'store_type': sales_data['Store_Type']
|
| 44 |
}
|
| 45 |
|
| 46 |
# Convert the extracted data into a Pandas DataFrame
|