├── models ├── lr.sav └── sc.sav ├── README.MD ├── app.py └── templates └── home.html /models/lr.sav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pydeveloperashish/BigMart-Sales-Prediction-With-Deployment/HEAD/models/lr.sav -------------------------------------------------------------------------------- /models/sc.sav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pydeveloperashish/BigMart-Sales-Prediction-With-Deployment/HEAD/models/sc.sav -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | Tutorial Link:- https://youtube.com/live/kgjZAHCTGNI 2 | 3 | If you have any doubt you can DM me on Instagram. 4 | My Insta ID:- https://www.instagram.com/developer_ashish.py 5 | 6 | Lets connect on LinkedIn:- https://www.linkedin.com/in/ashish-kushwaha-45201b179 7 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, jsonify, render_template, request 2 | import joblib 3 | import os 4 | import numpy as np 5 | 6 | app = Flask(__name__) 7 | 8 | 9 | @app.route("/") 10 | def index(): 11 | return render_template("home.html") 12 | 13 | @app.route('/predict',methods=['POST','GET']) 14 | def result(): 15 | 16 | item_weight= float(request.form['item_weight']) 17 | item_fat_content=float(request.form['item_fat_content']) 18 | item_visibility= float(request.form['item_visibility']) 19 | item_type= float(request.form['item_type']) 20 | item_mrp = float(request.form['item_mrp']) 21 | outlet_establishment_year= float(request.form['outlet_establishment_year']) 22 | outlet_size= float(request.form['outlet_size']) 23 | outlet_location_type= float(request.form['outlet_location_type']) 24 | outlet_type= float(request.form['outlet_type']) 25 | 26 | X= np.array([[ item_weight,item_fat_content,item_visibility,item_type,item_mrp, 27 | outlet_establishment_year,outlet_size,outlet_location_type,outlet_type ]]) 28 | 29 | scaler_path= r'D:\BigMart-Sales-Prediction-using-Machine-Learning-main (1)\BigMart-Sales-Prediction-using-Machine-Learning-main\models\sc.sav' 30 | 31 | sc=joblib.load(scaler_path) 32 | 33 | X_std= sc.transform(X) 34 | 35 | model_path=r'D:\BigMart-Sales-Prediction-using-Machine-Learning-main (1)\BigMart-Sales-Prediction-using-Machine-Learning-main\models\lr.sav' 36 | 37 | model= joblib.load(model_path) 38 | 39 | Y_pred=model.predict(X_std) 40 | 41 | return jsonify({'Prediction': float(Y_pred)}) 42 | 43 | if __name__ == "__main__": 44 | app.run(debug=True, port=9457) 45 | -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |