## 3 Research Methodology
### Method Overview  
The current study leverages machine learning (ML) models to analyze data from aquaculture facilities in the Ionian Sea, Greece, aiming to predict and manage farmed fish mortalities. The research methodology follows a structured, eight-stage process, as illustrated in Figure 1.  
Each stage of the methodology builds upon the previous one, ensuring a systematic flow of data and processes. Below is a detailed breakdown of each step, specifying the inputs and outputs at each stage:  
Stage 1: Data Collection  
The first step involves collecting two datasets from aquaculture facilities. The first dataset includes water chemical and microbiological data collected from March 2016 to June 2022. The second dataset contains operational data, including fish counts, mortality rates, feeding practices, and environmental conditions, collected from January 2018 to November 2022 [21]. These datasets serve as the **input** for subsequent preprocessing.  
Stage 2: Data Preprocessing  
Both datasets undergo preprocessing to ensure data quality and consistency in this step. This includes handling missing values, normalizing variables, and removing outliers [21]. Preprocessed data are the input for data storage and management in the next stage.  
Stage 3: Data Storage and Management  
After preprocessing, the data are stored and managed using an Apache Cassandra 4.1.0 setup for distributed data storage. Data processing and ML tasks are executed with Apache Spark 3.4.0 and integrated via the Spark-Cassandra Connector. This step uses a virtual machine setup (Oracle VM VirtualBox 7.0 running Ubuntu Linux 22.04 on a Windows 10 host OS) [22; 23; 24; 25; 26; 27]. The input to this stage is the clean, preprocessed data, which is stored and managed for subsequent model selection and analysis.  
Stage 4: Model Selection and Data Splitting  
In this stage, three ML models are chosen: DTs, Random Forest, and Linear Regression. These models are selected for their performance in predictive tasks using the collected data. At this stage, the preprocessed dataset is split into training and testing subsets [28; 29; 30; 31; 32; 33]. The input is the managed dataset, which is split for training and testing the ML models.  
Figure 1: Process overview.  
Stage 5: Model Performance Evaluation  
Model performance is assessed using the following metrics: MSE, RMSE, R\({}^{2}\), and C-index. These metrics help measure how well each model predicts fish mortality rates [28; 29; 30; 31; 32; 33]. The trained models and the testing dataset are input to this stage. The output is the performance metrics that guide model refinement and future ML implementations.  
Stage 6: ML Implementation  
This stage focuses on applying the selected ML models to the dataset to identify the key factors affecting fish mortality. The input to this stage includes the trained ML models and the testing data [28; 29; 30; 31; 32; 33]. The ML implementation helps predict fish mortality and provides insights into factors influencing survival rates.  
Stage 7: Insights and Analysis  
In this stage, the results from ML model predictions are analyzed. This analysis helps identify trends, anomalies, and relationships between variables. The input is the predictions generated by the ML models. The outcome of this stage offers new insights into aquaculture management, helping to fine-tune practices and strategies [28; 29; 30; 31; 32; 33].  
Stage 8: Recommendations  
The final stage compiles the study's findings and provides recommendations for improving aquaculture management. The recommendations focus on optimizing water quality, feeding practices, and environmental management to enhance fish survival and sustainability [28; 29; 30; 31; 32; 33]. The input includes the insights from Stage 7, which are translated into practical, actionable strategies for aquaculture facilities.