# Explainable and Personalized Medical Cost Prediction Based on Multitask Learning over Mobile Devices

Authors: Lin Sun; Tingqi Wang; Bei Hui; Yun Li; Ling Tian
Journal: Mobile Information Systems
 (2022)

---

## Abstract

Currently, the forecasting of healthcare costs is of significant importance for the finance management of both government and individual citizens. However, the existence of dramatic individual diversity in health status, as well as the extensive complexity of the factors influencing the cost, has made the prediction a challenging task. Thanks to the unprecedented adoption of mobile devices, regular individuals may contribute diverse dimensions of data for the medical cost prediction. Hospitals and healthcare service providers are all setting up their own mobile services and collect user data for analysis. Previous methods usually employed traditional machine learning or simple neural network methods, which are difficult to be applied to the nonlinear medical cost and diverse dimensions of data. Therefore, this paper proposes a multitask learning-based framework for interpretable medical cost interval prediction to address these issues. The framework proposed in this paper first predicts subcost intervals by applying the multidimensional data collected from mobile ends and following the multitask learning paradigm. The total cost interval is then predicted based on this prediction. Simultaneously, the framework derives a decision tree from the parameters of the multitask learning network and calculates the importance of each feature in predicting the cost intervals. This paper demonstrates the method's effectiveness using real-world data experiments.


---

## Body

## 1. Introduction

The management of healthcare cost is one of the largest challenges in the field of health insurance and healthcare, which can easily lead to a shortage or waste of healthcare resources when poorly managed [1–4]. Owing to the extensive development of mobile devices, patients and regular citizens can freely contribute their own data for the prediction of the medical cost. Typical organizations like healthcare service providers and hospitals are setting up their own applications towards this trend. Patients and subscribers can use those mobile apps to contribute multiple types of data like demographic attributes, manually inputted daily healthcare records, and even sensing data from smart watches [5]. Therefore, it is of great significance to study the adoption of these data for medical cost prediction, which can bring personalized and understandable services for patients.Currently, DRG (Diagnosis Related Group)-based payment methods are being widely used to predict costs through characteristic groupings [6, 7], which has strongly motivated the research on reliable medical cost prediction. Various methods are proposed to accurately predict cost ranges and identify key factors for grouping, allowing for efficient resource deployment and timely identification of potential risks. These methods are assumed to bring significant implications for reducing pressure on healthcare resources and improving resource utilization [8, 9] while concealing no significant personal information of patients [10–12]. However, because of the various treatment options chosen by individual patients, the amount and composition of medical cost are highly personalized and divergent [13]. Moreover, due to the different conditions of different patients and the influence of factors such as healing time and degree of recovery, it is difficult to fit medical costs with simple linear models. Therefore, the prediction of medical cost requests both the application of various dimensions of data available from mobile ends and feedbacks to users with a deep understanding on the impact of individual and personalized characteristics on healthcare costs [14, 15].Considering these challenges, traditional methods rely heavily on machine learning models like linear regression [16] and regression trees [17, 18], as well as simple neural network models. However, the overall representation is inadequate owing to the sophisticated correlations among factors. In recent research, deep learning methods [19] outperformed traditional computational methods in various prediction tasks due to their ability to adapt the composition of individual feature factors for better representation [20]. Given the complexity of the components and data dimensions in medical cost prediction [21], deep learning methods can make more accurate and reasonable predictions of overall costs by depicting the correlation between the various costs in addition to predicting individual costs.Based on the above, this paper proposes a multi-task learning-based interpretable medical cost interval prediction framework. The model takes multiple sources of information about the patient into account, including (1) the patient’s natural characteristics and (2) the stage of the patient’s condition. (3) The patient’s lesion attributes, and outputs the prediction results for each type of cost interval.The framework is made up of two parts: (1) A multitask-learning framework for interval prediction over data collected from mobile ends. The cost intervals are predicted by the prediction framework in two steps. To begin, a logistic regression approach is combined as a preprocessing of the input neural network data, which is then fed into the neural network to calculate predictions for the various subcost intervals. The total costs are then predicted based on the prediction of the subcost intervals. Among these, the logistic regression method is used to improve the network’s convergence and training speeds. (2) An explainable and personalized decision tree based on the analysis of factor importance in a multilearning task. The Gini coefficient is reconstructed using the multitask learning framework weights obtained from training to build a decision tree, and the importance of each feature is calculated using the decision tree.The proposed framework owns two advantages for medical cost prediction. On the one hand, the framework predicts total costs by coupling subcosts, allowing all subcost prediction intervals to be in obtained while also capturing the links between subcosts and global payments; on the other hand, the framework can analyze the importance of different factors in the prediction of cost intervals based on the prediction process. Corresponding observations can serve as a foundation for physician triage.To the best of our knowledge, this is the first time that a multiclassification approach to cost interval forecasting has been used. The remainder of this paper is organized as follows: Section2 presents work related to cost interval prediction. Section 3 presents the cost interval prediction model for multitask learning. Section 4 presents the experimental results. Section 5 analyses the factor impact. Section 6 presents the conclusions.


## 2. Related Work

The study of cost prediction tasks is becoming more widespread, and one of the widely used methods for health care cost prediction is the regression-based model [22, 23]. To avoid the requirement of general linear models for data to follow a normal distribution, Moran et al. performed prediction using generalized linear models [16]. Panay et al. used the evidence regression method, which is based on the idea that other elements in a set that are correlated for a specific element are placed in a set of similar patients, and the overall predicted expectation is calculated for optimization [24]. Tkachenko R et al. used SGTM-like neural structures for segmented linear prediction [25]. Takeshima et al. defined experimental valuables on which regression models with minimum absolute shrinkage and selection operators (lasso) were built. Explanatory valuables were selected by LASSO avoiding overfitting using the validation data [26]. Based on regression methods, various machine learning methods have been introduced [27, 28]. Taloba et al. in [17] compare the performance of linear regression type Lasso, gradient augmentation of regression decision trees, M5 regression decision trees, random forests, linear regression, and CART regression trees in this task and analyze the advantages and disadvantages of each method.Due to properties such as end-to-end training and good fitting ability to nonlinear data, neural network methods, in addition to machine learning methods, have been introduced into the prediction of medical costs. Morid et al. compared various methods and found that ANN (Artificial Neural Network) performed the best [20]. In [29], Zeng et al. used multilayer neural networks to construct unsupervised learning models to learn patient representation from medical data. The collection of medical data from mobile devices are also extensively studied. Issues like efficiency [5, 30] and data utilities are thoroughly considered. These studies are complementary to our work.Generally, for cost prediction, current work is primarily based on patients’ natural attributes and health data, but there are fewer methods for predicting the costs of specific conditions during treatment. At the same time, current methods are based on simple statistical learning and neural networks, and they are incapable of fully exploiting the value of data contributed by patients from mobile ends.


## 3. Framework: A Multitask Learning Based Framework for Interpretable Medical Cost Interval Prediction

### 3.1. Problem Definition

For a patient setU=U1,U2,...,Ui,...,UN containing N patients, where each patient Ui has a feature set Xi and an element xi∈R for each feature dimension. For example, the feature set may include natural features such as “age,” daily collected data like heartbeat records and related events inputted by patients. These features are collected and submitted through mobile devices. Corresponding features also involve the disease stage such as “TMN-stage,” and focal features such as “type of comorbidity,” which are both terminologies used for clinic diagnosis of breast cancer. We define a cost interval set Y=Y1,Y2,...,Yi,...,YN, where Yi=Yi,sub∪Yi,total,Yi,sub=yi,1,yi,2,...,yi,k,Yi,total=yi,total.In this paper, we takek = 3 as an example, yi,1,yi,2,yi,3 correspond to the intervals of treatment cost, examination cost, and drug cost, respectively, and yi,total is the total cost interval.yi,1∈1,2,...,k1, yi,2∈1,2,...,k2, yi,3∈1,2,...,k3, yi,total∈1,2,...,ktotal.For a given set of patient featuresX, after inputting it into the model, the set Y=Ysub∪Ytotal of its corresponding cost intervals is output.


### 3.2. A Framework for Predicting Medical Cost Intervals Based on Multitask Learning

The framework proposed in this paper consists of three components: data preprocessing; a hard sharing network for subcost interval prediction; and a total task prediction network based on sub-cost intervals. The results obtained from predicting subcost intervals and the raw data outputted by hard sharing are used as inputs for the total cost prediction. An illustration of the framework is shown in Figure1.Figure 1
The cost forecasting framework.


#### 3.2.1. Data Preprocessing: Logistic Regression

The training of neural networks for such data suffers from slow convergence and long training times due to the weak linear nature of the association between medical data and medical cost intervals. Traditional machine learning methods like logistic regression may extract shallow nonlinear association among data, which can benefit the overall training performance of the framework. As a result, in this paper,θ∧logistic is calculated using logistic regression before being fitted with a neural network. When the user Ui set of features Xi is entered, the auxiliary information hθ∧logisticXi can be obtained.(1)hθ∧logisticXi=softmaxXi;θ∧logistic=pyi,total=1|Xi;θ∧logisticpyi,total=2|Xi;θ∧logistic.pyi,total=ktotal|Xi;θ∧logistic=1∑j=1keθ∧jTXieθ∧1TXieθ∧2TXi.eθ∧ktotalTXi,where θ∧1,θ∧2,...,θ∧ktotal∈R is the model parameter and the parameter is obtained by optimising the loss function by an iterative method, the loss function is a great likelihood function, θ∧logistic=argminθlogisticLosslogistichθlogisticX,Y.hθ∧logisticXi concatenated with the original data, to obtainINPUTXi:(2)INPUTXi=concatXi,hθ∧logisticXi.INPUTXi as input to the multitask learning hard sharing layer can speed up the convergence and training of the neural network.


#### 3.2.2. Hard Sharing Network for Subcost Interval Forecasting

The hard sharing layer consists of the mini-module and Resnet.Each mini-model consists of a full connection layer, a BatchNormalization layer, and an activation layer (ReLu is used as an example in this paper) which, after the hard sharing layer, gives a hidden layer representation of the datamil:(3)FCil=FCmil−1,BNil=BNFCil,mil=σBNil,where l is the number of layers in the network of the mini-module.In order not to degrade the performance of the network due to degradation caused by nonconstant mapping, a residual network is used in this paper. A residual connection [19] is made for every two mini-modules to obtain the hidden layer hXi:(4)ResnetiL=Resnetmi2L,mi2L+1,hXi=ResnetiL.PuthXi into different full connection layers to obtain predictions for each subcost interval:(5)y∧i,1=FC1hXi,y∧i,2=FC2hXi,y∧i,3=FC3hXi.Based on this,Y∧i,sub=y∧i,1,y∧i,2,y∧i,3 of Xi is obtained. Where the loss function Losssub for the subcost prediction network is defined as follows:(6)Losssub=∑j=13αjLossY∧i,j,Yi,j.


#### 3.2.3. Total Cost Interval Forecasting Network Based on Subcost Intervals

A fully connected layer and an activation layer comprise the total cost interval prediction network. The predicted values of the three subcost intervals, along with the output of the hard sharing layer, are fed into the total cost prediction layer, which produces a prediction of the total cost interval as follows:(7)X∧i,total=concathXi,y∧1,y∧2,y∧3,y∧i,total=σFCX∧i,total,From this, the predicted valueY∧i=y∧i,total is obtained for four cost intervals of XiThe loss functionLosstotal for the overall cost is defined as follows:(8)Losstotal=LossY∧,Y.It distinguish the differences betweenLosssub and Losstotal:(9)Loss=β1Losssub+β2Losstotal,where β1 and β2 are hyper parameters. In this paper, (8) is selected as the loss function.


## 3.1. Problem Definition

For a patient setU=U1,U2,...,Ui,...,UN containing N patients, where each patient Ui has a feature set Xi and an element xi∈R for each feature dimension. For example, the feature set may include natural features such as “age,” daily collected data like heartbeat records and related events inputted by patients. These features are collected and submitted through mobile devices. Corresponding features also involve the disease stage such as “TMN-stage,” and focal features such as “type of comorbidity,” which are both terminologies used for clinic diagnosis of breast cancer. We define a cost interval set Y=Y1,Y2,...,Yi,...,YN, where Yi=Yi,sub∪Yi,total,Yi,sub=yi,1,yi,2,...,yi,k,Yi,total=yi,total.In this paper, we takek = 3 as an example, yi,1,yi,2,yi,3 correspond to the intervals of treatment cost, examination cost, and drug cost, respectively, and yi,total is the total cost interval.yi,1∈1,2,...,k1, yi,2∈1,2,...,k2, yi,3∈1,2,...,k3, yi,total∈1,2,...,ktotal.For a given set of patient featuresX, after inputting it into the model, the set Y=Ysub∪Ytotal of its corresponding cost intervals is output.


## 3.2. A Framework for Predicting Medical Cost Intervals Based on Multitask Learning

The framework proposed in this paper consists of three components: data preprocessing; a hard sharing network for subcost interval prediction; and a total task prediction network based on sub-cost intervals. The results obtained from predicting subcost intervals and the raw data outputted by hard sharing are used as inputs for the total cost prediction. An illustration of the framework is shown in Figure1.Figure 1
The cost forecasting framework.


### 3.2.1. Data Preprocessing: Logistic Regression

The training of neural networks for such data suffers from slow convergence and long training times due to the weak linear nature of the association between medical data and medical cost intervals. Traditional machine learning methods like logistic regression may extract shallow nonlinear association among data, which can benefit the overall training performance of the framework. As a result, in this paper,θ∧logistic is calculated using logistic regression before being fitted with a neural network. When the user Ui set of features Xi is entered, the auxiliary information hθ∧logisticXi can be obtained.(1)hθ∧logisticXi=softmaxXi;θ∧logistic=pyi,total=1|Xi;θ∧logisticpyi,total=2|Xi;θ∧logistic.pyi,total=ktotal|Xi;θ∧logistic=1∑j=1keθ∧jTXieθ∧1TXieθ∧2TXi.eθ∧ktotalTXi,where θ∧1,θ∧2,...,θ∧ktotal∈R is the model parameter and the parameter is obtained by optimising the loss function by an iterative method, the loss function is a great likelihood function, θ∧logistic=argminθlogisticLosslogistichθlogisticX,Y.hθ∧logisticXi concatenated with the original data, to obtainINPUTXi:(2)INPUTXi=concatXi,hθ∧logisticXi.INPUTXi as input to the multitask learning hard sharing layer can speed up the convergence and training of the neural network.


### 3.2.2. Hard Sharing Network for Subcost Interval Forecasting

The hard sharing layer consists of the mini-module and Resnet.Each mini-model consists of a full connection layer, a BatchNormalization layer, and an activation layer (ReLu is used as an example in this paper) which, after the hard sharing layer, gives a hidden layer representation of the datamil:(3)FCil=FCmil−1,BNil=BNFCil,mil=σBNil,where l is the number of layers in the network of the mini-module.In order not to degrade the performance of the network due to degradation caused by nonconstant mapping, a residual network is used in this paper. A residual connection [19] is made for every two mini-modules to obtain the hidden layer hXi:(4)ResnetiL=Resnetmi2L,mi2L+1,hXi=ResnetiL.PuthXi into different full connection layers to obtain predictions for each subcost interval:(5)y∧i,1=FC1hXi,y∧i,2=FC2hXi,y∧i,3=FC3hXi.Based on this,Y∧i,sub=y∧i,1,y∧i,2,y∧i,3 of Xi is obtained. Where the loss function Losssub for the subcost prediction network is defined as follows:(6)Losssub=∑j=13αjLossY∧i,j,Yi,j.


### 3.2.3. Total Cost Interval Forecasting Network Based on Subcost Intervals

A fully connected layer and an activation layer comprise the total cost interval prediction network. The predicted values of the three subcost intervals, along with the output of the hard sharing layer, are fed into the total cost prediction layer, which produces a prediction of the total cost interval as follows:(7)X∧i,total=concathXi,y∧1,y∧2,y∧3,y∧i,total=σFCX∧i,total,From this, the predicted valueY∧i=y∧i,total is obtained for four cost intervals of XiThe loss functionLosstotal for the overall cost is defined as follows:(8)Losstotal=LossY∧,Y.It distinguish the differences betweenLosssub and Losstotal:(9)Loss=β1Losssub+β2Losstotal,where β1 and β2 are hyper parameters. In this paper, (8) is selected as the loss function.


## 3.2.1. Data Preprocessing: Logistic Regression

The training of neural networks for such data suffers from slow convergence and long training times due to the weak linear nature of the association between medical data and medical cost intervals. Traditional machine learning methods like logistic regression may extract shallow nonlinear association among data, which can benefit the overall training performance of the framework. As a result, in this paper,θ∧logistic is calculated using logistic regression before being fitted with a neural network. When the user Ui set of features Xi is entered, the auxiliary information hθ∧logisticXi can be obtained.(1)hθ∧logisticXi=softmaxXi;θ∧logistic=pyi,total=1|Xi;θ∧logisticpyi,total=2|Xi;θ∧logistic.pyi,total=ktotal|Xi;θ∧logistic=1∑j=1keθ∧jTXieθ∧1TXieθ∧2TXi.eθ∧ktotalTXi,where θ∧1,θ∧2,...,θ∧ktotal∈R is the model parameter and the parameter is obtained by optimising the loss function by an iterative method, the loss function is a great likelihood function, θ∧logistic=argminθlogisticLosslogistichθlogisticX,Y.hθ∧logisticXi concatenated with the original data, to obtainINPUTXi:(2)INPUTXi=concatXi,hθ∧logisticXi.INPUTXi as input to the multitask learning hard sharing layer can speed up the convergence and training of the neural network.


## 3.2.2. Hard Sharing Network for Subcost Interval Forecasting

The hard sharing layer consists of the mini-module and Resnet.Each mini-model consists of a full connection layer, a BatchNormalization layer, and an activation layer (ReLu is used as an example in this paper) which, after the hard sharing layer, gives a hidden layer representation of the datamil:(3)FCil=FCmil−1,BNil=BNFCil,mil=σBNil,where l is the number of layers in the network of the mini-module.In order not to degrade the performance of the network due to degradation caused by nonconstant mapping, a residual network is used in this paper. A residual connection [19] is made for every two mini-modules to obtain the hidden layer hXi:(4)ResnetiL=Resnetmi2L,mi2L+1,hXi=ResnetiL.PuthXi into different full connection layers to obtain predictions for each subcost interval:(5)y∧i,1=FC1hXi,y∧i,2=FC2hXi,y∧i,3=FC3hXi.Based on this,Y∧i,sub=y∧i,1,y∧i,2,y∧i,3 of Xi is obtained. Where the loss function Losssub for the subcost prediction network is defined as follows:(6)Losssub=∑j=13αjLossY∧i,j,Yi,j.


## 3.2.3. Total Cost Interval Forecasting Network Based on Subcost Intervals

