# The Impacts of Open Data and eXplainable AI on Real Estate Price Predictions in Smart Cities
## 3 Results
### Model Interpretability  
The final phase of our analytical approach involves SHAP values analysis to interpret the predictions of the Open Data Model, which, in our study, yields the most comprehensive and performant solution for real estate price prediction. This analysis delves into the importance of individual features and their impact on the model's decision-making process, giving profound insights into the factors driving real estate prices. The analysis employed SHAP's TreeExplainer to interpret the predictions of the XGB-Boost Open Data model by calculating SHAP values for the test set and gaining insights into feature importance and individual predictions on unseen data. These SHAP values are measures of feature importance that indicate how much each feature contributes, positively or negatively, to each individual prediction, thus quantifying the impact of each feature on the model's predictions. The TreeExplainer within the SHAP framework is specially optimized to analyze tree-based machine learning models efficiently and accurately. During SHAP values analysis, several visual outputs are commonly generated to understand the contributions and importance of features in a machine learning model ([[https://shap.readthedocs.io/](https://shap.readthedocs.io/)]([https://shap.readthedocs.io/](https://shap.readthedocs.io/)) (accessed on 11 January 2024)). Figure 4 shows two visually generated outputs for interpreting model predictions with SHAP values analysis. Figure 4: SHAP (SHapley Additive exPlanations) value analysis of feature impact on real estate price predictions: This figure is divided into two main parts: (**a**) on the left, the SHAP Summary plot (beeswarm) visualizes the impact of each feature on the model’s prediction for individual instances. Each point represents a SHAP value for a feature and an instance. High feature values are colored in red and low in blue. Features are ordered by the sum of SHAP value magnitudes across all samples. (**b**) on the right, the SHAP Global Summary plot shows the average impact of each feature on the model’s output. Features are ranked by their importance. The length of the bar represents the mean absolute SHAP value for each feature, indicating its importance. Positive SHAP values indicate a feature’s increasing impact on the model’s prediction, while negative values indicate a decreasing impact. Together, these plots provide insight into which features are most influential for the model’s predictions and how they affect real estate prices. The beeswarm plot in Figure 4a shows the distribution of the SHAP values for each feature across all the data points. The position on the x-axis indicates the impact of the feature on the model's output, where features pushing the prediction higher are displayed on the right, and those pushing the prediction lower are on the left. The color intensity represents the feature's value, with pink indicating higher values and blue indicating lower values. The distribution of points illustrates the variability of the impact of each feature. The global summary plot in Figure 4b shows each feature's mean absolute SHAP values across all the data, measuring its overall importance. A higher value indicates a more significant impact on the model's predictions. The bars are color-coded and include a numeric indication of the mean absolute SHAP value for each feature, and the sign (+/\(-\)) before the numbers indicates the direction of the impact. Unlike feature importances, typically described using abstract units derived from sophisticated concepts like impurities in tree algorithm nodes, mean absolute SHAP values are more straightforward and intuitive as they are presented in the same units as the target variable. In this case, they are quantified in Euros. Here, PGA is the most significant feature, impacting the predicted house price by an average of \(\pm\)EUR 73,775.16.