# Forecast of Medical Costs in Health Companies Using Models Based on Advanced Analytics
## 5 Discussion  
The purpose of this paper was to show techniques for predicting the costs of patients. The first model is an approach to simulate costs considering the decrease or increase in a particular population of a certain cohort. With the projected cost for each cohort, in case it  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **RMSE** & **MAPE** & **R\({}^{2}\)** & **Adj. R\({}^{2}\)** \\ \hline LSTM networks & 89,03 & 36,25\% & 0.89 & 0.835 \\ \hline \hline \end{tabular}
\end{table}
Table 10: LSTM network model results.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Cluster** & **Description** & **RMSE** & **MAPE** & **R\({}^{2}\)** & **Adj. R\({}^{2}\)** \\ \hline
0 & HighAge, COPD-AHT & 58,69 & 28,25\% & 0.881 & 0.821 \\
1 & YoungAdult, HEALTHY & 601,59 & 25,42\% & 0.925 & 0.888 \\
2 & Adult, AHT-OBESTY & 83,70 & 15,80\% & 0.940 & 0.910 \\
3 & SeniorAdult, AHT & 34,14 & 4,93\% & 0.996 & 0.993 \\
4 & Adult, OBESTY & 97,57 & 17,42\% & 0.940 & 0.910 \\
5 & SeniorAdult, AHT-DIABETES-OBESTY & 129,95 & 41,43\% & 0.818 & 0.727 \\
6 & Inactive & 274,06 & 2405,8\% & 0.031 & \(-\)0.453 \\
7 & SeniorAdult OBESITY-AHT & 31,27 & 12,16\% & 0.941 & 0.912 \\
8 & SeniorAdult, HEALTHY & 89,20 & 60,38\% & 0.753 & 0.629 \\
9 & SeniorAdult, CANCER-AHT & 29,17 & 9,67\% & 0.994 & 0.991 \\
10 & HighAge, CKD-AHT & 85,02 & 17,93\% & 0.878 & 0.818 \\
11 & Young, HEALTHY, LittleUse & 463,20 & 341,29\% & 0.206 & \(-\)0.191 \\
12 & Adult, CANCER & 51,94 & 17,28\% & 0.959 & 0.939 \\
13 & HighAge, COPD-AHT-OBESTY & 15,15 & 9,42\% & 0.971 & 0.957 \\
14 & Young, HEALTHY, RecentUse & 122,09 & 21,37\% & 0.956 & 0.934 \\ \hline \hline \end{tabular}
\end{table}
Table 11: LSTM network model results after segmenting patients.  
decreases or increases, we can have an estimate of the costs that the company could save so that it can implement strategies such as investing in promotion and prevention plans for cohorts.  
When we made the prediction with the initial values filtered by woman as gender and with diabetes using the LSTM networks, we observed that the RMSE metric shows that, on average, the mean prediction error corresponds to 89.03. In this case, MAPE indicates that, on average, the forecast is wrong by 36.25%. For R\({}^{2}\), 89% of the variations of the dependent variable are explained by the independent variables of our model. We see that the R\({}^{2}\) is high, indicating a high linear relationship between ProvisionDate and InvoicedValue. Finally, the adjusted R\({}^{2}\) value is 83% of the variability explained by the model, considering the number of independent variables, as shown in Table 10.  
With the other approach, when we do the clustering first using the k-means technique with its fifteen groups and then run the LSTM network for each of the clusters as shown in Table 11, we obtain better results. For RMSE, for clusters 0, 2, 3, 7, 8, 9, 10, 12, and 13, they have a better average mean prediction error for each one. MAPE has a lower forecast error for clusters 0, 2, 3, 4, 7, 9, 10, 12, 13, and 14. The R\({}^{2}\) for all clusters indicates a high relationship between the variables InvoicedValue and Date. Finally, the adjusted R\({}^{2}\) value for all clusters has a higher percentage of variability explained by the model. The values for clusters 1, 5, 11, and 14 have a high percentage of adjusted R\({}^{2}\), which can be interpreted as good. However, it shows an RSME as an average prediction error that is high enough to project. Clusters that did not perform as well, e.g., young, HEALTHY, and LittleUse are users with little history, and therefore it is more complex to predict their behavior.  
The main implication of our results is that combining the use of the clustering algorithms to identify patient groups with deep learning LSTM networks to predict future costs for these groups enables a more accurate prediction of the costs of patients for healthcare providers.