## 2 Materials and Methods
### ML Building Model
Additionally, we will create a query to retrieve the remaining records for both categories to implement the testing part. Query to select 70% of records with Magnitude > 0 is as follows:  
_WITH MagnitudePositive AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY NEWID()) AS RowNum_  
_FROM WeatherDataVrancea_  
_WHERE Magnitude > 0_  
_)_  
_SELECT *_  
_FROM MagnitudePositive_  
_WHERE RowNum <= (SELECT COUNT(*) * 0.7 FROM WeatherDataVrancea WHERE Magnitude > 0);_  
This query returns 154 records, representing nearly 70% of the 221 records with Magnitude > 0 associated with a produced event. The query to Select 70% of Records with Magnitude = 0 is:  
_WITH MagnitudeZero AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY NEWID()) AS RowNum_  
_FROM WeatherDataVrancea_  
_WHERE Magnitude = 0_  
_SELECT *_  
_FROM MagnitudeZero_  
_WHERE RowNum <= (SELECT COUNT(*) * 0.7 FROM WeatherDataVrancea WHERE Magnitude = 0);_  
This query returns 5982 records from 8766, representing nearly 70% of the days no earthquake occurred. Therefore, 6136 records out of 8766 will be used for training the model, and 2630 will be used for validation. Once the data were compiled, they were exported to a CSV format. This CSV file was uploaded into the ML.NET framework, facilitating the ML model's training phase. By utilizing this dataset, the model learned the underlying patterns associated with seismic activity, enhancing its predictive capabilities. The training time of an ML model can vary based on several factors, including the model's complexity, the data volume, and the hardware specifications. Multiple tests were conducted to identify the optimal training time for the scenario involving 8766 records. During this process, various training durations were evaluated to determine how they influenced the model's performance in predicting earthquake magnitudes. The testing involved monitoring the training loss and validation metrics over different epochs to ascertain when the model began to converge effectively. We systematically varied the training duration to balance underfitting and overfitting the data. This thorough exploration of training times ensured that the final model learned the underlying patterns in the dataset and maintained generalizability to new, unseen data. The EMM model was trained for 6000 min. The FastFreeTweedieRegression model yielded the best results, achieving an R\({}^{2}\) value of 0.9658. This demonstrates high accuracy in predicting earthquake probabilities based on the input features. The superior results of the EMM model in the binary approach led to a new set of tests that utilized a data classification scenario. In this context, the model was retrained over 6000 min, and the results indicated that the FastTreeOva algorithm provides a theoretical accuracy of 99.84%. This model was derived after exploring 3151 other models. After identifying the optimal training time to the desired accuracy level, an algorithm was implemented to generate predictions of days with potential seismic risk for the Vrancea region. This algorithm uses the trained EMM model to analyze the input data, including weather parameters and seismic activity, and provides predictions for the next five days. This allows for short-term risk assessment and enables proactive measures in the Vrancea region. By applying the model to new data, the algorithm aims to forecast periods of increased seismic risk, helping to inform and prepare for possible earthquake events in the region. For all the analyzed algorithms, the configuration set the learning rate to 10%, applied a dropout rate of 20%, and fixed the number of epochs at 100. These parameter settings were chosen to ensure an equidistant evaluation of the models' performance while balancing underfitting and overfitting. These values were selected because they are predefined in ML.NET. This configuration was empirically determined to provide balanced performance across various applications, ensuring stability and efficiency during model training.