A fully connected layer and an activation layer comprise the total cost interval prediction network. The predicted values of the three subcost intervals, along with the output of the hard sharing layer, are fed into the total cost prediction layer, which produces a prediction of the total cost interval as follows:(7)X∧i,total=concathXi,y∧1,y∧2,y∧3,y∧i,total=σFCX∧i,total,From this, the predicted valueY∧i=y∧i,total is obtained for four cost intervals of XiThe loss functionLosstotal for the overall cost is defined as follows:(8)Losstotal=LossY∧,Y.It distinguish the differences betweenLosssub and Losstotal:(9)Loss=β1Losssub+β2Losstotal,where β1 and β2 are hyper parameters. In this paper, (8) is selected as the loss function.


## 4. Feature Importance Analysis

Simply predicting the cost interval may confuse the doctors even if a highly accurate performance is guaranteed. Therefore, a feature-importance-based framework in explaining the prediction of cost interval is further proposed in this part. The whole framework is based on an improved version of decision tree, where multiple factors considered in the prediction model are involved. An illustration is shown in Figure2.Figure 2
Decision tree analysis method based on neural network weights.A decision tree approach is used in this paper to analyze the importance of factors obtained through the multitask neural network in section 3. In contrast to previous decision tree methods simply estimating information gain for a single task, an method tailored to couple with multitasks is designed for the information gain estimation.Based on the weight parameters of the whole prediction network obtained from training, the weight parameters corresponding to each sub-cost interval is first calculated as a percentage of the total cost prediction layer, which is used as the weight for the Gini coefficient calculation of the decision tree nodes. The original Gini coefficient calculation formula:(10)gini=∑k=1kpk1−pk.For a given matrix of patient featuresx1,0,x1,1,x2,0,x2,1,x2,2, the input total cost prediction layer is subject to the following calculation: x1,0,x1,1,x2,0,x2,1,x2,2×w1,0,w1,1,w2,0,w2,1,w2,2T, where the feature elements with the same first numerical ordinal number of the subscript, e.g., x1,0,x1,1 refer to common features. Then, for the same feature element Xi, having a matrix of weights Wi, the weight of each feature element in the calculation of the Gini coefficient is calculated as follows:(11)αk=Wkl2∑i=1NWil2,Then, the weighted Gini coefficient calculation formula:(12)gini=α1∑K1=1K1pk11−pk1+α2∑k2=1K2pk21−pk2+…+αn∑kn=1Knpkn1−pkn.We build a decision tree using the CART classification tree method [20]. The main idea of the method is to iteratively split the patient set where each subset share identical value on some features. Specifically, when a feature F takes the value f in a sample U with N users, the sample U is divided into two parts U1 and U2, where U1 is the set of samples with F≠f and U2 is the set of samples with F≠f. The method calculates the Gini coefficient of each feature at each value, choose the case with the smallest Gini coefficient, and use it to generate this node, with U1 and U2 as patient sets in two child nodes. When a node’s number of samples U falls below a predefined threshold, or when the number of features is zero, the current node’s decision making process is terminated.The method described above is used to create a decision tree. The essence is to create a binary tree by selecting the features that will give the greatest Gini gain as nodes at each layer. The importance of each feature in nodes is calculated using the following formula based on the generated decision tree:(13)NtN×gini−NtRNt×giniR−NtLNt×giniL,where N is the total number of samples, Nt is the number of samples at this node, Nr is the number of samples at the right child node, and NtL is the number of samples at the left child node.


## 5. Experiments

### 5.1. Dataset

The experiments in this paper are based on a real breast cancer medical cost dataset. We give links to the data demos at the end of this article. Patient features include age, T stage, M stage, N stage, histological classification, complication and comorbidity, and HER2 attributes. The representation for the feature is shown in Table1.Table 1
Patient feature categories classification.
FeaturesFeature categoriesValuesAge25 -025–40140–50250–60360+4T-stageT00Tis1Tx2T13T24T35T46Histologic classificationInvasive carcinoma0Invasive ductal carcinoma1Papillary carcinoma2Infiltrating lobular carcinoma3Medullary carcinoma4N-stageN00N11N22N33Nx4M-stageM00M11Mx2Complication and comorbidityserious0General1—2HER2001+12+23+3In this paper, treatment costs, examination costs, and drug costs are selected as the three subcosts to be predicted and the total costs are predicted by using these three subcosts as auxiliary information. For the different costs, the paper divides the cost intervals as shown in Table2.Table 2
Cost interval.
Treatment costs1000−1000–20002000+—Examination costs5000−5000–1000010000+—Drug costs500−500–15001500–20002000+Total costs10000−10000–2000020000–2500025000+The experiments in this paper use one-hot coding for the representation of the data.


### 5.2. Parameter Settings

