A simple neural network written entirely from scratch in Python that predicts the chance of rain using only:
- Humidity
- Cloud cover
The model trains itself using backpropagation, saves the best weights, and allows you to test predictions later.
It also includes premade datasets for:
- Seattle (April–May)
- Bangalore (April–May)
- 2-input neural network
- 4 hidden neurons + 1 output neuron
- Sigmoid activation function
- Xavier weight initialisation
- Automatic learning rate decay
- Automatic restart if training gets stuck
- Saves the best model as a
.pklfile - Separate model loader and tester
- Premade Seattle and Bangalore weather datasets
Inputs:
- Humidity (0.00–1.00)
- Cloud cover (0.00–1.00)
Output:
- Rain probability from 0.00–1.00
Example:
| Humidity | Cloud Cover | Predicted Rain Chance |
|---|---|---|
| 0.45 | 0.12 | Very unlikely |
| 0.65 | 0.80 | Likely |
| 0.74 | 0.78 | Very likely |
2 Inputs
↓
4 Hidden Neurons
↓
1 Output Neuron