Rain Prediction: ANN

Photo by LISTENXU on Dribbble

TABLE OF CONTENTS

  1. IMPORTING DATA

2.LOADING DATA

3.DATA VIZUALIZATION AND TECHNIQUES

4.DATA PREPROCESSING

5.MODEL BUILDING

6.CONCLUSION

7.End

LIBRARIES

IMPORTING LIBRARIES

https://gist.github.com/sgsg704/d9983a3afea1a887564ff6b193f2c80f

LOADING DATA

  1. ABOUT THE DATA

Context

Predict next-day rain by training classification models on the target variable Rain Tomorrow.

Content

This dataset contains about 10 years of daily weather observations from many locations across Australia.

Rain Tomorrow is the target variable to predict. It means — did it rain the next day, Yes or No? This column is Yes if the rain for that day was 1mm or more.

LINK- https://www.kaggle.com/jsphyg/weather-dataset-rattle-package

https://gist.github.com/sgsg704/b348002c23d88aae64ed4de0cca20413

DATA VISUALIZATION AND CLEANING

Points to notice:

  • There are missing values in the dataset
  • Dataset includes numeric and categorical values

DATA VISUALIZATION AND CLEANING

Steps involves in this section:

  • Count plot of target column
  • Correlation amongst numeric attributes
  • Parse Dates into datetime
  • Encoding days and months as continuous cyclic features

https://gist.github.com/sgsg704/56b07756216d595e6146e32307e35ae1

https://gist.github.com/sgsg704/b07218222df39faf671dbd454d99abdf

https://gist.github.com/sgsg704/4522db2b86099de9666261ce014e8ec3


https://gist.github.com/sgsg704/8590d8ec9fb3f973945bdb15d1cc8f48

https://gist.github.com/sgsg704/c312d80d65943294dbadbbb9b40aede7

https://gist.github.com/sgsg704/70f73beb7cce6fb657f874a45b05e2f4


https://gist.github.com/sgsg704/69e106c00b2652c2719609b8c77af0ee

DATA PREPROCESSING

Steps involved in Data Preprocessing:

  • Label encoding columns with categorical data
  • Perform the scaling of the features
  • Detecting outliers
  • Dropping the outliers based on data analysis

https://gist.github.com/sgsg704/70f73beb7cce6fb657f874a45b05e2f4https://gist.github.com/sgsg704/313b9128299026659cf96a6a38ec1a20

MODEL BUILDING

Following steps are involved in the model building

  • Assigning X and y the status of attributes and tags
  • Splitting test and training sets
  • Initializing the neural network
  • Defining by adding layers
  • Compiling the neural network
  • Train the neural network

https://gist.github.com/sgsg704/ce5b6a1e472bd54e5874f32124b0db12


https://gist.github.com/sgsg704/136cd65f2bda019de2be3990aa214c46


https://gist.github.com/sgsg704/ac9940710558d7f408cd3b34e26abfc8

Plotting training and validation loss over epochs

https://gist.github.com/sgsg704/fbef11acbfb5087d0bf92e8f5792fa8a

https://gist.github.com/sgsg704/e8e21c01917614993c74e49225cbf187

CONCLUSIONS

Concluding the model with:

  • Testing on the test set
  • Evaluating the confusion matrix
  • Evaluating the classification report

https://gist.github.com/sgsg704/580b27b98c973584657773638b6f67a2

DEEP CC

https://gist.github.com/sgsg704/61f3faaeef64f1f157ee0045024f801d

Notebook Link: Here

Credit : Hrithikgupta