The logistic regression model in this paper employs Newton’s method as the optimization method for the loss function, and the regularization method employs thel2 norm with a regularization strength of 0.5; the neural network employs ASGD as the optimization method, with a starting learning rate of 0.1 and decreasing to 50% of the original every 100 epochs; and the linear layer has a dimension of 128.The decision tree for analyzing the importance of the influencing factors in this paper uses a CART decision tree with a maximum number of layers of 7. The Gini coefficient is used to calculate the information gain, but unlike the traditional Gini coefficient, the Gini coefficient is improved in this paper, and the specific method is described in Section4.


### 5.3. Experimental Results

#### 5.3.1. Cost Interval Forecast Results

First, to verify the effectiveness of the methods, SVM, decision tree, plain Bayesian, logistic regression, and k-means methods were tested on the same dataset in this paper. The results are shown in Table3. Compared with traditional machine learning methods, the multi-task learning method has significantly improved the prediction accuracy for the four types of cost intervals, which raises the accuracy by 5% on treatment cost, 9% on examination cost, 10% on drug cost, and 10% on the total cost.Table 3
Accuracy comparison with classical methods.
MethodAccuracyTreatment costsExamination costsDrug costsTotal costsSVM0.540.480.530.43DecisionTreeClassifier0.610.540.540.45Naive_Bayes0.590.580.610.61Logistic regression0.650.640.620.51k-means0.480.430.370.42Multi-task0.70.730.720.71It can also be seen that the prediction accuracy of our method is also significantly improved compared to that of the logistic regression-only method. The multitask learning model can effectively reduce the reliance on the linear nature of the data using the logistic regression-only method. According to Figure3, the model convergence speed is improved after the inclusion of the logistic regression approach.Figure 3
Comparison of loss before and after using the logistic regression method.To verify the effectiveness of the framework in this paper, we test the prediction results when the network layer in the framework is replaced by traditional machine learning methods. Moreover, the accuracy of the prediction of subcosts is tested under different total cost prediction results. According to the results in Table4, when the total cost prediction is correct, the method fails in all cases for the sub-cost intervals only 21% of the time, which is much lower than traditional machine learning methods. Correspondingly, according to the results in Table 4, when the total cost prediction is incorrect, the sub-cost interval prediction fails in all cases by 24% compared to the correct case, which is the largest improvement compared to the other cases and remains lower than the traditional method. Thus, it can be demonstrated that the neural network method used in this paper, which can better capture the non-linear relationship between subcosts and total costs, outperforms traditional machine learning methods.Table 4
Percentage of cost forecast (1) Table of other cost projections when total cost projections are correct. (2) Table of other cost projections when total cost projections are incorrect.
MethodsAccuracyNumber of correct projections for other costs ≥ 1Number of correct projections for other costs = 0SVM0.540.45DecisionTreeClassifier0.620.38Naive_Bayes0.510.49Logistic0.640.36k-means0.530.47Multi-task0.790.21AccuracyMethodsNumber of correct projections for other costs ≥ 1Number of correct projections for other costs = 0SVM0.470.53DecisionTreeClassifier0.510.49Naive_Bayes0.480.52Logistic0.410.59k-means0.490.51Multi-task0.550.45Finally, to verify the robustness of the framework, the operation of the network is tested at different learning rates in this paper, and the results are shown in Figure4. The convergence rate is fast at higher learning rates, but the accuracy as well as the loss gradually converge to the same level at the end. This proves that the network is stable.Figure 4
Accuracy and loss of training at different learning rates. (a) Accuracy. (b) Loss.
(a)(b)


#### 5.3.2. Experimental Results on the Feature Importance

Decision trees based on the trained network are shown in Figure5. Compared with the decision trees built by the traditional method, the prediction accuracy of the our decision tree for the total cost is 0.71, which is much greater than the 0.45 of the traditional decision tree method. The decision tree generated by this method has more Gini nodes with 0 and a clearer judgement process.Figure 5
Illustration of the decision tree constructed by our framework.Based on the generated decision tree, the importance of the features is calculated and the results are shown in Table5 and Figure 6. Among them, N-stage and T-stage are significantly more important than the last five features, and M-stage is significantly less important than the first six features.Table 5
Importance of each feature.
FeatureImportance (descending order)N-stage0.1934T-stage0.1747Age0.1344Complication and comorbidity0.1276HER20.1033Histologic classification0.0997M-stage0.0701Figure 6
Importance of features.


## 5.1. Dataset

The experiments in this paper are based on a real breast cancer medical cost dataset. We give links to the data demos at the end of this article. Patient features include age, T stage, M stage, N stage, histological classification, complication and comorbidity, and HER2 attributes. The representation for the feature is shown in Table1.Table 1
Patient feature categories classification.
FeaturesFeature categoriesValuesAge25 -025–40140–50250–60360+4T-stageT00Tis1Tx2T13T24T35T46Histologic classificationInvasive carcinoma0Invasive ductal carcinoma1Papillary carcinoma2Infiltrating lobular carcinoma3Medullary carcinoma4N-stageN00N11N22N33Nx4M-stageM00M11Mx2Complication and comorbidityserious0General1—2HER2001+12+23+3In this paper, treatment costs, examination costs, and drug costs are selected as the three subcosts to be predicted and the total costs are predicted by using these three subcosts as auxiliary information. For the different costs, the paper divides the cost intervals as shown in Table2.Table 2
Cost interval.
Treatment costs1000−1000–20002000+—Examination costs5000−5000–1000010000+—Drug costs500−500–15001500–20002000+Total costs10000−10000–2000020000–2500025000+The experiments in this paper use one-hot coding for the representation of the data.


