├── .gitignore ├── 0.1 Car_Price_Prediction ├── Procfile ├── app.py ├── car data.csv ├── car_model.pkl ├── car_price_prediction.py ├── main.py ├── requirements.txt ├── static │ └── css │ │ └── register.css └── templates │ ├── cccc.png │ └── index.html ├── 2.0 Sentiment analysis ├── Procfile ├── app.py ├── app.yaml ├── main.py ├── requirements.txt ├── sentiment_model1.pkl ├── sentiment_vectorizer.pkl ├── static │ ├── people_photo │ │ └── plot.png │ └── register.css └── templates │ ├── index.html │ ├── nlp.jpg │ └── result.html ├── 3. Breast Cancer Wisconsin (Diagnostic) ├── Breast-Cancer-Dataset.csv ├── Breast-Cancer.ipynb ├── Breast-Cancer.sav └── Explanation.docx ├── 4. Diabete ├── Diabete.ipynb ├── Explanation.docx ├── diabetes.csv └── diabetes_model.sav ├── 5. Indian Liver Patient ├── Explanation.docx ├── Liver_disease.sav ├── indian_liver_patient.csv └── indian_liver_patient.ipynb ├── 6. Chronic KIdney Disease ├── Chronic-KIdney-Disease-dataset.csv ├── Explanation.docx ├── Kidney-Disease .ipynb └── Kidney-Disease.sav ├── 7. Maleria Cell Images ├── malaria-cell-cnn.h5 └── malaria_cells_image_classification.ipynb ├── 8. Cardiovascular_Disease ├── Cardiovascular_Disease.ipynb ├── Cardiovascular_Disease_dataset.csv ├── Cardiovascular_Disease_model.sav ├── Explanation.docx ├── cardio.csv └── notebook30ebc5777e.ipynb ├── 9. Heart_Disease_UCI ├── Explanation.docx ├── Heart_Disease_UCI.ipynb ├── Heart_Disease_UCI.sav ├── Report.PNG └── heart_disease_dataset.csv ├── DNA_classification ├── .ds_Store └── Clasification_Of_dna.ipynb ├── House_price_pridiction ├── HousePricePrediction.ipynb ├── read.md ├── test.csv └── train.csv ├── LICENSE ├── Prediction-And-Analysis-of-crime ├── crime-clean.csv ├── crime-full.csv ├── crime_prediction-checkpoint.ipynb └── read.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Object file 2 | *.o 3 | 4 | # Ada Library Information 5 | *.ali 6 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn app:app 2 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/app.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Wed Jul 1 19:25:53 2020 4 | 5 | @author: Gaurav 6 | """ 7 | 8 | from flask import Flask, render_template, request 9 | import pickle 10 | import numpy as np 11 | from sklearn.preprocessing import StandardScaler 12 | from datetime import date 13 | 14 | 15 | app=Flask(__name__) 16 | model=pickle.load(open("car_model.pkl","rb")) 17 | 18 | standard_to=StandardScaler() 19 | 20 | @app.route("/",methods=['GET']) 21 | def Home(): 22 | return render_template('index.html') 23 | 24 | 25 | @app.route("/predict",methods=['POST']) 26 | def predict(): 27 | fuel_Type_Diesel=0 28 | if request.method=='POST': 29 | Year=int(request.form['Year']) 30 | Present_Price=float(request.form['Present_Price']) 31 | Kms_Driven=int(request.form['Kms_Driven']) 32 | Kms_Driven2=np.log(Kms_Driven) 33 | Owner=int(request.form['Owner']) 34 | Fuel_Type_Petrol=request.form['Fuel_Type_Petrol'] 35 | if(Fuel_Type_Petrol=='Petrol'): 36 | Fuel_Type_Petrol=1 37 | Fuel_Type_Diesel=0 38 | else: 39 | Fuel_Type_Petrol=0 40 | Fuel_Type_Diesel=1 41 | 42 | Year=date.today().year-Year 43 | # Year=2020-Year 44 | Seller_Type_Individual=request.form['Seller_Type_Individual'] 45 | if(Seller_Type_Individual=='Individual'): 46 | Seller_Type_Individual=1 47 | else: 48 | Seller_Type_Individual=0 49 | Transmission_Mannual=request.form['Transmission_Mannual'] 50 | if(Transmission_Mannual=='Mannual'): 51 | Transmission_Mannual=1 52 | else: 53 | Transmission_Mannual=0 54 | prediction=model.predict([[Present_Price,Kms_Driven2,Owner,Year,Fuel_Type_Diesel,Fuel_Type_Petrol,Seller_Type_Individual,Transmission_Mannual]]) 55 | output=round(prediction[0],2) 56 | if output<0: 57 | return render_template('index.html',prediction_texts="Sorry you cannot sell this car") 58 | else: 59 | return render_template('index.html',prediction_text="You Can Sell The Car at {}".format(output)) 60 | else: 61 | return render_template('index.html') 62 | 63 | 64 | if __name__=="__main__": 65 | app.run() 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/car data.csv: -------------------------------------------------------------------------------- 1 | Car_Name,Year,Selling_Price,Present_Price,Kms_Driven,Fuel_Type,Seller_Type,Transmission,Owner 2 | ritz,2014,3.35,5.59,27000,Petrol,Dealer,Manual,0 3 | sx4,2013,4.75,9.54,43000,Diesel,Dealer,Manual,0 4 | ciaz,2017,7.25,9.85,6900,Petrol,Dealer,Manual,0 5 | wagon r,2011,2.85,4.15,5200,Petrol,Dealer,Manual,0 6 | swift,2014,4.6,6.87,42450,Diesel,Dealer,Manual,0 7 | vitara brezza,2018,9.25,9.83,2071,Diesel,Dealer,Manual,0 8 | ciaz,2015,6.75,8.12,18796,Petrol,Dealer,Manual,0 9 | s cross,2015,6.5,8.61,33429,Diesel,Dealer,Manual,0 10 | ciaz,2016,8.75,8.89,20273,Diesel,Dealer,Manual,0 11 | ciaz,2015,7.45,8.92,42367,Diesel,Dealer,Manual,0 12 | alto 800,2017,2.85,3.6,2135,Petrol,Dealer,Manual,0 13 | ciaz,2015,6.85,10.38,51000,Diesel,Dealer,Manual,0 14 | ciaz,2015,7.5,9.94,15000,Petrol,Dealer,Automatic,0 15 | ertiga,2015,6.1,7.71,26000,Petrol,Dealer,Manual,0 16 | dzire,2009,2.25,7.21,77427,Petrol,Dealer,Manual,0 17 | ertiga,2016,7.75,10.79,43000,Diesel,Dealer,Manual,0 18 | ertiga,2015,7.25,10.79,41678,Diesel,Dealer,Manual,0 19 | ertiga,2016,7.75,10.79,43000,Diesel,Dealer,Manual,0 20 | wagon r,2015,3.25,5.09,35500,CNG,Dealer,Manual,0 21 | sx4,2010,2.65,7.98,41442,Petrol,Dealer,Manual,0 22 | alto k10,2016,2.85,3.95,25000,Petrol,Dealer,Manual,0 23 | ignis,2017,4.9,5.71,2400,Petrol,Dealer,Manual,0 24 | sx4,2011,4.4,8.01,50000,Petrol,Dealer,Automatic,0 25 | alto k10,2014,2.5,3.46,45280,Petrol,Dealer,Manual,0 26 | wagon r,2013,2.9,4.41,56879,Petrol,Dealer,Manual,0 27 | swift,2011,3,4.99,20000,Petrol,Dealer,Manual,0 28 | swift,2013,4.15,5.87,55138,Petrol,Dealer,Manual,0 29 | swift,2017,6,6.49,16200,Petrol,Individual,Manual,0 30 | alto k10,2010,1.95,3.95,44542,Petrol,Dealer,Manual,0 31 | ciaz,2015,7.45,10.38,45000,Diesel,Dealer,Manual,0 32 | ritz,2012,3.1,5.98,51439,Diesel,Dealer,Manual,0 33 | ritz,2011,2.35,4.89,54200,Petrol,Dealer,Manual,0 34 | swift,2014,4.95,7.49,39000,Diesel,Dealer,Manual,0 35 | ertiga,2014,6,9.95,45000,Diesel,Dealer,Manual,0 36 | dzire,2014,5.5,8.06,45000,Diesel,Dealer,Manual,0 37 | sx4,2011,2.95,7.74,49998,CNG,Dealer,Manual,0 38 | dzire,2015,4.65,7.2,48767,Petrol,Dealer,Manual,0 39 | 800,2003,0.35,2.28,127000,Petrol,Individual,Manual,0 40 | alto k10,2016,3,3.76,10079,Petrol,Dealer,Manual,0 41 | sx4,2003,2.25,7.98,62000,Petrol,Dealer,Manual,0 42 | baleno,2016,5.85,7.87,24524,Petrol,Dealer,Automatic,0 43 | alto k10,2014,2.55,3.98,46706,Petrol,Dealer,Manual,0 44 | sx4,2008,1.95,7.15,58000,Petrol,Dealer,Manual,0 45 | dzire,2014,5.5,8.06,45780,Diesel,Dealer,Manual,0 46 | omni,2012,1.25,2.69,50000,Petrol,Dealer,Manual,0 47 | ciaz,2014,7.5,12.04,15000,Petrol,Dealer,Automatic,0 48 | ritz,2013,2.65,4.89,64532,Petrol,Dealer,Manual,0 49 | wagon r,2006,1.05,4.15,65000,Petrol,Dealer,Manual,0 50 | ertiga,2015,5.8,7.71,25870,Petrol,Dealer,Manual,0 51 | ciaz,2017,7.75,9.29,37000,Petrol,Dealer,Automatic,0 52 | fortuner,2012,14.9,30.61,104707,Diesel,Dealer,Automatic,0 53 | fortuner,2015,23,30.61,40000,Diesel,Dealer,Automatic,0 54 | innova,2017,18,19.77,15000,Diesel,Dealer,Automatic,0 55 | fortuner,2013,16,30.61,135000,Diesel,Individual,Automatic,0 56 | innova,2005,2.75,10.21,90000,Petrol,Individual,Manual,0 57 | corolla altis,2009,3.6,15.04,70000,Petrol,Dealer,Automatic,0 58 | etios cross,2015,4.5,7.27,40534,Petrol,Dealer,Manual,0 59 | corolla altis,2010,4.75,18.54,50000,Petrol,Dealer,Manual,0 60 | etios g,2014,4.1,6.8,39485,Petrol,Dealer,Manual,1 61 | fortuner,2014,19.99,35.96,41000,Diesel,Dealer,Automatic,0 62 | corolla altis,2013,6.95,18.61,40001,Petrol,Dealer,Manual,0 63 | etios cross,2015,4.5,7.7,40588,Petrol,Dealer,Manual,0 64 | fortuner,2014,18.75,35.96,78000,Diesel,Dealer,Automatic,0 65 | fortuner,2015,23.5,35.96,47000,Diesel,Dealer,Automatic,0 66 | fortuner,2017,33,36.23,6000,Diesel,Dealer,Automatic,0 67 | etios liva,2014,4.75,6.95,45000,Diesel,Dealer,Manual,0 68 | innova,2017,19.75,23.15,11000,Petrol,Dealer,Automatic,0 69 | fortuner,2010,9.25,20.45,59000,Diesel,Dealer,Manual,0 70 | corolla altis,2011,4.35,13.74,88000,Petrol,Dealer,Manual,0 71 | corolla altis,2016,14.25,20.91,12000,Petrol,Dealer,Manual,0 72 | etios liva,2014,3.95,6.76,71000,Diesel,Dealer,Manual,0 73 | corolla altis,2011,4.5,12.48,45000,Diesel,Dealer,Manual,0 74 | corolla altis,2013,7.45,18.61,56001,Petrol,Dealer,Manual,0 75 | etios liva,2011,2.65,5.71,43000,Petrol,Dealer,Manual,0 76 | etios cross,2014,4.9,8.93,83000,Diesel,Dealer,Manual,0 77 | etios g,2015,3.95,6.8,36000,Petrol,Dealer,Manual,0 78 | corolla altis,2013,5.5,14.68,72000,Petrol,Dealer,Manual,0 79 | corolla,2004,1.5,12.35,135154,Petrol,Dealer,Automatic,0 80 | corolla altis,2010,5.25,22.83,80000,Petrol,Dealer,Automatic,0 81 | fortuner,2012,14.5,30.61,89000,Diesel,Dealer,Automatic,0 82 | corolla altis,2016,14.73,14.89,23000,Diesel,Dealer,Manual,0 83 | etios gd,2015,4.75,7.85,40000,Diesel,Dealer,Manual,0 84 | innova,2017,23,25.39,15000,Diesel,Dealer,Automatic,0 85 | innova,2015,12.5,13.46,38000,Diesel,Dealer,Manual,0 86 | innova,2005,3.49,13.46,197176,Diesel,Dealer,Manual,0 87 | camry,2006,2.5,23.73,142000,Petrol,Individual,Automatic,3 88 | land cruiser,2010,35,92.6,78000,Diesel,Dealer,Manual,0 89 | corolla altis,2012,5.9,13.74,56000,Petrol,Dealer,Manual,0 90 | etios liva,2013,3.45,6.05,47000,Petrol,Dealer,Manual,0 91 | etios g,2014,4.75,6.76,40000,Petrol,Dealer,Manual,0 92 | corolla altis,2009,3.8,18.61,62000,Petrol,Dealer,Manual,0 93 | innova,2014,11.25,16.09,58242,Diesel,Dealer,Manual,0 94 | innova,2005,3.51,13.7,75000,Petrol,Dealer,Manual,0 95 | fortuner,2015,23,30.61,40000,Diesel,Dealer,Automatic,0 96 | corolla altis,2008,4,22.78,89000,Petrol,Dealer,Automatic,0 97 | corolla altis,2012,5.85,18.61,72000,Petrol,Dealer,Manual,0 98 | innova,2016,20.75,25.39,29000,Diesel,Dealer,Automatic,0 99 | corolla altis,2017,17,18.64,8700,Petrol,Dealer,Manual,0 100 | corolla altis,2013,7.05,18.61,45000,Petrol,Dealer,Manual,0 101 | fortuner,2010,9.65,20.45,50024,Diesel,Dealer,Manual,0 102 | Royal Enfield Thunder 500,2016,1.75,1.9,3000,Petrol,Individual,Manual,0 103 | UM Renegade Mojave,2017,1.7,1.82,1400,Petrol,Individual,Manual,0 104 | KTM RC200,2017,1.65,1.78,4000,Petrol,Individual,Manual,0 105 | Bajaj Dominar 400,2017,1.45,1.6,1200,Petrol,Individual,Manual,0 106 | Royal Enfield Classic 350,2017,1.35,1.47,4100,Petrol,Individual,Manual,0 107 | KTM RC390,2015,1.35,2.37,21700,Petrol,Individual,Manual,0 108 | Hyosung GT250R,2014,1.35,3.45,16500,Petrol,Individual,Manual,1 109 | Royal Enfield Thunder 350,2013,1.25,1.5,15000,Petrol,Individual,Manual,0 110 | Royal Enfield Thunder 350,2016,1.2,1.5,18000,Petrol,Individual,Manual,0 111 | Royal Enfield Classic 350,2017,1.2,1.47,11000,Petrol,Individual,Manual,0 112 | KTM RC200,2016,1.2,1.78,6000,Petrol,Individual,Manual,0 113 | Royal Enfield Thunder 350,2016,1.15,1.5,8700,Petrol,Individual,Manual,0 114 | KTM 390 Duke ,2014,1.15,2.4,7000,Petrol,Individual,Manual,0 115 | Mahindra Mojo XT300,2016,1.15,1.4,35000,Petrol,Individual,Manual,0 116 | Royal Enfield Classic 350,2015,1.15,1.47,17000,Petrol,Individual,Manual,0 117 | Royal Enfield Classic 350,2015,1.11,1.47,17500,Petrol,Individual,Manual,0 118 | Royal Enfield Classic 350,2013,1.1,1.47,33000,Petrol,Individual,Manual,0 119 | Royal Enfield Thunder 500,2015,1.1,1.9,14000,Petrol,Individual,Manual,0 120 | Royal Enfield Classic 350,2015,1.1,1.47,26000,Petrol,Individual,Manual,0 121 | Royal Enfield Thunder 500,2013,1.05,1.9,5400,Petrol,Individual,Manual,0 122 | Bajaj Pulsar RS200,2016,1.05,1.26,5700,Petrol,Individual,Manual,0 123 | Royal Enfield Thunder 350,2011,1.05,1.5,6900,Petrol,Individual,Manual,0 124 | Royal Enfield Bullet 350,2016,1.05,1.17,6000,Petrol,Individual,Manual,0 125 | Royal Enfield Classic 350,2013,1,1.47,46500,Petrol,Individual,Manual,0 126 | Royal Enfield Classic 500,2012,0.95,1.75,11500,Petrol,Individual,Manual,0 127 | Royal Enfield Classic 500,2009,0.9,1.75,40000,Petrol,Individual,Manual,0 128 | Bajaj Avenger 220,2017,0.9,0.95,1300,Petrol,Individual,Manual,0 129 | Bajaj Avenger 150,2016,0.75,0.8,7000,Petrol,Individual,Manual,0 130 | Honda CB Hornet 160R,2017,0.8,0.87,3000,Petrol,Individual,Manual,0 131 | Yamaha FZ S V 2.0,2017,0.78,0.84,5000,Petrol,Individual,Manual,0 132 | Honda CB Hornet 160R,2017,0.75,0.87,11000,Petrol,Individual,Manual,0 133 | Yamaha FZ 16,2015,0.75,0.82,18000,Petrol,Individual,Manual,0 134 | Bajaj Avenger 220,2017,0.75,0.95,3500,Petrol,Individual,Manual,0 135 | Bajaj Avenger 220,2016,0.72,0.95,500,Petrol,Individual,Manual,0 136 | TVS Apache RTR 160,2017,0.65,0.81,11800,Petrol,Individual,Manual,0 137 | Bajaj Pulsar 150,2015,0.65,0.74,5000,Petrol,Individual,Manual,0 138 | Honda CBR 150,2014,0.65,1.2,23500,Petrol,Individual,Manual,0 139 | Hero Extreme,2013,0.65,0.787,16000,Petrol,Individual,Manual,0 140 | Honda CB Hornet 160R,2016,0.6,0.87,15000,Petrol,Individual,Manual,0 141 | Bajaj Avenger 220 dtsi,2015,0.6,0.95,16600,Petrol,Individual,Manual,0 142 | Honda CBR 150,2013,0.6,1.2,32000,Petrol,Individual,Manual,0 143 | Bajaj Avenger 150 street,2016,0.6,0.8,20000,Petrol,Individual,Manual,0 144 | Yamaha FZ v 2.0,2015,0.6,0.84,29000,Petrol,Individual,Manual,0 145 | Yamaha FZ v 2.0,2016,0.6,0.84,25000,Petrol,Individual,Manual,0 146 | Bajaj Pulsar NS 200,2014,0.6,0.99,25000,Petrol,Individual,Manual,0 147 | TVS Apache RTR 160,2012,0.6,0.81,19000,Petrol,Individual,Manual,0 148 | Hero Extreme,2014,0.55,0.787,15000,Petrol,Individual,Manual,0 149 | Yamaha FZ S V 2.0,2015,0.55,0.84,58000,Petrol,Individual,Manual,0 150 | Bajaj Pulsar 220 F,2010,0.52,0.94,45000,Petrol,Individual,Manual,0 151 | Bajaj Pulsar 220 F,2016,0.51,0.94,24000,Petrol,Individual,Manual,0 152 | TVS Apache RTR 180,2011,0.5,0.826,6000,Petrol,Individual,Manual,0 153 | Hero Passion X pro,2016,0.5,0.55,31000,Petrol,Individual,Manual,0 154 | Bajaj Pulsar NS 200,2012,0.5,0.99,13000,Petrol,Individual,Manual,0 155 | Bajaj Pulsar NS 200,2013,0.5,0.99,45000,Petrol,Individual,Manual,0 156 | Yamaha Fazer ,2014,0.5,0.88,8000,Petrol,Individual,Manual,0 157 | Honda Activa 4G,2017,0.48,0.51,4300,Petrol,Individual,Automatic,0 158 | TVS Sport ,2017,0.48,0.52,15000,Petrol,Individual,Manual,0 159 | Yamaha FZ S V 2.0,2015,0.48,0.84,23000,Petrol,Individual,Manual,0 160 | Honda Dream Yuga ,2017,0.48,0.54,8600,Petrol,Individual,Manual,0 161 | Honda Activa 4G,2017,0.45,0.51,4000,Petrol,Individual,Automatic,0 162 | Bajaj Avenger Street 220,2011,0.45,0.95,24000,Petrol,Individual,Manual,0 163 | TVS Apache RTR 180,2014,0.45,0.826,23000,Petrol,Individual,Manual,0 164 | Bajaj Pulsar NS 200,2012,0.45,0.99,14500,Petrol,Individual,Manual,0 165 | Bajaj Avenger 220 dtsi,2010,0.45,0.95,27000,Petrol,Individual,Manual,0 166 | Hero Splender iSmart,2016,0.45,0.54,14000,Petrol,Individual,Manual,0 167 | Activa 3g,2016,0.45,0.54,500,Petrol,Individual,Automatic,0 168 | Hero Passion Pro,2016,0.45,0.55,1000,Petrol,Individual,Manual,0 169 | TVS Apache RTR 160,2014,0.42,0.81,42000,Petrol,Individual,Manual,0 170 | Honda CB Trigger,2013,0.42,0.73,12000,Petrol,Individual,Manual,0 171 | Hero Splender iSmart,2015,0.4,0.54,14000,Petrol,Individual,Manual,0 172 | Yamaha FZ S ,2012,0.4,0.83,5500,Petrol,Individual,Manual,0 173 | Hero Passion Pro,2015,0.4,0.55,6700,Petrol,Individual,Manual,0 174 | Bajaj Pulsar 135 LS,2014,0.4,0.64,13700,Petrol,Individual,Manual,0 175 | Activa 4g,2017,0.4,0.51,1300,Petrol,Individual,Automatic,0 176 | Honda CB Unicorn,2015,0.38,0.72,38600,Petrol,Individual,Manual,0 177 | Hero Honda CBZ extreme,2011,0.38,0.787,75000,Petrol,Individual,Manual,0 178 | Honda Karizma,2011,0.35,1.05,30000,Petrol,Individual,Manual,0 179 | Honda Activa 125,2016,0.35,0.57,24000,Petrol,Individual,Automatic,0 180 | TVS Jupyter,2014,0.35,0.52,19000,Petrol,Individual,Automatic,0 181 | Honda Karizma,2010,0.31,1.05,213000,Petrol,Individual,Manual,0 182 | Hero Honda Passion Pro,2012,0.3,0.51,60000,Petrol,Individual,Manual,0 183 | Hero Splender Plus,2016,0.3,0.48,50000,Petrol,Individual,Manual,0 184 | Honda CB Shine,2013,0.3,0.58,30000,Petrol,Individual,Manual,0 185 | Bajaj Discover 100,2013,0.27,0.47,21000,Petrol,Individual,Manual,0 186 | Bajaj Pulsar 150,2008,0.25,0.75,26000,Petrol,Individual,Manual,1 187 | Suzuki Access 125,2008,0.25,0.58,1900,Petrol,Individual,Automatic,0 188 | TVS Wego,2010,0.25,0.52,22000,Petrol,Individual,Automatic,0 189 | Honda CB twister,2013,0.25,0.51,32000,Petrol,Individual,Manual,0 190 | Hero Glamour,2013,0.25,0.57,18000,Petrol,Individual,Manual,0 191 | Hero Super Splendor,2005,0.2,0.57,55000,Petrol,Individual,Manual,0 192 | Bajaj Pulsar 150,2008,0.2,0.75,60000,Petrol,Individual,Manual,0 193 | Bajaj Discover 125,2012,0.2,0.57,25000,Petrol,Individual,Manual,1 194 | Hero Hunk,2007,0.2,0.75,49000,Petrol,Individual,Manual,1 195 | Hero Ignitor Disc,2013,0.2,0.65,24000,Petrol,Individual,Manual,1 196 | Hero CBZ Xtreme,2008,0.2,0.787,50000,Petrol,Individual,Manual,0 197 | Bajaj ct 100,2015,0.18,0.32,35000,Petrol,Individual,Manual,0 198 | Activa 3g,2008,0.17,0.52,500000,Petrol,Individual,Automatic,0 199 | Honda CB twister,2010,0.16,0.51,33000,Petrol,Individual,Manual,0 200 | Bajaj Discover 125,2011,0.15,0.57,35000,Petrol,Individual,Manual,1 201 | Honda CB Shine,2007,0.12,0.58,53000,Petrol,Individual,Manual,0 202 | Bajaj Pulsar 150,2006,0.1,0.75,92233,Petrol,Individual,Manual,0 203 | i20,2010,3.25,6.79,58000,Diesel,Dealer,Manual,1 204 | grand i10,2015,4.4,5.7,28200,Petrol,Dealer,Manual,0 205 | i10,2011,2.95,4.6,53460,Petrol,Dealer,Manual,0 206 | eon,2015,2.75,4.43,28282,Petrol,Dealer,Manual,0 207 | grand i10,2016,5.25,5.7,3493,Petrol,Dealer,Manual,1 208 | xcent,2017,5.75,7.13,12479,Petrol,Dealer,Manual,0 209 | grand i10,2015,5.15,5.7,34797,Petrol,Dealer,Automatic,0 210 | i20,2017,7.9,8.1,3435,Petrol,Dealer,Manual,0 211 | grand i10,2015,4.85,5.7,21125,Diesel,Dealer,Manual,0 212 | i10,2012,3.1,4.6,35775,Petrol,Dealer,Manual,0 213 | elantra,2015,11.75,14.79,43535,Diesel,Dealer,Manual,0 214 | creta,2016,11.25,13.6,22671,Petrol,Dealer,Manual,0 215 | i20,2011,2.9,6.79,31604,Petrol,Dealer,Manual,0 216 | grand i10,2017,5.25,5.7,20114,Petrol,Dealer,Manual,0 217 | verna,2012,4.5,9.4,36100,Petrol,Dealer,Manual,0 218 | eon,2016,2.9,4.43,12500,Petrol,Dealer,Manual,0 219 | eon,2016,3.15,4.43,15000,Petrol,Dealer,Manual,0 220 | verna,2014,6.45,9.4,45078,Petrol,Dealer,Manual,0 221 | verna,2012,4.5,9.4,36000,Petrol,Dealer,Manual,0 222 | eon,2017,3.5,4.43,38488,Petrol,Dealer,Manual,0 223 | i20,2013,4.5,6.79,32000,Petrol,Dealer,Automatic,0 224 | i20,2014,6,7.6,77632,Diesel,Dealer,Manual,0 225 | verna,2015,8.25,9.4,61381,Diesel,Dealer,Manual,0 226 | verna,2013,5.11,9.4,36198,Petrol,Dealer,Automatic,0 227 | i10,2011,2.7,4.6,22517,Petrol,Dealer,Manual,0 228 | grand i10,2015,5.25,5.7,24678,Petrol,Dealer,Manual,0 229 | i10,2011,2.55,4.43,57000,Petrol,Dealer,Manual,0 230 | verna,2012,4.95,9.4,60000,Diesel,Dealer,Manual,0 231 | i20,2012,3.1,6.79,52132,Diesel,Dealer,Manual,0 232 | verna,2013,6.15,9.4,45000,Diesel,Dealer,Manual,0 233 | verna,2017,9.25,9.4,15001,Petrol,Dealer,Manual,0 234 | elantra,2015,11.45,14.79,12900,Petrol,Dealer,Automatic,0 235 | grand i10,2013,3.9,5.7,53000,Diesel,Dealer,Manual,0 236 | grand i10,2015,5.5,5.7,4492,Petrol,Dealer,Manual,0 237 | verna,2017,9.1,9.4,15141,Petrol,Dealer,Manual,0 238 | eon,2016,3.1,4.43,11849,Petrol,Dealer,Manual,0 239 | creta,2015,11.25,13.6,68000,Diesel,Dealer,Manual,0 240 | verna,2013,4.8,9.4,60241,Petrol,Dealer,Manual,0 241 | eon,2012,2,4.43,23709,Petrol,Dealer,Manual,0 242 | verna,2012,5.35,9.4,32322,Diesel,Dealer,Manual,0 243 | xcent,2015,4.75,7.13,35866,Petrol,Dealer,Manual,1 244 | xcent,2014,4.4,7.13,34000,Petrol,Dealer,Manual,0 245 | i20,2016,6.25,7.6,7000,Petrol,Dealer,Manual,0 246 | verna,2013,5.95,9.4,49000,Diesel,Dealer,Manual,0 247 | verna,2012,5.2,9.4,71000,Diesel,Dealer,Manual,0 248 | i20,2012,3.75,6.79,35000,Petrol,Dealer,Manual,0 249 | verna,2015,5.95,9.4,36000,Petrol,Dealer,Manual,0 250 | i10,2013,4,4.6,30000,Petrol,Dealer,Manual,0 251 | i20,2016,5.25,7.6,17000,Petrol,Dealer,Manual,0 252 | creta,2016,12.9,13.6,35934,Diesel,Dealer,Manual,0 253 | city,2013,5,9.9,56701,Petrol,Dealer,Manual,0 254 | brio,2015,5.4,6.82,31427,Petrol,Dealer,Automatic,0 255 | city,2014,7.2,9.9,48000,Diesel,Dealer,Manual,0 256 | city,2013,5.25,9.9,54242,Petrol,Dealer,Manual,0 257 | brio,2012,3,5.35,53675,Petrol,Dealer,Manual,0 258 | city,2016,10.25,13.6,49562,Petrol,Dealer,Manual,0 259 | city,2015,8.5,13.6,40324,Petrol,Dealer,Manual,0 260 | city,2015,8.4,13.6,25000,Petrol,Dealer,Manual,0 261 | amaze,2014,3.9,7,36054,Petrol,Dealer,Manual,0 262 | city,2016,9.15,13.6,29223,Petrol,Dealer,Manual,0 263 | brio,2016,5.5,5.97,5600,Petrol,Dealer,Manual,0 264 | amaze,2015,4,5.8,40023,Petrol,Dealer,Manual,0 265 | jazz,2016,6.6,7.7,16002,Petrol,Dealer,Manual,0 266 | amaze,2015,4,7,40026,Petrol,Dealer,Manual,0 267 | jazz,2017,6.5,8.7,21200,Petrol,Dealer,Manual,0 268 | amaze,2014,3.65,7,35000,Petrol,Dealer,Manual,0 269 | city,2016,8.35,9.4,19434,Diesel,Dealer,Manual,0 270 | brio,2017,4.8,5.8,19000,Petrol,Dealer,Manual,0 271 | city,2015,6.7,10,18828,Petrol,Dealer,Manual,0 272 | city,2011,4.1,10,69341,Petrol,Dealer,Manual,0 273 | city,2009,3,10,69562,Petrol,Dealer,Manual,0 274 | city,2015,7.5,10,27600,Petrol,Dealer,Manual,0 275 | jazz,2010,2.25,7.5,61203,Petrol,Dealer,Manual,0 276 | brio,2014,5.3,6.8,16500,Petrol,Dealer,Manual,0 277 | city,2016,10.9,13.6,30753,Petrol,Dealer,Automatic,0 278 | city,2015,8.65,13.6,24800,Petrol,Dealer,Manual,0 279 | city,2015,9.7,13.6,21780,Petrol,Dealer,Manual,0 280 | jazz,2016,6,8.4,4000,Petrol,Dealer,Manual,0 281 | city,2014,6.25,13.6,40126,Petrol,Dealer,Manual,0 282 | brio,2015,5.25,5.9,14465,Petrol,Dealer,Manual,0 283 | city,2006,2.1,7.6,50456,Petrol,Dealer,Manual,0 284 | city,2014,8.25,14,63000,Diesel,Dealer,Manual,0 285 | city,2016,8.99,11.8,9010,Petrol,Dealer,Manual,0 286 | brio,2013,3.5,5.9,9800,Petrol,Dealer,Manual,0 287 | jazz,2016,7.4,8.5,15059,Petrol,Dealer,Automatic,0 288 | jazz,2016,5.65,7.9,28569,Petrol,Dealer,Manual,0 289 | amaze,2015,5.75,7.5,44000,Petrol,Dealer,Automatic,0 290 | city,2015,8.4,13.6,34000,Petrol,Dealer,Manual,0 291 | city,2016,10.11,13.6,10980,Petrol,Dealer,Manual,0 292 | amaze,2014,4.5,6.4,19000,Petrol,Dealer,Manual,0 293 | brio,2015,5.4,6.1,31427,Petrol,Dealer,Manual,0 294 | jazz,2016,6.4,8.4,12000,Petrol,Dealer,Manual,0 295 | city,2010,3.25,9.9,38000,Petrol,Dealer,Manual,0 296 | amaze,2014,3.75,6.8,33019,Petrol,Dealer,Manual,0 297 | city,2015,8.55,13.09,60076,Diesel,Dealer,Manual,0 298 | city,2016,9.5,11.6,33988,Diesel,Dealer,Manual,0 299 | brio,2015,4,5.9,60000,Petrol,Dealer,Manual,0 300 | city,2009,3.35,11,87934,Petrol,Dealer,Manual,0 301 | city,2017,11.5,12.5,9000,Diesel,Dealer,Manual,0 302 | brio,2016,5.3,5.9,5464,Petrol,Dealer,Manual,0 303 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/car_model.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GauravRajwada/100-Data-Science-Projects/ff69c5ea24308eaaa8356e066bfacdf42d11cfcc/0.1 Car_Price_Prediction/car_model.pkl -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/car_price_prediction.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Wed Jul 1 16:05:18 2020 4 | 5 | @author: Gaurav 6 | """ 7 | 8 | from datetime import date 9 | import pandas as pd 10 | import matplotlib.pyplot as plt 11 | import seaborn as sb 12 | from sklearn.model_selection import RandomizedSearchCV 13 | from sklearn.ensemble import RandomForestRegressor 14 | from sklearn.model_selection import train_test_split 15 | from sklearn.ensemble import ExtraTreesRegressor 16 | import numpy as np 17 | 18 | df=pd.read_csv("E:/All Data Set/Car_Datasets.csv") 19 | 20 | cur_year= date.today().year 21 | df['current_year']=cur_year 22 | df['No_of_year']=df["current_year"]-df['Year'] 23 | 24 | df.drop(['Year',"current_year","Car_Name"],axis=1,inplace=True) 25 | 26 | df=pd.get_dummies(df,drop_first=True) 27 | 28 | sb.pairplot(df) 29 | 30 | """Plotting correlation""" 31 | corrmat=df.corr() 32 | top_corr_features=corrmat.index 33 | plt.figure(figsize=(20,20)) 34 | g=sb.heatmap(df[top_corr_features].corr(),annot=True,cmap="RdYlGn") 35 | 36 | x=df.iloc[:,1:] 37 | y=df.iloc[:,0] 38 | 39 | """Finding Important features""" 40 | #Feature Importance 41 | model=ExtraTreesRegressor() 42 | model.fit(x,y) 43 | 44 | #plot graph of feature importances for better visualization 45 | feat_importances = pd.Series(model.feature_importances_, index=x.columns) 46 | feat_importances.nlargest(8).plot(kind='barh') 47 | plt.show() 48 | 49 | x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.25) 50 | 51 | 52 | 53 | #Randomized Search CV 54 | n_estimators = [int(x) for x in np.linspace(start = 100, stop = 1200, num = 12)] 55 | max_features = ['auto', 'sqrt'] 56 | max_depth = [int(x) for x in np.linspace(5, 30, num = 6)] 57 | min_samples_split = [2, 5, 10, 15, 100] 58 | min_samples_leaf = [1, 2, 5, 10] 59 | 60 | random_grid = {'n_estimators': n_estimators, 61 | 'max_features': max_features, 62 | 'max_depth': max_depth, 63 | 'min_samples_split': min_samples_split, 64 | 'min_samples_leaf': min_samples_leaf} 65 | 66 | 67 | rf=RandomForestRegressor() 68 | regressor=RandomizedSearchCV(estimator = rf, param_distributions = random_grid,scoring='neg_mean_squared_error', n_iter = 10, cv = 5, verbose=2, random_state=42, n_jobs = -1) 69 | 70 | 71 | regressor.fit(x_train,y_train) 72 | 73 | y_pred=regressor.predict(x_test) 74 | 75 | sb.distplot(y_test-y_pred) 76 | 77 | import pickle 78 | file = open("E:/Project/Car_Dekho/car_model.pkl", 'wb') 79 | 80 | pickle.dump(regressor,file) 81 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Jul 2 09:10:18 2020 4 | 5 | @author: Gaurav 6 | """ 7 | 8 | from flask import Flask, render_template, request 9 | import jsonify 10 | import requests 11 | import pickle 12 | import numpy as np 13 | import sklearn 14 | from sklearn.preprocessing import StandardScaler 15 | from datetime import date 16 | 17 | app=Flask(__name__) 18 | model=pickle.load(open("car_model.pkl","rb")) 19 | 20 | standard_to=StandardScaler() 21 | @app.route("/",methods=['GET']) 22 | 23 | def Home(): 24 | return render_template('index.html') 25 | 26 | 27 | @app.route("/predict",methods=['POST']) 28 | def predict(): 29 | fuel_Type_Diesel=0 30 | if request.method=='POST': 31 | Year=int(request.form['Year']) 32 | Present_Price=float(request.form['Present_Price']) 33 | Kms_Driven=int(request.form['Kms_Driven']) 34 | Kms_Driven2=np.log(Kms_Driven) 35 | Owner=int(request.form['Owner']) 36 | Fuel_Type_Petrol=request.form['Fuel_Type_Petrol'] 37 | if(Fuel_Type_Petrol=='Petrol'): 38 | Fuel_Type_Petrol=1 39 | Fuel_Type_Diesel=0 40 | else: 41 | Fuel_Type_Petrol=0 42 | Fuel_Type_Diesel=1 43 | 44 | Year=date.today().year-Year 45 | # Year=2020-Year 46 | Seller_Type_Individual=request.form['Seller_Type_Individual'] 47 | if(Seller_Type_Individual=='Individual'): 48 | Seller_Type_Individual=1 49 | else: 50 | Seller_Type_Individual=0 51 | Transmission_Mannual=request.form['Transmission_Mannual'] 52 | if(Transmission_Mannual=='Mannual'): 53 | Transmission_Mannual=1 54 | else: 55 | Transmission_Mannual=0 56 | prediction=model.predict([[Present_Price,Kms_Driven2,Owner,Year,Fuel_Type_Diesel,Fuel_Type_Petrol,Seller_Type_Individual,Transmission_Mannual]]) 57 | output=round(prediction[0],2) 58 | if output<0: 59 | return render_template('index.html',prediction_texts="Sorry you cannot sell this car") 60 | else: 61 | return render_template('index.html',prediction_text="You Can Sell The Car at {}".format(output)) 62 | else: 63 | return render_template('index.html') 64 | 65 | 66 | 67 | if __name__=="__main__": 68 | app.run() 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/requirements.txt: -------------------------------------------------------------------------------- 1 | backcall==0.2.0 2 | certifi==2020.6.20 3 | chardet==3.0.4 4 | click==7.1.2 5 | cloudpickle==1.4.1 6 | colorama==0.4.3 7 | cycler==0.10.0 8 | decorator==4.4.2 9 | Flask==1.1.2 10 | get==0.0.0 11 | idna==2.10 12 | ipykernel==5.3.0 13 | ipython==7.16.1 14 | ipython-genutils==0.2.0 15 | itsdangerous==1.1.0 16 | jedi==0.17.1 17 | Jinja2==2.11.2 18 | joblib==0.15.1 19 | jsonify==0.5 20 | jupyter-client==6.1.5 21 | jupyter-core==4.6.3 22 | kiwisolver==1.2.0 23 | MarkupSafe==1.1.1 24 | matplotlib==3.2.2 25 | nltk==3.5 26 | numpy==1.19.0 27 | pandas==1.0.5 28 | parso==0.7.0 29 | pickleshare==0.7.5 30 | post==0.0.0 31 | prompt-toolkit==3.0.5 32 | Pygments==2.6.1 33 | pyparsing==2.4.7 34 | python-dateutil==2.8.1 35 | pytz==2020.1 36 | pywin32==228 37 | pyzmq==19.0.1 38 | query-string==0.0.0 39 | regex==2020.6.8 40 | request==0.0.0 41 | requests==2.24.0 42 | scikit-learn==0.23.1 43 | scipy==1.5.0 44 | seaborn==0.10.1 45 | six==1.15.0 46 | sklearn==0.0 47 | spyder-kernels==1.9.1 48 | threadpoolctl==2.1.0 49 | tornado==6.0.4 50 | tqdm==4.47.0 51 | traitlets==4.3.3 52 | urllib3==1.25.9 53 | wcwidth==0.2.5 54 | Werkzeug==1.0.1 55 | wincertstore==0.2 56 | gunicorn 57 | -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/static/css/register.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Poppins); 2 | body { 3 | font-family: "Poppins", sans-serif; 4 | } 5 | .light-blue-gradient { 6 | background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%); 7 | } -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/templates/cccc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GauravRajwada/100-Data-Science-Projects/ff69c5ea24308eaaa8356e066bfacdf42d11cfcc/0.1 Car_Price_Prediction/templates/cccc.png -------------------------------------------------------------------------------- /0.1 Car_Price_Prediction/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | C A R 14 | 15 | 16 | 17 |
18 | 19 |
20 |

