# Hybrid Modeling for Stream Flow Estimation: Integrating Machine Learning and Federated Learning
## 3 Material and Experimental Methods
### Linear Regression  
Within the realm of predictive modeling, linear regression emerges as a potent tool, its utility stemming from its ability to forecast one variable's behavior based on the nuances of another. This dynamic interplay revolves around the juxtaposition of two key actors--the dependent variable, which stands as the focal point of prediction, and the independent modifiers, the variables that yield their influence to forecast the outcome [57]. The linchpin of this technique lies in its quest to establish a linear connection between these two variables, a link solidified through the framework of the following Equation:  
\[y^{\prime}=b+W1X1\]  
where:  
* \(y^{\prime}\) represents the predicted label or desired output;
* \(b\) denotes the bias, also known as the y-intercept;
* \(W1\) represents the weight of feature 1, analogous to the concept of \"slope\";
* \(X1\) represents a feature, which is a known input in the model.  
At its core, linear regression stands as a cornerstone statistical approach--an architecture for crafting a linear narrative that binds two entities. These entities are dichotomous: the dependent variable, akin to a questing protagonist whose fate we wish to unveil, and the independent variable, akin to an oracle whose insights herald the protagonist's journey. In the tapestry of this specific study, the spotlight pivots to the application of linear regression as it endeavors to fathom the river flow rate (the dependent variable) through the prism of daily average temperature and precipitation data (the independent variables). These data streams, gleaned from stream gauging station E12A003 (Besdegrimen) and meteorological station numbered 17155 (Kutahya), become the ingredients of this predictive cauldron. To unleash the magic, the data from both stations undergo meticulous calibration, ensuringseamless alignment of daily average flow rate data with corresponding temperature and precipitation data spanning 1980 to 2022. Before embarking on the regression odyssey, a preliminary dance of data exploration commences--a phase where enlightenment is gleaned from the relationships between the variables. Scatter plots and correlation analysis take center stage, illuminating the potential symphony between temperature, precipitation, and flow rate. With these insights as guiding stars, the linear regression model embarks on its training journey. This model, a mathematical embodiment of the bond between dependent and independent variables, endeavors to decipher the intricate choreography between flow rate and the interplay of temperature and precipitation. Once the model is steeped in the wisdom of historical data, its performance becomes the subject of rigorous scrutiny--metrics like R-squared, MSE, and RMSE stand as the judges, quantifying the model's resonance with reality. With the accolade of successful training and evaluation, the model stands ready to predict. Armed with daily average temperature and precipitation data, this mathematical oracle efficiently forecasts the corresponding flow rate for any forthcoming day.  
As the dust of regression settles, the resultant insights shine a spotlight on the nuanced relationships between temperature, precipitation, and river flow rate. The model's coefficients assume the role of storytellers, recounting the strength and direction of these bonds, thereby illuminating the hydrological ballet within the Porsuk Stream sub-basin of the Sakarya Basin. The canvas of this study is rich with potential, offering a window into the intricate tapestry woven by temperature, precipitation, and river flow rate. These insights, invaluable gems, serve as beacons for water resource management, fueling ecologically conscious planning and nurturing the delicate equilibrium of the environment.