## 5.2. Parameter Settings

The logistic regression model in this paper employs Newton’s method as the optimization method for the loss function, and the regularization method employs thel2 norm with a regularization strength of 0.5; the neural network employs ASGD as the optimization method, with a starting learning rate of 0.1 and decreasing to 50% of the original every 100 epochs; and the linear layer has a dimension of 128.The decision tree for analyzing the importance of the influencing factors in this paper uses a CART decision tree with a maximum number of layers of 7. The Gini coefficient is used to calculate the information gain, but unlike the traditional Gini coefficient, the Gini coefficient is improved in this paper, and the specific method is described in Section4.


## 5.3. Experimental Results

### 5.3.1. Cost Interval Forecast Results

First, to verify the effectiveness of the methods, SVM, decision tree, plain Bayesian, logistic regression, and k-means methods were tested on the same dataset in this paper. The results are shown in Table3. Compared with traditional machine learning methods, the multi-task learning method has significantly improved the prediction accuracy for the four types of cost intervals, which raises the accuracy by 5% on treatment cost, 9% on examination cost, 10% on drug cost, and 10% on the total cost.Table 3
Accuracy comparison with classical methods.
MethodAccuracyTreatment costsExamination costsDrug costsTotal costsSVM0.540.480.530.43DecisionTreeClassifier0.610.540.540.45Naive_Bayes0.590.580.610.61Logistic regression0.650.640.620.51k-means0.480.430.370.42Multi-task0.70.730.720.71It can also be seen that the prediction accuracy of our method is also significantly improved compared to that of the logistic regression-only method. The multitask learning model can effectively reduce the reliance on the linear nature of the data using the logistic regression-only method. According to Figure3, the model convergence speed is improved after the inclusion of the logistic regression approach.Figure 3
Comparison of loss before and after using the logistic regression method.To verify the effectiveness of the framework in this paper, we test the prediction results when the network layer in the framework is replaced by traditional machine learning methods. Moreover, the accuracy of the prediction of subcosts is tested under different total cost prediction results. According to the results in Table4, when the total cost prediction is correct, the method fails in all cases for the sub-cost intervals only 21% of the time, which is much lower than traditional machine learning methods. Correspondingly, according to the results in Table 4, when the total cost prediction is incorrect, the sub-cost interval prediction fails in all cases by 24% compared to the correct case, which is the largest improvement compared to the other cases and remains lower than the traditional method. Thus, it can be demonstrated that the neural network method used in this paper, which can better capture the non-linear relationship between subcosts and total costs, outperforms traditional machine learning methods.Table 4
Percentage of cost forecast (1) Table of other cost projections when total cost projections are correct. (2) Table of other cost projections when total cost projections are incorrect.
MethodsAccuracyNumber of correct projections for other costs ≥ 1Number of correct projections for other costs = 0SVM0.540.45DecisionTreeClassifier0.620.38Naive_Bayes0.510.49Logistic0.640.36k-means0.530.47Multi-task0.790.21AccuracyMethodsNumber of correct projections for other costs ≥ 1Number of correct projections for other costs = 0SVM0.470.53DecisionTreeClassifier0.510.49Naive_Bayes0.480.52Logistic0.410.59k-means0.490.51Multi-task0.550.45Finally, to verify the robustness of the framework, the operation of the network is tested at different learning rates in this paper, and the results are shown in Figure4. The convergence rate is fast at higher learning rates, but the accuracy as well as the loss gradually converge to the same level at the end. This proves that the network is stable.Figure 4
Accuracy and loss of training at different learning rates. (a) Accuracy. (b) Loss.
(a)(b)


### 5.3.2. Experimental Results on the Feature Importance

Decision trees based on the trained network are shown in Figure5. Compared with the decision trees built by the traditional method, the prediction accuracy of the our decision tree for the total cost is 0.71, which is much greater than the 0.45 of the traditional decision tree method. The decision tree generated by this method has more Gini nodes with 0 and a clearer judgement process.Figure 5
Illustration of the decision tree constructed by our framework.Based on the generated decision tree, the importance of the features is calculated and the results are shown in Table5 and Figure 6. Among them, N-stage and T-stage are significantly more important than the last five features, and M-stage is significantly less important than the first six features.Table 5
Importance of each feature.
FeatureImportance (descending order)N-stage0.1934T-stage0.1747Age0.1344Complication and comorbidity0.1276HER20.1033Histologic classification0.0997M-stage0.0701Figure 6
Importance of features.


