vijayendras commited on
Commit
e1f4801
·
verified ·
1 Parent(s): d8488d3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +10 -10
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("storel_sales_prediction_model_v1_0.joblib")
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
- '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
 
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