1. Introduction
2. Data preparation
- Date : date of observation
- Location : region within Australia
- MinTemp : Minimum temperature in teh day in degree Celsius
- MaxTemp : Maximum temperature in teh day in degree Celsius
- Rainfall : The amount of rainfall recorded for the day in mm
- Evaporation : The so-called Class A pan evaporation (mm) in the 24 hours to 9am
- Sunshine : The number of hours of bright sunshine in the day.
- WindGustDir : The direction of the strongest wind gust in the 24 hours to midnight
- WindGustSpeed : The speed (km/h) of the strongest wind gust in the 24 hours to midnight
- WinDir9am : Direction of the wind at 9am
- WinDir3pm : Direction of the wind at 3pm
- WindSpeed9am : Wind speed (km/hr) averaged over 10 minutes prior to 9am
- WindSpeed3pm : Wind speed (km/hr) averaged over 10 minutes prior to 3pm
- Humidity9am : Humidity (percent) at 9am
- Humidity3pm : Humidity (percent) at 3pm
- Pressure9am : Atmospheric pressure (hpa) reduced to mean sea level at 9am
- Pressure3pm : Atmospheric pressure (hpa) reduced to mean sea level at 3pm
- Cloud9am : Fraction of sky obscured by cloud at 9am. This is measured in "oktas", which are a unit of eigths. It records how many
- Cloud3pm : Fraction of sky obscured by cloud at 3pm. This is measured in "oktas", which are a unit of eigths. It records how many
- Temp9am : Temperature (degrees C) at 3pm
- Temp3pm : Temperature (degrees C) at 9am
- RainToday : Boolean: 1 if precipitation (mm) in the 24 hours to 9am exceeds 1mm, otherwise 0
- There are a total of 145460 observations.
I) Import the libraries
This is how we import libraries in python using import keyword. NumPy is the fundamental package for scientific computing with Python. Pandas is for data manipulation and analysis. Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that condition (normally) doesn’t warrant raising an exception and terminating the program. Other libraries are import according to the requirements.
What we want to predict here is the RainTomorrow column.
Together with the information on the other columns, we want to know if it will rain the day after a given day.
4. Model Design
5. Hyper parameter selection
We selects binary cross entropy, as the loss function adam as the optimizer without any learning rate.
6. Overview of the Implementation platform
To train our model we need a platform which need to be satisfy hardware requirements of training model in order to get the expected results with our model design and hyper parameters. For that we need GPU work stations specially in training the network. But its not possible to have such GPU stations with our local machines. So that we choose google colab environment which provide all hardware requirements with GPU to train our model with our expectations.
Whenever we execute each segment according to the requirements hardware allocation will change. Specially when model execution time and training time need of GPU was very high.
7. Training
Training happened by changing the activation function and number of neurons in each layer and its accuracy measured as shown below. For further clarification all cases mentioned in the source code too.
8. Optimizing the hyper parameters
9. Final Optimized Model
10. Test Results
Even if the accuracy gives us important information, it is not enough on its own to validate the model used. For that we analyzed using f1 score and confusion matrix.
f1 score and cm matrix for final optimized model
Cross validation with KFold
11. Discussion
On the whole, for the prediction of rain we created a neural network model. For that we chosen kaggle to get dataset. When chosen our model design and hyper parameter, we select model and hyper parameter in an assumption or past implementation and make them to optimized by hyper parameter tuning help of experimental results. finally select optimized model with optimizing hyper parameters.
After that we check our accuracy with f1 score and confusion matrix. Further we used K- fold validation for testing our performance.
12.References
https://www.kaggle.com/datasets/jsphyg/weather-dataset-rattle-package?resource=download
https://hackernoon.com/what-steps-should-one-take-while-doing-data-preprocessing-502c993e1caa
https://www.youtube.com/watch?v=57N1g8k2Hwc

















.png)






Comments
Post a Comment