## 5 Modeling and Evaluation  
In financial forecasting, accurately predicting cryptocurrency prices is crucial due to the volatile and dynamic characteristics of digital assets. This study investigated the use of machine learning and deep learning models to forecast closing prices of cryptocurrencies, specifically emphasizing Random Forest and feedforward neural network techniques. Both models were assessed for their capacity to manage the complexities and non-linear trends present in financial datasets, utilizing important features like 'Volume' and 'Marketcap' for prediction. The methodologies along with their implementation details are provided below. This study employed the Random Forest (RF) model and Gradient Boosting (GB) regressor to predict the closing prices of various cryptocurrencies, including Binance, Ethereum, and Litecoin. The RF model is a robust ensemble learning algorithm frequently utilized for regression and classification, recognized for its ability to handle non-linearrelationships and reduce overfitting. It operates by creating 100 decision trees during the training phase and consolidating their predictions to achieve a more accurate and reliable result. Key input features, such as \"Volume\" and \"Marketcap\", were used for model training, with the target variable being the \"Close\" price. Conversely, the GB regressor constructs trees sequentially, with each tree addressing the residual errors of the previous one. This iterative refinement process renders Gradient Boosting especially adept at detecting complex patterns and attaining high accuracy in numerous regression tasks. Both models were trained on 80% of the dataset, with predictions evaluated on the remaining 20% of the test set. To measure accuracy and reliability, we calculated metrics, including the Mean Squared Error, the Root Mean Squared Error, the Mean Absolute Error, and R-squared [41]. The following are the descriptions of each metric:  
Mean Squared Error (MSE)  
\[\text{MSE}=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}\]  
* \(n\): Total number of data points. * \(y_{i}\): Actual value of the \(i\)-th data point. * \(\hat{y}_{i}\): Predicted value of the \(i\)-th data point. * \((y_{i}-\hat{y}_{i})^{2}\): Squared difference between the actual and predicted values. The MSE measures the average of the squared differences between predicted and actual values, emphasizing larger errors. Root Mean Squared Error (RMSE)  
\[\text{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}\]  
* \(n\): Total number of data points. * \(y_{i}\): Actual value of the \(i\)-th data point. * \(\hat{y}_{i}\): Predicted value of the \(i\)-th data point. * \((y_{i}-\hat{y}_{i})^{2}\): Squared difference between the actual and predicted values. The RMSE is the square root of the MSE and provides an error measure in the same units as the target variable. Mean Absolute Error (MAE)  
\[\text{MAE}=\frac{1}{n}\sum_{i=1}^{n}|y_{i}-\hat{y}_{i}|\]  
* \(n\): Total number of data points. * \(y_{i}\): Actual value of the \(i\)-th data point. * \(\hat{y}_{i}\): Predicted value of the \(i\)-th data point. * \(|y_{i}-\hat{y}_{i}|\): Absolute difference between the actual and predicted values. MAE measures the average magnitude of errors without considering their direction. R-squared (\(R^{2}\))  
\[R^{2}=1-\frac{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}{\sum_{i=1}^{n}(y_{i}-\hat {y})^{2}}\]  
* \(n\): Total number of data points. * \(y_{i}\): Actual value of the \(i\)-th data point. * \(\hat{y}_{i}\): Predicted value of the \(i\)-th data point. \(g\): Mean of all actual values. * \(\sum_{i=1}^{n}(y_{i}-g_{i})^{2}\): Sum of squared residuals (errors). * \(\sum_{i=1}^{n}(y_{i}-g)^{2}\): Total sum of squares (variance in the actual data). R2 measures the proportion of the variance in the actual data that the model explains. It ranges from 0 to 1, with higher values indicating better model performance.