Check your resell car value in few second.

21 |
22 |
23 |
24 |
25 | 26 |

Enter details

27 |
28 |
29 |
30 | * Enter year only in form "YYYY" 31 | 32 | 33 | 34 |
35 |
36 | 37 | 38 | 39 |
40 |
41 | 42 | 43 |
44 |
45 | 46 | 47 |
48 |
49 |
50 | 51 |
52 | 53 | 54 |
55 |
56 | 57 | 58 |
59 |
60 | 61 | 62 |
63 |
64 |
65 |
66 | 67 | 71 |
72 |
73 |
74 | 75 | 79 |
80 | 81 |
82 | {{ prediction_text }} 83 |
84 | 85 |
86 | 87 |
88 |
89 | 90 | 93 | 99 |
100 |
101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /2.0 Sentiment analysis/Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn app:app 2 | -------------------------------------------------------------------------------- /2.0 Sentiment analysis/app.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | from flask import Flask, render_template, request 4 | import pickle 5 | import re 6 | from nltk.stem import WordNetLemmatizer 7 | from nltk.corpus import stopwords 8 | import os 9 | import nltk 10 | import seaborn as sb 11 | import pandas as pd 12 | import sys 13 | import logging 14 | # nltk.download("wordnet", "whatever_the_absolute_path_to_myapp_is/nltk_data/") 15 | classifier=pickle.load(open("sentiment_model1.pkl","rb")) 16 | cv=pickle.load(open("sentiment_vectorizer.pkl","rb")) 17 | 18 | 19 | lm=WordNetLemmatizer() 20 | 21 | emotions={0:"Angry",1:"Sad",2:'Fear',3:"Surprise",4:"Joy",5:"Love"} 22 | 23 | app=Flask(__name__) 24 | 25 | app.logger.addHandler(logging.StreamHandler(sys.stdout)) 26 | app.logger.setLevel(logging.ERROR) 27 | app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0 28 | @app.route("/",methods=['GET']) 29 | 30 | def Home(): 31 | return render_template('index.html') 32 | @app.after_request 33 | def after_request(response): 34 | response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate, public, max-age=0" 35 | response.headers["Expires"] = '0' 36 | response.headers["Pragma"] = "no-cache" 37 | return response 38 | 39 | @app.route("/predict",methods=['POST']) 40 | def predict(): 41 | 42 | if request.method=='POST': 43 | review=request.form['review'] 44 | if review.isnumeric(): 45 | return render_template('index.html',prediction_texts="Sorry you cannot sell this car") 46 | 47 | else: 48 | corpus=[] 49 | # review="i hate you you are vary bad" 50 | text=re.sub('[^a-zA-Z]'," ",review) 51 | text_lower=text.lower() 52 | lower_list=text_lower.split() 53 | print(lower_list) 54 | lower_list=[lm.lemmatize(i) for i in lower_list if i not in set(stopwords.words('english'))] 55 | clean_text=" ".join(lower_list) 56 | corpus.append(clean_text) 57 | x=cv.transform(corpus).toarray() 58 | output=classifier.predict(x) 59 | output=emotions[output[0]] 60 | 61 | string=""" 62 | Natural language process take following steps:\n 63 | 64 | 1. Removing special charecter: "{}" \n 65 | 2. Lowering all words: "{}"\n 66 | 3. Lemmatization- It usually refers to remove inflectional endings only 67 | and to return the base: "{}"\n 68 | 4. Making Corpus: "{}"\n 69 | 5. Making Bag of words: "{}"\n 70 | 6. Finally prediction: "{}"\n 71 | """.format(text,text_lower,clean_text,corpus,x,output) 72 | print(string) 73 | prob=pd.DataFrame({'Emotions': ['Angry',"Sad","Fear","Surprise","Joy","Love"], 'Probability': classifier.predict_proba(x)[0,:]}) 74 | prob=prob.sort_values(by='Probability',ascending=False) 75 | print(prob) 76 | import matplotlib 77 | matplotlib.use('Agg') 78 | import matplotlib.pyplot as plt 79 | fig = plt.figure(figsize =(10, 7)) 80 | 81 | plt.bar(prob['Emotions'], prob['Probability']) 82 | plt.savefig("static/people_photo/plot.png") 83 | 84 | path="static/people_photo/plot.png" 85 | 86 | return render_template('result.html',review=review, 87 | text=text, 88 | text_lower=text_lower, 89 | lower_list=lower_list, 90 | clean_text=clean_text, 91 | corpus=corpus, 92 | vector=x, 93 | output=output,ax=path 94 | ) 95 | else: 96 | return render_template('index.html') 97 | 98 | 99 | 100 | if __name__=="__main__": 101 | app.run() 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /2.0 Sentiment analysis/app.yaml: -------------------------------------------------------------------------------- 1 | runtime:python37 -------------------------------------------------------------------------------- /2.0 Sentiment analysis/main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Sun Jul 12 08:56:34 2020 4 | 5 | @author: Gaurav 6 | """ 7 | 8 | from flask import Flask, render_template, request 9 | import pickle 10 | import re 11 | from nltk.stem import WordNetLemmatizer 12 | from nltk.corpus import stopwords 13 | import os 14 | import nltk 15 | import seaborn as sb 16 | import pandas as pd 17 | # nltk.download("wordnet", "whatever_the_absolute_path_to_myapp_is/nltk_data/") 18 | classifier=pickle.load(open("sentiment_model1.pkl","rb")) 19 | cv=pickle.load(open("sentiment_vectorizer.pkl","rb")) 20 | 21 | 22 | lm=WordNetLemmatizer() 23 | 24 | emotions={0:"Angry",1:"Sad",2:'Fear',3:"Surprise",4:"Joy",5:"Love"} 25 | 26 | app=Flask(__name__) 27 | app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0 28 | @app.route("/",methods=['GET']) 29 | 30 | def Home(): 31 | return render_template('index.html') 32 | @app.after_request 33 | def after_request(response): 34 | response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate, public, max-age=0" 35 | response.headers["Expires"] = '0' 36 | response.headers["Pragma"] = "no-cache" 37 | return response 38 | 39 | @app.route("/predict",methods=['POST']) 40 | def predict(): 41 | 42 | if request.method=='POST': 43 | review=request.form['review'] 44 | if review.isnumeric(): 45 | return render_template('index.html',prediction_texts="Sorry you cannot sell this car") 46 | 47 | else: 48 | corpus=[] 49 | # review="i hate you you are vary bad" 50 | text=re.sub('[^a-zA-Z]'," ",review) 51 | text_lower=text.lower() 52 | lower_list=text_lower.split() 53 | lower_list=[lm.lemmatize(i) for i in lower_list if i not in set(stopwords.words('english'))] 54 | clean_text=" ".join(lower_list) 55 | corpus.append(clean_text) 56 | x=cv.transform(corpus).toarray() 57 | output=classifier.predict(x) 58 | output=emotions[output[0]] 59 | string=""" 60 | Natural language process take following steps:\n 61 | 62 | 1. Removing special charecter: "{}" \n 63 | 2. Lowering all words: "{}"\n 64 | 3. Lemmatization- It usually refers to remove inflectional endings only 65 | and to return the base: "{}"\n 66 | 4. Making Corpus: "{}"\n 67 | 5. Making Bag of words: "{}"\n 68 | 6. Finally prediction: "{}"\n 69 | """.format(text,text_lower,clean_text,corpus,x,output) 70 | print(string) 71 | prob=pd.DataFrame({'Emotions': ['Angry',"Sad","Fear","Surprise","Joy","Love"], 'Probability': classifier.predict_proba(x)[0,:]}) 72 | prob=prob.sort_values(by='Probability',ascending=False) 73 | import matplotlib 74 | matplotlib.use('Agg') 75 | import matplotlib.pyplot as plt 76 | fig = plt.figure(figsize =(10, 7)) 77 | 78 | plt.bar(prob['Emotions'], prob['Probability']) 79 | plt.savefig("static/people_photo/plot.png") 80 | 81 | path="static/people_photo/plot.png" 82 | 83 | return render_template('result.html',review=review, 84 | text=text, 85 | text_lower=text_lower, 86 | lower_list=lower_list, 87 | clean_text=clean_text, 88 | corpus=corpus, 89 | vector=x, 90 | output=output,ax=path 91 | ) 92 | else: 93 | return render_template('index.html') 94 | 95 | 96 | 97 | if __name__=="__main__": 98 | app.run() 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /2.0 Sentiment analysis/requirements.txt: -------------------------------------------------------------------------------- 1 | backcall==0.2.0 2 | certifi==2020.6.20 3 | click==7.1.2 4 | cloudpickle==1.5.0 5 | colorama==0.4.3 6 | cycler==0.10.0 7 | decorator==4.4.2 8 | Flask==1.1.2 9 | get==0.0.0 10 | gunicorn==19.9.0 11 | ipykernel==5.3.0 12 | ipython==7.16.1 13 | ipython-genutils==0.2.0 14 | itsdangerous==1.1.0 15 | jedi==0.17.1 16 | Jinja2==2.11.2 17 | joblib==0.16.0 18 | jsonify==0.5 19 | jupyter-client==6.1.5 20 | jupyter-core==4.6.3 21 | kiwisolver==1.2.0 22 | MarkupSafe==1.1.1 23 | matplotlib==3.2.2 24 | nltk==3.5 25 | numpy==1.19.0 26 | pandas==1.0.5 27 | parso==0.7.0 28 | pickleshare==0.7.5 29 | post==0.0.0 30 | prompt-toolkit==3.0.5 31 | Pygments==2.6.1 32 | pyparsing==2.4.7 33 | python-dateutil==2.8.1 34 | pytz==2020.1 35 | pywin32==228 36 | pyzmq==19.0.1 37 | query-string==0.0.0 38 | regex==2020.6.8 39 | request==0.0.0 40 | scikit-learn==0.23.1 41 | scipy==1.5.0 42 | seaborn==0.10.1 43 | six==1.15.0 44 | sklearn==0.0 45 | spyder-kernels==1.9.1 46 | threadpoolctl==2.1.0 47 | tornado==6.0.4 48 | tqdm==4.47.0 49 | traitlets==4.3.3 50 | wcwidth==0.2.5 51 | Werkzeug==1.0.1 52 | wincertstore==0.2 53 | gunicorn -------------------------------------------------------------------------------- /2.0 Sentiment analysis/sentiment_model1.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GauravRajwada/100-Data-Science-Projects/ff69c5ea24308eaaa8356e066bfacdf42d11cfcc/2.0 Sentiment analysis/sentiment_model1.pkl -------------------------------------------------------------------------------- /2.0 Sentiment analysis/sentiment_vectorizer.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GauravRajwada/100-Data-Science-Projects/ff69c5ea24308eaaa8356e066bfacdf42d11cfcc/2.0 Sentiment analysis/sentiment_vectorizer.pkl -------------------------------------------------------------------------------- /2.0 Sentiment analysis/static/people_photo/plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GauravRajwada/100-Data-Science-Projects/ff69c5ea24308eaaa8356e066bfacdf42d11cfcc/2.0 Sentiment analysis/static/people_photo/plot.png -------------------------------------------------------------------------------- /2.0 Sentiment analysis/static/register.css: -------------------------------------------------------------------------------- 1 | /* devanagari */ 2 | @font-face { 3 | font-family: 'Poppins'; 4 | font-style: normal; 5 | font-weight: 400; 6 | src: local('Poppins Regular'), local('Poppins-Regular'), url(https://fonts.gstatic.com/s/poppins/v9/pxiEyp8kv8JHgFVrJJbecmNE.woff2) format('woff2'); 7 | unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB; 8 | } 9 | /* latin-ext */ 10 | @font-face { 11 | font-family: 'Poppins'; 12 | font-style: normal; 13 | font-weight: 400; 14 | src: local('Poppins Regular'), local('Poppins-Regular'), url(https://fonts.gstatic.com/s/poppins/v9/pxiEyp8kv8JHgFVrJJnecmNE.woff2) format('woff2'); 15 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; 16 | } 17 | /* latin */ 18 | @font-face { 19 | font-family: 'Poppins'; 20 | font-style: normal; 21 | font-weight: 400; 22 | src: local('Poppins Regular'), local('Poppins-Regular'), url(https://fonts.gstatic.com/s/poppins/v9/pxiEyp8kv8JHgFVrJJfecg.woff2) format('woff2'); 23 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 24 | } 25 | body { 26 | font-family: "Poppins", sans-serif; 27 | } 28 | .light-blue-gradient { 29 | background: linear-gradient(120deg, #a1c4fd 0%, #1ba1df 100%); 30 | } -------------------------------------------------------------------------------- /2.0 Sentiment analysis/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | N L P 14 | 28 | 29 | 30 | 31 |
32 |
33 |

Natural Language Processing

34 | Welcome to my NLP project. Here you can enter any sentence and 35 | it will tell what is the sentiment of that text. 36 | You can to learn some basic of natural language processing.

37 |
38 |
39 |
40 |
41 |

Give Input

42 |
43 |
44 |
45 | 46 | 47 | 48 | 49 |
50 | 51 |

52 | 53 | 54 |
55 |
56 |
57 |
58 |
59 |