# The Impacts of Open Data and eXplainable AI on Real Estate Price Predictions in Smart Cities
## 2 Materials and Methods
### Methods
#### 2.2.3 Evaluation Metrics  
When dealing with regression tasks such as real estate price prediction, several metrics can be used to provide a comprehensive understanding of the model's performance. These metrics are essential for assessing the performance of machine learning algorithms, as they provide a quantitative measure of their accuracy, precision, and generalization capabilities. The choice of metric can rely on the specific characteristics of the data and the business objectives [84]. When evaluating the performance of our XGBoost models, we prioritized the Mean Absolute Error (MAE) as the primary evaluation metric. This decision aligned the objective function used during the training phase and the criteria for performance assessment. Since our models were optimized using MAE as the objective function via Optuna, it stands to reason that MAE should be the primary metric for assessing the model's performance. This approach ensures that our evaluation meets the most critical objectives and constraints during the model's optimization process. Furthermore, MAE provides a direct and interpretable measure of average prediction error, enhancing its practicality for clear and effective communication with stakeholders. This metric quantitatively expresses the average deviation of predictions from actual values without overly penalizing larger errors. This characteristic is especially crucial in our analysis, considering that the price distribution in our dataset is right-skewed. Such a skewness naturally results in outliers, which can disproportionately influence error metrics that square errors, like in Mean Squared Error (MSE) for example, where errors are squared before they are averaged, which leads to larger errors having a disproportionately more significant impact on the final metric value. By opting for MAE, we ensure a more balanced evaluation that reflects the typical prediction error, acknowledging the inherent variability within our dataset. That said, MAE determines the average size of the errors in a set of predictions, not considering their direction, and is commonly used in statistics and machine learning for assessing the accuracy of continuous variables. It represents the mean of the absolute differences between prediction and actual observation across the test sample, treating all individual differences with equal weight. MAE is calculated using the mathematical formula in Equation (2). \[\text{MAE}(y,\hat{y})=\frac{1}{n}{\sum_{i=1}^{n}}|y_{i}-\hat{y}_{i}| \tag{2}\]  
where  
* \(y_{i}\) represents the actual observed values in the dataset;
* \(\hat{y}_{i}\) denotes the predicted values generated by the model;
* \(n\) is the number of observations in the dataset;
* \(|y_{i}-\hat{y}_{i}|\) represents the absolute error for each individual prediction. While focusing exclusively on a single metric like MAE could potentially lead to a narrow view of the model's performance, incorporating a variety of metrics can offer a more holistic and nuanced evaluation. This is especially crucial as different metrics highlight different aspects of model accuracy and error behavior. To this end, in addition to MAE, we also assessed the model using three additional key metrics: MAPE (Mean Absolute Percentage Error), RMSE (Root Mean Squared Error), and the R\({}^{2}\) Score (Coefficient of Determination). MAPE provides insight into the relative size of errors as a percentage, lending a sense of the error magnitude concerning the actual values. RMSE assesses the impact of larger errors as it squares them before averaging, thereby emphasizing larger deviations. The R\({}^{2}\) Score measures the degree to which the independent variables in a regression model account for the fluctuations observed in the dependent variable, indicating the model's goodness of fit. This combined approach, utilizing MAE, MAPE, RMSE, and R\({}^{2}\), ensures a comprehensive and multifaceted evaluation of the regression model, encompassing both absolute and relative error measures and overall model fit.