This is a Flask web app which predicts whether it will rain tomorrow or not.
https://www.kaggle.com/jsphyg/weather-dataset-rattle-package
Firstly, the dataset was bisected and numerical(continuous,discrete) and categorical features were identified. Missing Values were handled using Random Sample imputation to maintain the variance,Categorical Values like location, wind direction were handled by using Target guided encoding. Outliers were handled using IQR and boxplot. Feature scaling was also performed but it was not required. These are present in the ipynb file named "Data Preprocessing". Secondly, Feature Selection was done considering correlation heatmap and Extra Trees Classifier and plotting the feature importances but all the features were considered as it has only 25 features. This is present in the ipynb file named "Feature Selection". Finally, Imbalanced Dataset was handled using SMOTE. Model Creation was then performed. Different types of Machine Learning algorithms were tried like catboost, random forest, logistic regression, xgboost, support vector machines, knn, naive bayes and Decision tree. Out of these models the best classifier was selected. Catboost, random forest and Xgboost were the top 3. However, Xgboost out performed others slightly. So, the best classifier model was Xgboost. Hyperparameter Optimazation was also performedusing RandomizedSearchCV but due to system limitations a small sample out of the dataset was considered. The conclusion were made using classification metrics, roc curve and auc score.
The Code is written in Python 3.7.3 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:
conda create -n myenv python=3.7
conda activate myenv
pip install -r requirements.txt
python app.py
Login or signup in order to create virtual app. You can either connect your github profile or download Heroku CLI to manually deploy this project.
Our next step would be to follow the instruction given on Heroku Documentation to deploy a web app.
├── templates
│ ├── home.html
├── rainy.html
├── sunny.html
├── static
├── predictor.css
├── style01.css
├── Procfile
├── README.md
├── app.py
├── Xgboost model.ipynb
├── xg_random.pkl
├── requirements.txt
The rest ipynb files are for selecting the best classifier.
http://rainpredsm.herokuapp.com/
- Deploying the Web Application on Cloud.
- Google Cloud
- Azure
- AWS EC2 Instance