├── .gitignore
├── Alcohol-Quality-Checker
├── Alcohol-Quality.ipynb
├── Procfile
├── README-Resources
│ ├── AlcoholQuality.gif
│ ├── AlcoholQuality.jpg
│ ├── Screenshot (105).png
│ └── Screenshot (106).png
├── README.md
├── alcohol-quality-data.csv
├── app1.py
├── model.pkl
├── model.py
├── request.py
├── requirements.txt
├── static
│ └── css
│ │ └── formc.css
└── templates
│ └── form.html
├── Cloths-AccessoryClassification using DL
├── Cloths_Predictions
│ ├── __pycache__
│ │ └── predictions.cpython-36.pyc
│ └── predictions.py
├── README.md
├── Readme_Images
│ ├── Fashion-Model.png
│ ├── VGG-models.png
│ ├── cloth-classification.gif
│ └── vgg16-neural-network.jpg
├── app.py
├── requirements.txt
├── static
│ ├── css
│ │ └── main.css
│ └── js
│ │ └── main.js
├── templates
│ ├── base.html
│ └── index.html
└── uploads
│ └── jacket1.jpg
├── Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master
├── CLTP Analysis Output
│ ├── ACT.png
│ ├── Dep.png
│ ├── Details of Variables.png
│ ├── Employed_FeMale_People vs Policy_type.png
│ ├── Employed_Male_People vs Policy_type.png
│ ├── Employed_People vs Policy_type.png
│ ├── EmploymentStatus vs Policy_type.png
│ ├── GNU license.jpg
│ ├── Gender vs Policy_type.png
│ ├── MIT license.jpg
│ ├── Marital_status vs Policy_type.png
│ ├── Married_FeMale_People vs Policy_type.png
│ ├── Married_Male_People vs Policy_type.png
│ ├── Married_People vs Policy_type.png
│ ├── OLS Rgression Results.png
│ ├── Response variable Distribution.png
│ ├── Screenshot (111).png
│ ├── UnEmployed_FeMale_People vs Policy_type.png
│ ├── UnEmployed_Male_People vs Policy_type.png
│ ├── UnEmployed_People vs Policy_type.png
│ ├── UnMarried_People vs Policy_type.png
│ ├── bar1 total cliam vs education.png
│ ├── bar2 total cliam vs Gender.png
│ ├── bar3 total cliam vs empstatus.png
│ ├── clt vs tca scatterplot empstatus.png
│ ├── clt vs tca scatterplot maritalstatus.png
│ ├── clt vs tca scatterplot.png
│ ├── clv.jpg
│ ├── clvout.png
│ ├── fit.png
│ ├── hist 1.png
│ ├── hist 2.png
│ ├── hist 3.png
│ └── res.png
├── Customer LifeTime Value.ipynb
├── Customer Lifetime Value (Exploratory Data Analysis).py
├── Feature Engineering and Model Building.py
├── LICENSE
├── Procfile
├── Procfile.txt
├── README.md
├── RF_KModel.pkl
├── app.py
├── requirements.txt
├── static
│ └── cover.jpg
└── templates
│ ├── css.html
│ ├── img_girl.jpg
│ └── index.html
├── Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master
├── Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master
│ ├── LICENSE
│ ├── Procfile
│ ├── README.md
│ ├── app.py
│ ├── random_forest_hr_model.sav
│ ├── requirements.txt
│ ├── static
│ │ ├── ATTT.png
│ │ ├── At.png
│ │ └── attta.png
│ └── templates
│ │ ├── gg5.jpg
│ │ ├── home.html
│ │ ├── logo.jpg
│ │ ├── output_103_1.png
│ │ ├── output_110_1.png
│ │ ├── output_17_1.png
│ │ ├── output_25_1.png
│ │ ├── output_30_1.png
│ │ ├── output_34_1.png
│ │ ├── output_36_1.png
│ │ ├── output_38_1.png
│ │ ├── output_40_1.png
│ │ ├── output_43_1.png
│ │ ├── output_46_1.png
│ │ ├── output_48_1.png
│ │ ├── output_50_1.png
│ │ ├── output_52_1.png
│ │ ├── output_55_1.png
│ │ ├── output_57_1.png
│ │ ├── output_60_1.png
│ │ ├── output_63_0.png
│ │ ├── output_65_0.png
│ │ ├── output_72_1.png
│ │ ├── output_96_0.png
│ │ ├── output_99_1.png
│ │ └── prob.html
├── LICENSE
├── Procfile
├── README.md
├── app.py
├── random_forest_hr_model.sav
├── requirements.txt
├── static
│ ├── ATTT.png
│ ├── At.png
│ └── attta.png
└── templates
│ ├── gg5.jpg
│ ├── home.html
│ ├── logo.jpg
│ ├── output_103_1.png
│ ├── output_110_1.png
│ ├── output_17_1.png
│ ├── output_25_1.png
│ ├── output_30_1.png
│ ├── output_34_1.png
│ ├── output_36_1.png
│ ├── output_38_1.png
│ ├── output_40_1.png
│ ├── output_43_1.png
│ ├── output_46_1.png
│ ├── output_48_1.png
│ ├── output_50_1.png
│ ├── output_52_1.png
│ ├── output_55_1.png
│ ├── output_57_1.png
│ ├── output_60_1.png
│ ├── output_63_0.png
│ ├── output_65_0.png
│ ├── output_72_1.png
│ ├── output_96_0.png
│ ├── output_99_1.png
│ └── prob.html
├── FlightPrice_Prediction
├── Flightprice_Predictions.ipynb
├── Procfile
├── Test.xlsx
├── Train.xlsx
├── app.py
├── requirements.txt
├── static
│ └── css
│ │ └── styles.css
└── templates
│ └── home.html
├── Heat Exchanger Price Prediction
├── CAPSTONE.pptx
├── Dashboard.twb
├── Heat Exchanger Price Prediction.pdf
├── Heat Exchanger Price Prediction.py
└── dataset1.xlsx
├── IPL-Score-Prediction-with-Deployment
├── LICENSE
├── Procfile
├── Procfile.txt
├── RE.md
├── README.md
├── app.py
├── lr-model.pkl
├── requirements.txt
├── static
│ ├── IPL Predictor Output.gif
│ ├── P4.jpg
│ ├── ipl-favicon.ico
│ ├── ipl.jpeg
│ ├── p1.jpg
│ ├── p2.png
│ ├── p3.png
│ └── styles.css
└── templates
│ ├── index.html
│ └── result.html
├── LICENSE
├── Leaf-Disease-Classifier-master
├── disease_classifier.ipynb
├── how_to_train
│ ├── README.md
│ ├── Res50_script.ipynb
│ └── rename.py
├── images
│ ├── Flow diagram.png
│ ├── applescab.jpg
│ ├── arrow.png
│ ├── block_diagram.png
│ ├── leaf_after_yolo.jpeg
│ ├── leaf_before_yolo.jpeg
│ ├── resnetACC.png
│ └── subClasses.png
└── readME.md
├── Loan-Default-Prediction
├── Loan_Prediction_Model (1).html
├── Loan_Prediction_Model (1).ipynb
└── train.zip
├── Logo recognition from images
├── LICENSE.txt
├── README.md
├── config.py
├── detect_results
│ ├── detect_result_029.png
│ ├── detect_result_049.png
│ ├── detect_result_055.png
│ ├── detect_result_056.png
│ ├── detect_result_082.png
│ └── detect_result_351.png
├── flickr_logos_27_label_map.pbtxt
├── gen_tfrecord.py
├── gen_tfrecord_logos32plus.py
├── logo_detection.py
├── logos32plus_label_map.pbtxt
├── preproc_annot.py
├── query_set_results
│ ├── 2180367311_Google.png
│ ├── 3198284747_texaco.png
│ ├── 3489964654_Intel.png
│ ├── 3666600356_Cocacola.png
│ ├── 388978947_BMW.png
│ ├── 3907703753_Fedex.png
│ ├── 401253895_BMW.png
│ ├── 4273898682_DHL.png
│ ├── 4288066623_Unicef.png
│ └── 6651198_McDonalds.png
├── ssd_inception_v2_coco.config
└── ssd_inception_v2_coco_logos32plus.config
├── Procfile
├── README.md
├── Real-time-ML-Project-master
├── README.md
└── assets
│ ├── first.txt
│ └── industry.png
├── Restaurant Review Analyser using NLP
├── Procfile
├── Restaurant Review's Sentiment.ipynb
├── app.py
├── cv-transform.pkl
├── requirements.txt
├── restaurant_model.pkl
├── static
│ ├── 2.jpg
│ ├── favicon.ico
│ ├── food.ico
│ ├── negative-review.webp
│ ├── positive-review.webp
│ └── styles.css
└── templates
│ ├── index.html
│ └── result.html
├── app.py
├── awesome production machine learning
├── LICENSE
├── README.md
├── _config.yml
└── images
│ ├── awesome.svg
│ ├── guidelines.jpg
│ ├── mleng.png
│ ├── mlops1.png
│ └── video.png
├── car data.csv
├── carpredicition.ipynb
├── face_unlock
├── README.md
├── dataset
│ └── bala venkatesh
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ ├── 10.jpg
│ │ ├── 11.jpg
│ │ ├── 12.jpg
│ │ ├── 13.jpg
│ │ ├── 14.jpg
│ │ ├── 15.jpg
│ │ ├── 16.jpg
│ │ ├── 17.jpg
│ │ ├── 18.jpg
│ │ ├── 19.jpg
│ │ ├── 2.jpg
│ │ ├── 20.jpg
│ │ ├── 21.jpg
│ │ ├── 22.jpg
│ │ ├── 23.jpg
│ │ ├── 24.jpg
│ │ ├── 25.jpg
│ │ ├── 26.jpg
│ │ ├── 27.jpg
│ │ ├── 28.jpg
│ │ ├── 29.jpg
│ │ ├── 3.jpg
│ │ ├── 30.jpg
│ │ ├── 31.jpg
│ │ ├── 32.jpg
│ │ ├── 33.jpg
│ │ ├── 34.jpg
│ │ ├── 35.jpg
│ │ ├── 36.jpg
│ │ ├── 37.jpg
│ │ ├── 38.jpg
│ │ ├── 39.jpg
│ │ ├── 4.jpg
│ │ ├── 40.jpg
│ │ ├── 41.jpg
│ │ ├── 42.jpg
│ │ ├── 43.jpg
│ │ ├── 44.jpg
│ │ ├── 45.jpg
│ │ ├── 46.jpg
│ │ ├── 47.jpg
│ │ ├── 48.jpg
│ │ ├── 49.jpg
│ │ ├── 5.jpg
│ │ ├── 50.jpg
│ │ ├── 51.jpg
│ │ ├── 6.jpg
│ │ ├── 7.jpg
│ │ ├── 8.jpg
│ │ └── 9.jpg
├── demo.gif
├── face_generate.py
├── face_train.py
├── face_unlock.py
└── trained_knn_model.clf
├── main.py
├── random_forest_regression_model.pkl
└── requirements.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn app1:app
2 |
3 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/README-Resources/AlcoholQuality.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Alcohol-Quality-Checker/README-Resources/AlcoholQuality.gif
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/README-Resources/AlcoholQuality.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Alcohol-Quality-Checker/README-Resources/AlcoholQuality.jpg
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/README-Resources/Screenshot (105).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Alcohol-Quality-Checker/README-Resources/Screenshot (105).png
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/README-Resources/Screenshot (106).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Alcohol-Quality-Checker/README-Resources/Screenshot (106).png
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/README.md:
--------------------------------------------------------------------------------
1 | # **Alcohol-Quality-Checker**
2 | ## Predicting Quality of Alcohol
3 |
4 |
5 |
6 | ---
7 |
8 | ### **Web APP on Heroku**
9 |
10 |
11 | **[The Project on Heroku](https://alcoholqualitychecker.herokuapp.com/)**
12 |
13 | ---
14 | ## The Dataset
15 | .png)
16 | ### **[Dataset](https://github.com/piyushpathak03/End-to-End-small-projects/blob/master/Alcohol-Quality-Checker/alcohol-quality-data.csv)**
17 | ---
18 | ## **Overview**
19 | * The Dataset has **'density'**, **'pH'**, **'sulphates'**, **'alcohol'**, **'Quality_Category'** columns. It has **4898 rows** and **5 columns**.
20 | * From the Dataset, we have to predict the **Quality of Alcohol**: **"High"** or **"Low"**.
21 | * **ExtraTreesClassifier** has been used for Feature Selection.
22 | * I have applied **Artificial Neural Network**, **Random Forest**, **Decision Tree**, **K-NN**, **Naive bayes classification** and **SVM** algorithms but at the end, **KNN** gave better results.
23 |
24 | ---
25 | ## **Machine Learning Pipelines:**
26 | ---
27 | ### **1> Feature Engineering:**
28 |
29 | **a> Handling Missing Values:**
30 | * Here, In this data, there is no requirement of handling missing values because already it is a complete dataset.
31 |
32 | **b> Feature Encoding:**
33 | * In this data, we do not have much categorical columns except output column.
34 |
35 | **c> Feature Scaling & Feature Transformation:**
36 | * For alogorithms like K-NN , K means , all neural network etc are based on some distance equations. Hence, they require Scaling.
37 | * But, when i applied it, there was not much of a difference in the accuracy so there was no meaning of using it. Because not everytime,we have to use scaling or transformation. * Transformation also seemed not required for this data because the distribution is almost gaussian for the required columns.
38 | ---
39 | ### **2> Feature Selection:**
40 | * There are various techniques for this but here i have used **ExtraTressClassifier**. For, this Project ExtraTressClassifier showed **2 columns** as most important **"sulfate"** and **"Alcohol Level"**.
41 |
42 | .png)
43 |
44 | ---
45 |
46 | ### **3,4&5> Model Selection**, **Model Creation**, **Testing**
47 |
48 | * To get the proper accuracy and for the proper splitting of the train and test data, I have used **Stratified K Fold Cross Validation** as it is very efficient in splitting the dataset.
49 |
50 | * Here, I have tried many algorithms like **Artificial Neural Network**, **Random Forest**, **Decision Tree**, **K-NN**, **Naive bayes classification** and **SVM**.
51 | * Among these, K-NN has gaven the higher accuracy (80%).
52 | * For this I have tried all the values k values **till 500** and **k=125** gave better results.
53 |
54 | | Algorithm | Average Accuracy |
55 | | ---- | ----|
56 | | Random Forest | 76.19% |
57 | | Decision Tree | 75.88% |
58 | | K-NN | 79.48% |
59 | | SVM | 79.7% |
60 | | Naive bayes | 78.21% |
61 | | ANN | 78.00% |
62 |
63 | ---
64 | * Finally, I decided to go with KNN because as we know **SVM generally has higher variance**, whereas in KNN we can fix it by **choosing the right K value**. In my project **k=125** gave better results.
65 | * For detailed look at Project, go to **[Alcohol-Quality.ipynb](https://github.com/piyushpathak03/End-to-End-small-projects/blob/master/Alcohol-Quality-Checker/alcohol-quality-data.csv)** and **[model.py](https://github.com/piyushpathak03/End-to-End-small-projects/blob/master/Alcohol-Quality-Checker/model.py)**
66 |
67 | ## About me
68 |
69 | **Piyush Pathak**
70 |
71 | [**PORTFOLIO**](https://anirudhrapathak3.wixsite.com/piyush)
72 |
73 | [**GITHUB**](https://github.com/piyushpathak03)
74 |
75 | [**BLOG**](https://medium.com/@piyushpathak03)
76 |
77 |
78 | # 📫 Follw me:
79 |
80 | [](https://www.linkedin.com/in/piyushpathak03/)
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/app1.py:
--------------------------------------------------------------------------------
1 |
2 | import numpy as np
3 | from flask import Flask, request, jsonify, render_template
4 | import pickle
5 |
6 | app = Flask(__name__)
7 | model = pickle.load(open('model.pkl', 'rb'))
8 |
9 | @app.route('/')
10 | def home():
11 | return render_template('index1.html')
12 |
13 | @app.route('/predict',methods=['POST'])
14 | def predict():
15 | '''
16 | For rendering results on HTML GUI
17 | '''
18 | float_features = [float(x) for x in request.form.values()]
19 | final_features = [np.array(float_features)]
20 | prediction = model.predict(final_features)
21 | if (prediction >= 0.5):
22 | a = "High"
23 | else:
24 | a = "Low"
25 | return render_template('index1.html',prediction_text="Quality of Alcohol is {}".format(str(a)))
26 |
27 |
28 |
29 |
30 | @app.route('/predict_api',methods=['POST'])
31 | def predict_api():
32 | '''
33 | For direct API calls trought request
34 | '''
35 | data = request.get_json(force=True)
36 | prediction = model.predict([np.array(list(data.values()))])
37 |
38 | output = prediction[0]
39 | return jsonify(output)
40 |
41 | if __name__ == "__main__":
42 | app.run(debug=True)
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/model.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Alcohol-Quality-Checker/model.pkl
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/model.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import pandas as pd
3 | import matplotlib.pyplot as plt
4 | %matplotlib inline
5 | pd.pandas.set_option('display.max_columns',None)
6 |
7 | #Importing Dataset
8 | data = pd.read_csv("alcohol-quality-data.csv")
9 | dataset = data.copy()
10 |
11 | #Preparing Data
12 | Y = pd.DataFrame(dataset['Quality_Category'].replace({"Low":0,"High":1}))
13 | X = dataset.drop(columns=['Quality_Category','pH','density'])
14 |
15 | # Train-Test Split
16 | from sklearn.model_selection import train_test_split
17 | X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.20, random_state=0)
18 |
19 | # Applying KNN
20 | from sklearn.neighbors import KNeighborsClassifier
21 | clf = KNeighborsClassifier(n_neighbors=125)
22 | clf.fit(X_train,np.ravel(y_train))
23 | prediction = clf.predict(X_test)
24 |
25 | # Getting Accuracy
26 | from sklearn.metrics import accuracy_score
27 | score = accuracy_score(prediction,np.ravel(y_test))
28 |
29 | # Model
30 | import pickle
31 | pickle.dump(clf,open('model.pkl','wb'))
32 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/request.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | url = 'http://localhost:5000/predict_api'
4 | r = requests.post(url,json={'sulfate':0.52, 'Alcohole Level':10})
5 |
6 | print(r.json())
7 |
8 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/requirements.txt:
--------------------------------------------------------------------------------
1 | Flask == 1.1.1
2 | gunicorn == 19.9.0
3 | itsdangerous==1.1.0
4 | Jinja2==2.10.1
5 | MarkupSafe==1.1.1
6 | Werkzeug==0.15.5
7 | numpy>=1.9.2
8 | scipy>=0.15.1
9 | scikit-learn>=0.18
10 | matplotlib>=1.4.3
11 | pandas>=0.19
12 |
13 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/static/css/formc.css:
--------------------------------------------------------------------------------
1 |
2 | body{
3 | background: #405d27;
4 | padding-top: 15%;
5 |
6 | }
7 | form{
8 | background: #fff;
9 | }
10 | .form-container{
11 | border-radius: 10px;
12 | padding: 30px;
13 | box-shadow: 0px 0px 10px 0px;
14 | }
15 | .bg{
16 | width: 70px;
17 | height: 70px;
18 | position: absolute;
19 | top: -40px;
20 | left: 40%;
21 | }
22 | textarea {
23 | width: 100%;
24 | height: 150px;
25 | padding: 12px 20px;
26 | box-sizing: border-box;
27 | border: 2px solid #ccc;
28 | border-radius: 4px;
29 | background-color: #f8f8f8;
30 | resize: none;
31 | }
32 |
33 | form.h3{
34 | color: #FFFFFF;
35 | }
36 |
--------------------------------------------------------------------------------
/Alcohol-Quality-Checker/templates/form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Alcohol Quality Checker
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/Cloths_Predictions/__pycache__/predictions.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Cloths-AccessoryClassification using DL/Cloths_Predictions/__pycache__/predictions.cpython-36.pyc
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/Cloths_Predictions/predictions.py:
--------------------------------------------------------------------------------
1 | import os
2 | import tensorflow as tf
3 | import cv2
4 | import numpy as np
5 | from itertools import chain
6 | from tensorflow.keras.applications.vgg16 import preprocess_input
7 | from tensorflow.keras.preprocessing import image
8 | from tensorflow.keras.models import load_model
9 |
10 |
11 | class Cloths_Classification:
12 | def __init__(self):
13 | self.class_names = ['Goggles', 'Hat', 'Jacket', 'Shirt', 'Shoes', 'Shorts', 'T-Shirt', 'Trouser', 'Wallet','Watch']
14 | self.model = load_model("model/fashion.h5")
15 |
16 | def get_prediction(self, image):
17 | img = cv2.imread(image)
18 | dim = (224, 224)
19 | img = cv2.resize(img, dim, interpolation=cv2.INTER_AREA)
20 | x = np.array(img)
21 | x = np.expand_dims(x, axis=0)
22 | x = preprocess_input(x)
23 | preds = self.model.predict(x)
24 | pred_class = self.class_names[np.argmax(preds[0])]
25 | return pred_class
26 |
27 | def list_and_delete_previous_files(self):
28 | self.list_of_files = []
29 | if os.path.exists('./uploads'):
30 | self.list_of_files = os.listdir('./uploads')
31 | print('------list of files------')
32 | print(self.list_of_files)
33 | for self.image in self.list_of_files:
34 | try:
35 | print("------Deleting File------")
36 | os.remove("./uploads/" + self.image)
37 | except Exception as e:
38 | print('error in deleting: ', e)
39 | else:
40 | print('Folder Does not exist!!')
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/README.md:
--------------------------------------------------------------------------------
1 | # Cloths-AccessoryClassification
2 | This project is built for classifying total 10 different type of cloths and accessories with VGG Image Classification Model.
3 |
4 |
5 |
6 |
7 | ---
8 |
9 | ## About Model:
10 | * The model is trained for classes: **'Goggles'**, **'Hat'**, **'Jacket'**, **'Shirt'**, **'Shoes'**, **'Shorts'**, **'T-Shirt'**, **'Trouser'**, **'Wallet'**,**'Watch'**.
11 | * Each class had around 30-50 images during training.
12 | * Images are trained with **VGG** Image Classification Model.
13 |
14 |
15 |
16 | ---
17 |
18 | ## Understanding VGG:
19 |
20 |
21 |
22 | * The full name of **VGG** is the **"Visual Geometry Group"**, which belongs to the Department of Science and Engineering of **Oxford University**.
23 |
24 | * In **[ILSVRC'14](http://www.image-net.org/challenges/LSVRC/#:~:text=The%20ImageNet%20Large%20Scale%20Visual,image%20classification%20at%20large%20scale.&text=Another%20motivation%20is%20to%20measure,indexing%20for%20retrieval%20and%20annotation.)**, VGG was **2nd in Image Classification** and **1st in Localization**.
25 |
26 | * The original purpose of VGG's research on the depth of convolutional networks is to understand how the depth of convolutional networks affects the accuracy and large-scale image classification and recognition.
27 |
28 |
29 |
30 | * In order to deepen the number of network layers and to avoid too many parameters, a small 3x3 convolution kernel is used in all layers.
31 | * Input to VGG Model is **224x224** sized **RGB** Images, contains **3x3** and **1x1** filters and number of fully connected layers differs from VGG-11 to VGG-19.
32 | * 1x1 kernels is introduced to increase expressive power of network and reduce the amount of calculations without affecting input and output dimension.
33 | * In VGG, concept of **using multiple small kernels in multiple stacked Conv. layers** is used insead of **using less no. of Conv. layers and large kernels**, to reduce the model size by reducing total parameters. This adds **more non-linearity** as activation function (Relu) in used multiple times in a set of Conv layes.
34 | * Here, the receptive field of large kernel Conv. layer is same as stacked small kernels Conv. layers with **reduced parameteres**.
35 | * The overall structure includes **5 sets of Conv.** layers followed by **Max Pooling** layers.
36 |
37 | ---
38 |
39 |
40 |
41 | ## Implementing Project:
42 | 1. **Clone Repository and Install [Anaconda](https://docs.anaconda.com/anaconda/install/).**
43 |
44 | 2. **Create Conda Environment with Python 3.6:**
45 |
46 | conda create -n env_name python=3.6
47 |
48 | 3. **Install Libraries from Requirements.txt:**
49 |
50 | pip install -r requirements.text
51 |
52 | 4. **Run app.py:**
53 |
54 | python app.py
55 |
56 | This will run the app on your local machine.
57 |
58 | ---
59 |
60 | ## About me
61 |
62 | **Piyush Pathak**
63 |
64 | [**PORTFOLIO**](https://anirudhrapathak3.wixsite.com/piyush)
65 |
66 | [**GITHUB**](https://github.com/piyushpathak03)
67 |
68 | [**BLOG**](https://medium.com/@piyushpathak03)
69 |
70 |
71 | # 📫 Follw me:
72 |
73 | [](https://www.linkedin.com/in/piyushpathak03/)
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/Readme_Images/Fashion-Model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Cloths-AccessoryClassification using DL/Readme_Images/Fashion-Model.png
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/Readme_Images/VGG-models.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Cloths-AccessoryClassification using DL/Readme_Images/VGG-models.png
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/Readme_Images/cloth-classification.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Cloths-AccessoryClassification using DL/Readme_Images/cloth-classification.gif
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/Readme_Images/vgg16-neural-network.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Cloths-AccessoryClassification using DL/Readme_Images/vgg16-neural-network.jpg
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/app.py:
--------------------------------------------------------------------------------
1 | import sys, os, glob, re
2 | import numpy as np
3 | from wsgiref import simple_server
4 | from flask import Flask, request, jsonify, Response
5 | from flask_cors import CORS, cross_origin
6 | # Keras
7 | from tensorflow.keras.models import load_model
8 | from tensorflow.keras.preprocessing import image
9 | from Cloths_Predictions.predictions import Cloths_Classification
10 | # Flask utils
11 | from flask import Flask, redirect, url_for, request, render_template
12 | from werkzeug.utils import secure_filename
13 | #from gevent.pywsgi import WSGIServer
14 |
15 | # Define a flask app
16 | app = Flask(__name__)
17 |
18 | @app.route('/', methods=['GET'])
19 | def index():
20 | # Main page
21 | return render_template('index.html')
22 |
23 |
24 | @app.route('/predict', methods=['GET', 'POST'])
25 | def upload():
26 | if request.method == 'POST':
27 |
28 | cloth = Cloths_Classification()
29 | cloth.list_and_delete_previous_files()
30 |
31 | f = request.files['file']
32 | basepath = os.path.dirname(__file__)
33 | if not os.path.exists('uploads'):
34 | os.mkdir('uploads')
35 | file_path = os.path.join(basepath, 'uploads', secure_filename(f.filename))
36 | f.save(file_path)
37 |
38 | result = cloth.get_prediction(file_path)
39 | return result
40 | return None
41 |
42 |
43 | if __name__ == '__main__':
44 | app.run(debug=True)
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/requirements.txt:
--------------------------------------------------------------------------------
1 | absl-py==0.8.0
2 | argon2-cffi==20.1.0
3 | astor==0.8.0
4 | async-generator==1.10
5 | attrs==19.1.0
6 | backcall==0.1.0
7 | bleach==3.1.0
8 | cachetools==4.1.1
9 | certifi==2019.9.11
10 | cffi==1.14.4
11 | chardet==3.0.4
12 | Click==7.0
13 | colorama==0.4.1
14 | cycler==0.10.0
15 | decorator==4.4.0
16 | defusedxml==0.6.0
17 | entrypoints==0.3
18 | Flask==1.1.1
19 | Flask-Cors==3.0.8
20 | gast==0.3.2
21 | google-auth==1.19.0
22 | google-auth-oauthlib==0.4.1
23 | google-pasta==0.1.7
24 | grpcio==1.23.0
25 | h5py==2.10.0
26 | importlib-metadata==3.4.0
27 | ipykernel==5.4.3
28 | ipython==7.16.1
29 | ipython-genutils==0.2.0
30 | ipywidgets==7.6.3
31 | itsdangerous==1.1.0
32 | jedi==0.15.1
33 | Jinja2==2.10.1
34 | joblib==1.0.0
35 | jsonschema==3.2.0
36 | jupyter==1.0.0
37 | jupyter-client==6.1.11
38 | jupyter-console==6.2.0
39 | jupyter-core==4.7.0
40 | jupyterlab-pygments==0.1.2
41 | jupyterlab-widgets==1.0.0
42 | Keras==2.3.0
43 | Keras-Applications==1.0.8
44 | Keras-Preprocessing==1.1.0
45 | kiwisolver==1.1.0
46 | Markdown==3.1.1
47 | MarkupSafe==1.1.1
48 | matplotlib==3.1.1
49 | mistune==0.8.4
50 | nbclient==0.5.1
51 | nbconvert==6.0.7
52 | nbformat==5.1.2
53 | nest-asyncio==1.4.3
54 | notebook==6.2.0
55 | numpy==1.17.2
56 | oauthlib==3.1.0
57 | opencv-contrib-python==4.1.1.26
58 | pandocfilters==1.4.2
59 | parso==0.5.1
60 | pickleshare==0.7.5
61 | Pillow==6.1.0
62 | prometheus-client==0.7.1
63 | prompt-toolkit==2.0.9
64 | protobuf==3.14.0
65 | pyasn1==0.4.8
66 | pyasn1-modules==0.2.8
67 | pycparser==2.20
68 | Pygments==2.7.4
69 | pyparsing==2.4.7
70 | pyrsistent==0.17.3
71 | python-dateutil==2.8.0
72 | pywin32==300
73 | pywinpty==0.5.7
74 | PyYAML==5.3.1
75 | pyzmq==21.0.1
76 | qtconsole==5.0.1
77 | QtPy==1.9.0
78 | requests-oauthlib==1.3.0
79 | rsa==4.6
80 | scikit-learn==0.21.3
81 | scipy==1.3.1
82 | Send2Trash==1.5.0
83 | six==1.12.0
84 | sklearn==0.0
85 | tensorboard==1.14.0
86 | tensorflow==1.14.0
87 | tensorflow-estimator==1.14.0
88 | termcolor==1.1.0
89 | terminado==0.9.2
90 | testpath==0.4.2
91 | tornado==6.1
92 | traitlets==4.3.2
93 | typing-extensions==3.7.4.3
94 | wcwidth==0.1.7
95 | webencodings==0.5.1
96 | Werkzeug==0.16.0
97 | widgetsnbextension==3.5.1
98 | wincertstore==0.2
99 | wrapt==1.11.2
100 | zipp==3.4.0
101 | traitlets==4.3.3
102 | urllib3==1.25.9
103 | wcwidth
104 | webencodings==0.5.1
105 | Werkzeug==1.0.1
106 | widgetsnbextension==3.5.1
107 | wincertstore==0.2
108 | wrapt==1.12.1
109 | zipp==3.1.0
110 | gunicorn==19.7.1
111 | selenium==3.8.0
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/static/css/main.css:
--------------------------------------------------------------------------------
1 | .img-preview {
2 | width: 256px;
3 | height: 256px;
4 | position: relative;
5 | border: 5px solid #F8F8F8;
6 | box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
7 | margin-top: 1em;
8 | margin-bottom: 1em;
9 | }
10 |
11 |
12 |
13 | .img-preview>div {
14 | width: 100%;
15 | height: 100%;
16 | background-size: 256px 256px;
17 | background-repeat: no-repeat;
18 | background-position: center;
19 | }
20 |
21 | input[type="file"] {
22 | display: none;
23 | }
24 |
25 |
26 | .upload-label{
27 | display: inline-block;
28 | padding: 12px 30px;
29 | background: #39D2B4;
30 | color: #fff;
31 | font-size: 1em;
32 | transition: all .4s;
33 | cursor: pointer;
34 | }
35 |
36 | .upload-label:hover{
37 | background: #34495E;
38 | color: #39D2B4;
39 | }
40 |
41 | .loader {
42 | border: 8px solid #f3f3f3; /* Light grey */
43 | border-top: 8px solid #3498db; /* Blue */
44 | border-radius: 50%;
45 | width: 50px;
46 | height: 50px;
47 | animation: spin 1s linear infinite;
48 | }
49 |
50 | @keyframes spin {
51 | 0% { transform: rotate(0deg); }
52 | 100% { transform: rotate(360deg); }
53 | }
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/static/js/main.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 | // Init
3 | $('.image-section').hide();
4 | $('.loader').hide();
5 | $('#result').hide();
6 |
7 | // Upload Preview
8 | function readURL(input) {
9 | if (input.files && input.files[0]) {
10 | var reader = new FileReader();
11 | reader.onload = function (e) {
12 | $('#imagePreview').css('background-image', 'url(' + e.target.result + ')');
13 | $('#imagePreview').hide();
14 | $('#imagePreview').fadeIn(650);
15 | }
16 | reader.readAsDataURL(input.files[0]);
17 | }
18 | }
19 | $("#imageUpload").change(function () {
20 | $('.image-section').show();
21 | $('#btn-predict').show();
22 | $('#result').text('');
23 | $('#result').hide();
24 | readURL(this);
25 | });
26 |
27 | // Predict
28 | $('#btn-predict').click(function () {
29 | var form_data = new FormData($('#upload-file')[0]);
30 |
31 | // Show loading animation
32 | $(this).hide();
33 | $('.loader').show();
34 |
35 | // Make prediction by calling api /predict
36 | $.ajax({
37 | type: 'POST',
38 | url: '/predict',
39 | data: form_data,
40 | contentType: false,
41 | cache: false,
42 | processData: false,
43 | async: true,
44 | success: function (data) {
45 | // Get and display the result
46 | $('.loader').hide();
47 | $('#result').fadeIn(600);
48 | $('#result').text(' Result: ' + data);
49 | console.log('Success!');
50 | },
51 | });
52 | });
53 |
54 | });
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/templates/base.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Cloths & Accessories Classification Project
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
24 |
{% block content %}{% endblock %}
25 |
26 |
27 |
28 |
33 |
34 |
37 |
38 |
--------------------------------------------------------------------------------
/Cloths-AccessoryClassification using DL/uploads/jacket1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Cloths-AccessoryClassification using DL/uploads/jacket1.jpg
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/ACT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/ACT.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Dep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Dep.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Details of Variables.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Details of Variables.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Employed_FeMale_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Employed_FeMale_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Employed_Male_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Employed_Male_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Employed_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Employed_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/EmploymentStatus vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/EmploymentStatus vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/GNU license.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/GNU license.jpg
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Gender vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Gender vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/MIT license.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/MIT license.jpg
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Marital_status vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Marital_status vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Married_FeMale_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Married_FeMale_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Married_Male_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Married_Male_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Married_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Married_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/OLS Rgression Results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/OLS Rgression Results.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Response variable Distribution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Response variable Distribution.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Screenshot (111).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/Screenshot (111).png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnEmployed_FeMale_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnEmployed_FeMale_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnEmployed_Male_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnEmployed_Male_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnEmployed_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnEmployed_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnMarried_People vs Policy_type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/UnMarried_People vs Policy_type.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/bar1 total cliam vs education.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/bar1 total cliam vs education.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/bar2 total cliam vs Gender.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/bar2 total cliam vs Gender.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/bar3 total cliam vs empstatus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/bar3 total cliam vs empstatus.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clt vs tca scatterplot empstatus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clt vs tca scatterplot empstatus.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clt vs tca scatterplot maritalstatus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clt vs tca scatterplot maritalstatus.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clt vs tca scatterplot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clt vs tca scatterplot.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clv.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clv.jpg
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clvout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/clvout.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/fit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/fit.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/hist 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/hist 1.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/hist 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/hist 2.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/hist 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/hist 3.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/res.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/CLTP Analysis Output/res.png
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn app:app
2 |
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/Procfile.txt:
--------------------------------------------------------------------------------
1 | web: gunicorn app:Customer-Life-Time-Value-Prediction-api
2 |
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # CUSTOMER LIFE TIME VALUE PREDICTION
4 |
5 |
6 | Heroku App Link : https://customerlifetimevaluepred.herokuapp.com/
7 |
8 | ## DEPLOYMENT OUTPUT
9 |
10 | 
11 |
12 | # Table Of Contents
13 | - [PROJECT GOAL](#PROJECT-GOAL)
14 | - [Project Motivation](#Project-Motivation)
15 | - [Requirements Installation](#Requirements-Installation)
16 | - [File Section](#File-Section)
17 | - [Technologies Used](#Technologies-Used)
18 | - [OLS REGRESSION MODEL OUTPUT](#OLS-REGRESSION-MODEL-OUTPUT)
19 | - [License](#License)
20 | - [Sample EDA VISUALIZATIONS](#Sample-EDA-VISUALIZATIONS)
21 |
22 | # PROJECT GOAL
23 |
24 | #### This project is designed to predict the CUSTOMER LIFE TIME VALUE of four wheeler insurance company using Regression Analysis with Python, FLASK, HTML, SQL
25 | #### A highly comprehensive analysis with all data cleaning, exploration, visualization, feature selection, model building, evaluation and MLR assumptions validity steps explained in detail.
26 |
27 | # Project Motivation
28 |
29 | **Every Organization runs with the goal to get a profit from their product and customers, most of the organization is workig hard without compromizing quality of products to help those organization business requirement, this project has been designed**
30 |
31 | # Requirements Installation
32 |
33 | **The Code is written in Python 3.7. If you don't have Python installed you can find it here. If you are using a lower version of Python you can upgrade using the pip package, ensuring you have the latest version of pip. To install the required packages and libraries, run this command in the project directory after cloning the repository**
34 |
35 | pip install -r requirements.txt
36 |
37 | # File Section:-
38 |
39 |
40 | ### In Customer Lifetime Value (Exploratory Data Analysis).py
41 |
42 | 1- **Data Preprocessing** and some **Exploratory Data Analysis** to understand the data
43 |
44 | 2- **Data cleaning**
45 |
46 |
47 |
48 | ### In Customer Lifetime Value (Feature Engineering).py
49 |
50 | 1- Data preparation: **Feature Engineering and Scaling**
51 |
52 | 2- Feature Selection using **RFE and Model Building**
53 |
54 | 3- **Regression Assumptions** Validation and **Outlier Removal**
55 |
56 | 4- Rebuilding the Model Post Outlier Removal: Feature Selection & RFE
57 |
58 | 5- **Removing Multicollinearity**, Model Re-evaluation and Assumptions Validation
59 |
60 | ## Details of Variables [Response Variable ==> Customer Life Time Value]
61 |
62 | 
63 |
64 | ## OLS REGRESSION MODEL OUTPUT
65 |
66 | 
67 |
68 | ## Data Points vs Fitted Line
69 |
70 | 
71 |
72 | ## Actual Points vs Fitted Points
73 |
74 | 
75 |
76 | # Technologies Used
77 |
78 | 
79 | 
80 | 
81 |
82 | ## About me
83 |
84 | **Piyush Pathak**
85 |
86 | [**PORTFOLIO**](https://anirudhrapathak3.wixsite.com/piyush)
87 |
88 | [**GITHUB**](https://github.com/piyushpathak03)
89 |
90 | [**BLOG**](https://medium.com/@piyushpathak03)
91 |
92 |
93 | # 📫 Follw me
94 |
95 | [](https://www.linkedin.com/in/piyushpathak03/)
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/RF_KModel.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/RF_KModel.pkl
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/app.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from flask import Flask, request, jsonify, render_template
3 | import pickle
4 |
5 | app = Flask(__name__)
6 | regressor = pickle.load(open('RF_KModel.pkl', 'rb'))
7 |
8 | @app.route('/')
9 | def home():
10 | return render_template('index.html')
11 |
12 | @app.route('/predict',methods=['POST'])
13 | def predict():
14 | if request.method == "POST":
15 | Income = request.form["Income"]
16 | Monthly_Premium_Auto = float(request.form["Monthly_Premium_Auto"])
17 | Months_Since_Last_Claim = float(request.form["Months_Since_Last_Claim"])
18 | Months_Since_Policy_Inception = float(request.form["Months_Since_Policy_Inception"])
19 | Number_of_Policies = float(request.form["Number_of_Policies"])
20 | Total_Claim_Amount = float(request.form["Total_Claim_Amount"])
21 | distance = float(request.form["distance"])
22 |
23 |
24 | prediction=regressor.predict([[
25 | Income,
26 | Monthly_Premium_Auto,
27 | Months_Since_Last_Claim,
28 | Months_Since_Policy_Inception,
29 | Number_of_Policies,
30 | Total_Claim_Amount,
31 | distance
32 | ]])
33 |
34 | output=round(prediction[0],2)
35 |
36 | return render_template('index.html',prediction_text="Your Customer Life Time price is Rs. {}".format(output))
37 |
38 |
39 | return render_template("index.html")
40 |
41 |
42 |
43 |
44 |
45 |
46 | if __name__ == "__main__":
47 | app.run(debug=True)
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/requirements.txt:
--------------------------------------------------------------------------------
1 | flasgger==0.9.4
2 | Flask==1.0.3
3 | gunicorn==19.9.0
4 | itsdangerous==1.1.0
5 | Jinja2==2.10.1
6 | MarkupSafe==1.1.1
7 | Werkzeug==0.15.5
8 | numpy==1.18.1
9 | pandas==1.0.3
10 | scikit-learn==0.22.1
11 | scipy==1.4.1
12 | seaborn==0.10.1
13 |
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/static/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/static/cover.jpg
--------------------------------------------------------------------------------
/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/templates/img_girl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Customer-Life-Time-Value-Prediction-Flask-Deployment--Heroku-master/templates/img_girl.jpg
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn app:app
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # Employee Attrition Rate Prediction
4 |
5 | Heroku App Link : https://emloyeeattritionrate.herokuapp.com/home
6 |
7 | # Table Of Contents
8 | - [PROJECT GOAL](#PROJECT-GOAL)
9 | - [Project Motivation](#Project-Motivation)
10 | - [Requirements Installation](#Requirements-Installation)
11 | - [File Section](#File-Section)
12 | - [Technologies Used](#Technologies-Used)
13 | - [License](#License)
14 | - [Credits](#Credits)
15 |
16 | # PROJECT GOAL
17 |
18 | #### This project is designed to predict the E MPLOYEE ATTRITION RATE Iin corporate organization or company using Regression Analysis with Python, FLASK, HTML, SQL
19 | #### A highly comprehensive analysis with all data cleaning, exploration, visualization, feature selection, model building, evaluation and MLR assumptions validity steps explained in detail.
20 |
21 | # Project Motivation
22 |
23 | **Every Organization runs with the goal to get a profit from their products, most of the organization is workig hard with support of employed professionals so Attrition is important to consider, so its motivated me to do this project**
24 |
25 | # Requirements Installation
26 |
27 | **The Code is written in Python 3.7. If you don't have Python installed you can find it here. If you are using a lower version of Python you can upgrade using the pip package, ensuring you have the latest version of pip. To install the required packages and libraries, run this command in the project directory after cloning the repository**
28 |
29 | pip install -r requirements.txt
30 |
31 | # File Section
32 |
33 | 1- **Data Preprocessing** and some **Exploratory Data Analysis** to understand the data
34 |
35 | 2- **Data cleaning**
36 |
37 | 3- Feature Selection using **RFE and Model Building**
38 |
39 | 4- **Regression Assumptions** Validation and **Outlier Removal**
40 |
41 | 5- Rebuilding the Model Post Outlier Removal: Feature Selection & RFE
42 |
43 | 6- **Removing Multicollinearity**, Model Re-evaluation and Assumptions Validation
44 |
45 | # Technologies Used
46 |
47 | 
48 | 
49 | 
50 |
51 | # License
52 |
53 | 
54 |
55 |
56 |
57 | https://www.apache.org/licenses/LICENSE-2.0
58 |
59 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
60 |
61 |
62 | # Credits
63 | Jason Brownlee
64 |
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/app.py:
--------------------------------------------------------------------------------
1 | from flask import Flask, render_template, request, redirect, url_for,session
2 | import pandas as pd
3 | import numpy as np
4 | import pickle
5 | from werkzeug.utils import secure_filename
6 | import os
7 | from flask import jsonify
8 |
9 |
10 | #prep data
11 | def prep_data(df):
12 |
13 | cat_df = pd.get_dummies(df[['OverTime']], drop_first=True)
14 | num_df = df[['Age','HourlyRate','DailyRate','MonthlyIncome','TotalWorkingYears','YearsAtCompany','NumCompaniesWorked','DistanceFromHome']]
15 | new_df = pd.concat([num_df,cat_df], axis=1)
16 | return new_df
17 |
18 | #
19 | def allowed_file(filename):
20 | return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
21 |
22 | UPLOAD_FOLDER = './templates'
23 | ALLOWED_EXTENSIONS = set(['csv'])
24 |
25 |
26 |
27 | ## Initialize the app
28 | app = Flask(__name__)
29 |
30 | app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
31 |
32 | @app.route('/home')
33 | def analysis_page():
34 | # render a static template
35 | return render_template('home.html')
36 |
37 | @app.route('/')
38 | def index():
39 | # redirect to home
40 | return redirect(url_for('analysis_page'))
41 |
42 | @app.route('/prediction', methods=['GET','POST'])
43 | def prediction_page():
44 | if request.method == 'POST':
45 | #check if post request has the file type
46 | if 'file' not in request.files:
47 | return render_template('home.html', error='No File part',retJson ='No file part')
48 | file = request.files['file']
49 | # if user the did not select file
50 | if file.filename == '':
51 | return render_template ('home.html',error='No file Selected', retJson='No File Selected')
52 | #check for allowed extension
53 | if file and allowed_file(file.filename):
54 | filename = secure_filename(file.filename)
55 | file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
56 | # load the model from disk
57 | loaded_model = pickle.load(open('./random_forest_hr_model.sav', 'rb'))
58 | # read csv
59 | data = pd.read_csv(filename)
60 | prediction = loaded_model.predict_proba(prep_data(data))
61 | # get percentage proba
62 | retJson = []
63 | count = 0
64 | for prob in prediction:
65 | count+=1
66 | retJson.append("The probability of Employee Attrition with index {} : {} % ".format(count,prob[0] * 100))
67 |
68 |
69 |
70 | #retJson =jsonify({'retJson' :retJson})
71 |
72 | return render_template('home.html',error=None, retJson= retJson )
73 | # render a static template
74 | return render_template('home.html')
75 |
76 | @app.route('/attrition', methods=['GET','POST'])
77 | def single_prediction_page():
78 | if request.method == 'POST':
79 | Age = request.form['Age']
80 | HourlyRate = request.form['HourlyRate']
81 | OverTime = request.form['OverTime']
82 | DailyRate = request.form['DailyRate']
83 | MonthlyIncome = request.form['MonthlyIncome']
84 | TotalWorkingYears = request.form['TotalWorkingYears']
85 | YearsAtCompany = request.form['YearsAtCompany']
86 | NumCompaniesWorked = request.form['NumCompaniesWorked']
87 | DistanceFromHome = request.form['DistanceFromHome']
88 |
89 | if len(Age) <= 0 or len(HourlyRate) <= 0 or len(OverTime) <= 0 or len(DailyRate) <= 0 or len(MonthlyIncome)<= 0 or len(TotalWorkingYears) <= 0 or len(YearsAtCompany) <= 0 or len(NumCompaniesWorked) <= 0:
90 | return render_template('home.html', retJson= 'All filed is required to make prediction' )
91 |
92 | if OverTime == 'Yes':
93 | OverTime_Yes = 1
94 | else:
95 | OverTime_Yes = 0
96 | #create a pandas dataframe
97 | df = pd.DataFrame([{'Age': Age, 'HourlyRate': HourlyRate,'DailyRate':DailyRate, 'MonthlyIncome': MonthlyIncome,
98 | 'TotalWorkingYears':TotalWorkingYears, 'YearsAtCompany': YearsAtCompany, 'NumCompaniesWorked':NumCompaniesWorked,
99 | 'DistanceFromHome':DistanceFromHome, 'OverTime_Yes': OverTime_Yes}])
100 | loaded_model = pickle.load(open('./random_forest_hr_model.sav', 'rb'))
101 | #print(df.head())
102 |
103 | #temp = [ Age, HourlyRate, DailyRate, MonthlyIncome,TotalWorkingYears, YearsAtCompany, NumCompaniesWorked,DistanceFromHome, OverTime_Yes]
104 | #temp = np.reshape(1,-1)
105 |
106 | prediction = loaded_model.predict_proba(df)
107 |
108 | retJson = []
109 | for prob in prediction:
110 | retJson.append("The probability is : {} % ".format(prob[0] * 100))
111 |
112 | return render_template('prob.html',error=None, retJson= retJson )
113 | # render a static template
114 | return render_template('home.html')
115 |
116 |
117 |
118 | if __name__ =='__main__':
119 | app.run(debug=True)
120 |
121 |
122 |
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/random_forest_hr_model.sav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/random_forest_hr_model.sav
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/requirements.txt:
--------------------------------------------------------------------------------
1 | flask
2 | numpy
3 | pandas
4 | sklearn
5 | werkzeug
6 | gunicorn
7 |
8 |
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/static/ATTT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/static/ATTT.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/static/At.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/static/At.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/static/attta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/static/attta.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/gg5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/gg5.jpg
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/logo.jpg
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_103_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_103_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_110_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_110_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_17_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_17_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_25_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_25_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_30_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_30_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_34_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_34_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_36_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_36_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_38_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_38_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_40_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_40_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_43_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_43_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_46_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_46_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_48_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_48_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_50_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_50_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_52_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_52_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_55_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_55_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_57_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_57_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_60_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_60_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_63_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_63_0.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_65_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_65_0.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_72_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_72_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_96_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_96_0.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_99_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piyushpathak03/End-to-End-small-projects/b3a94999cad7cf3a0140635d12a7f41c59cc48b5/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/output_99_1.png
--------------------------------------------------------------------------------
/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/Employee-Attrition-Rate-Prediction-Flask--Deployment-Heroku-master/templates/prob.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Home
12 |
13 |
14 |
15 |
16 |
17 |
44 |
45 |
46 |
55 | {{ retJson }}
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
76 |
77 |