A forecasting system built around a Multi-Layer Perceptron (MLP) implemented entirely from scratch in Python and NumPy that predicts daily river flow rates.
A significant focus was placed on data preprocessing and feature engineering to prepare the historical sensor and weather data for the model. Raw environmental data was cleaned and normalized, and the feature set was enriched by engineering lag-based variables and cyclical (sin/cos) features for time-series data. To ensure model stability, multicollinearity was carefully reduced through weighted feature combination.
The core of the project is the modular, object-oriented neural network. Designed for maximum flexibility, it supports: Customizable network architecture, including the number and size of layers. Switchable activation functions (sigmoid and tanh). Advanced training techniques implemented from scratch, such as momentum, annealing, bold driver, and weight decay.
During the training phase, six unique MLP configurations were rigorously evaluated over 7,000 to 15,000 epochs to identify the most effective architecture. The final model achieved a strong performance with an RMSE of 15.49 and an R² of 0.826, significantly outperforming a baseline Adaline model. The model's ability to generalize was validated using unseen test data, where it demonstrated robust forecasting capability.