## 5.3.1. Cost Interval Forecast Results

First, to verify the effectiveness of the methods, SVM, decision tree, plain Bayesian, logistic regression, and k-means methods were tested on the same dataset in this paper. The results are shown in Table3. Compared with traditional machine learning methods, the multi-task learning method has significantly improved the prediction accuracy for the four types of cost intervals, which raises the accuracy by 5% on treatment cost, 9% on examination cost, 10% on drug cost, and 10% on the total cost.Table 3
Accuracy comparison with classical methods.
MethodAccuracyTreatment costsExamination costsDrug costsTotal costsSVM0.540.480.530.43DecisionTreeClassifier0.610.540.540.45Naive_Bayes0.590.580.610.61Logistic regression0.650.640.620.51k-means0.480.430.370.42Multi-task0.70.730.720.71It can also be seen that the prediction accuracy of our method is also significantly improved compared to that of the logistic regression-only method. The multitask learning model can effectively reduce the reliance on the linear nature of the data using the logistic regression-only method. According to Figure3, the model convergence speed is improved after the inclusion of the logistic regression approach.Figure 3
Comparison of loss before and after using the logistic regression method.To verify the effectiveness of the framework in this paper, we test the prediction results when the network layer in the framework is replaced by traditional machine learning methods. Moreover, the accuracy of the prediction of subcosts is tested under different total cost prediction results. According to the results in Table4, when the total cost prediction is correct, the method fails in all cases for the sub-cost intervals only 21% of the time, which is much lower than traditional machine learning methods. Correspondingly, according to the results in Table 4, when the total cost prediction is incorrect, the sub-cost interval prediction fails in all cases by 24% compared to the correct case, which is the largest improvement compared to the other cases and remains lower than the traditional method. Thus, it can be demonstrated that the neural network method used in this paper, which can better capture the non-linear relationship between subcosts and total costs, outperforms traditional machine learning methods.Table 4
Percentage of cost forecast (1) Table of other cost projections when total cost projections are correct. (2) Table of other cost projections when total cost projections are incorrect.
MethodsAccuracyNumber of correct projections for other costs ≥ 1Number of correct projections for other costs = 0SVM0.540.45DecisionTreeClassifier0.620.38Naive_Bayes0.510.49Logistic0.640.36k-means0.530.47Multi-task0.790.21AccuracyMethodsNumber of correct projections for other costs ≥ 1Number of correct projections for other costs = 0SVM0.470.53DecisionTreeClassifier0.510.49Naive_Bayes0.480.52Logistic0.410.59k-means0.490.51Multi-task0.550.45Finally, to verify the robustness of the framework, the operation of the network is tested at different learning rates in this paper, and the results are shown in Figure4. The convergence rate is fast at higher learning rates, but the accuracy as well as the loss gradually converge to the same level at the end. This proves that the network is stable.Figure 4
Accuracy and loss of training at different learning rates. (a) Accuracy. (b) Loss.
(a)(b)


## 5.3.2. Experimental Results on the Feature Importance

Decision trees based on the trained network are shown in Figure5. Compared with the decision trees built by the traditional method, the prediction accuracy of the our decision tree for the total cost is 0.71, which is much greater than the 0.45 of the traditional decision tree method. The decision tree generated by this method has more Gini nodes with 0 and a clearer judgement process.Figure 5
Illustration of the decision tree constructed by our framework.Based on the generated decision tree, the importance of the features is calculated and the results are shown in Table5 and Figure 6. Among them, N-stage and T-stage are significantly more important than the last five features, and M-stage is significantly less important than the first six features.Table 5
Importance of each feature.
FeatureImportance (descending order)N-stage0.1934T-stage0.1747Age0.1344Complication and comorbidity0.1276HER20.1033Histologic classification0.0997M-stage0.0701Figure 6
Importance of features.


## 6. Conclusion

This paper presents an interpretable and personalized medical cost interval prediction framework based on multitask learning over data on mobile ends. It can predict total cost intervals based on the subcost intervals of the medical process, and the importance of each feature for cost interval prediction can be obtained using a decision tree approach based on the trained neural network’s weight parameters. To begin, this paper uses a multitask learning approach to obtain the subcost intervals in the medical process and mine their correlation to exploit the value of the data; second, the subcosts pass through the full connection layer to predict the total cost intervals; finally, in order to determine the importance of patient characteristics in predicting cost intervals, the decision tree’s Gini coefficient calculation method is reconstructed by using full connection layer weights of subcosts to predict total costs. Furthermore, to improve the speed of model training and convergence, the data is preprocessed using logistic regression methods, and ResNet structure is used to keep the network identity Mapping.



---

*Source: 8966266-2022-10-09.xml*