Abstract
The main reason that hinders early treatment of ACS patients is delayed patient decision-making (PD). In order to explore the delay factors of patients with ACS, this paper builds a machine learning-based analysis model of delay factors for patients with acute coronary syndrome based on machine learning. Moreover, this paper combines structural equations to analyze the factors affecting accidents, and uses the generalized ordered logit model in statistics and the popular random forest model in machine learning to establish the analysis models of the delay factors of acute coronary syndromes, and analyze the functional structure of the models. In addition, this paper obtains data through actual survey methods, and analyzes the data through the model constructed in this paper to explore the risk factors that affect the delay in seeking medical treatment, which is presented through charts. The research results show that the model constructed in this paper is more reliable and can be applied in practice.
Keywords
Introduction
For patients with acute coronary syndrome, time is the heart muscle and time is life. Therefore, it is necessary to use scientific methods to help patients with acute coronary syndrome make medical decisions as soon as possible after the onset. However, in the past 20 years, the results of interventional studies on the promotion of timely medical treatment for patients with heart attacks have shown that the delay in seeking medical treatment for benevolent patients has not improved. In particular, for mountainous areas, the means of transportation and communication are relatively backward. Compared with other areas, patients in mountainous areas are more prone to delays in seeking medical treatment. Therefore, it is necessary to combine machine learning methods to analyze risk factors, formulate effective coping strategies as soon as possible, and reduce the life safety threat of patients with acute coronary syndromes caused by the delay in seeking medical treatment in mountainous areas [1].
Acute coronary syndrome is a group of clinical syndromes in which the rupture of coronary atherosclerotic plaque causes secondary thrombosis. It is characterized by sudden onset, severe symptoms, and rapid changes in the condition. It should be diagnosed and treated immediately, and it includes acute myocardial infarction and unstable angina. Studies have confirmed that the golden treatment time after the onset of ACS is 1 hour. Timely treatment within 1 hour can reperfusion ischemic myocardium, protect left ventricular function, limit the size of infarction, reduce mortality and complications, and reduce mortality by 53%. When the patient had thrombolysis within 3 hours, the fatality rate dropped by 23%. Due to various factors, ACS patients generally have delays in medical treatment decisions. The so-called delay in seeking medical treatment decision-making refers to the failure of the patient to seek medical treatment immediately under the influence of various factors when uncomfortable symptoms or abnormal body indicators occur. In the United States, the average time between the onset of symptoms and arrival at the hospital for ACS patients is more than 2 hours, and nearly 25% of patients exceed 5 hours [2]. Treatment delay includes three stages: delay in patient decision-making (the time from the onset of symptoms to the decision to seek medical attention), delay in transfer (the time from deciding to leave to the place of medical treatment), and delay in the hospital (arriving at the place of medical treatment to the beginning of treatment). At present, the patient’s decision-making delay time has not been significantly shortened, but the occurrence of delays in transport and hospital delays has been greatly reduced. Therefore, the decision-making delay of ACS patients deserves further discussion. The shorter the delay time, the more valuable clinical rescue time can be won and the survival rate of patients should be improved. In this regard, we should pay more attention to it [3].
Related work
With the rapid development of big data and machine learning technology in recent years, integrated algorithms such as random forest (RF) and gradient boosting regression [4] have received extensive attention. Compared with the traditional machine learning model, the ensemble algorithm is proved to have better prediction accuracy. These algorithms have achieved excellent results in some data mining competitions. The literature [5] used gradient boosting regression model to analyze related factors of medical treatment delay and give decision-making suggestions. The literature [6] used gradient enhancement model and deep feature engineering in the KDDCup2013 task to get the second place. The literature [7] combined visual network element neural regression and random forest, and wins the championship in the educational data mining competition. The Literature [8] In the field of vehicle travel time prediction, scholars in the field of transportation include Gong Yue and others who predict road travel time based on the gradient boosting regression model, and found that the average absolute error is about 10%, and compared with SVM, ARIMA, etc. Model, pointed out that gradient boosting regression has higher prediction accuracy. The literature [9] verified that the gradient boosting regression tree is more suitable for traffic flow forecasting by comparing ARIMA and random forest, and pointed out that the introduction of Huber loss function can reduce the loss of residual error and improve the accuracy of the model. Zhang et al. used gradient boosting regression to predict highway travel time after training, and compared it with other integrated algorithms, and concluded that gradient boosting regression is more suitable for highway travel time prediction. The literature [10] combined the random forest and Adaboost model in the ensemble algorithm to train the recognition model, and obtained an error rate of 7% in judging whether the traffic is congested at a certain moment. The literature [11] established a random forest model to predict traffic flow, and found that random forest not only has higher accuracy than support vector machines, but also has higher efficiency and scalability.
The decision-making for medical treatment of ACS patients is a complicated process, which is affected by many factors, which can be divided into controllable factors and uncontrollable factors. Uncontrollable factors are age, race, economic status and past history, and controllable factors include the knowledge level, emotional factors, social support and health literacy of patients with ACS. The clarification of controllable factors in patient decision-making delay is conducive to the implementation of targeted interventions [12].
The age, gender, education level, and economic status in sociodemographic data are related to the delay in decision-making of ACS patients. Old age is an independent predictor of prolonging decision-making delay. The reason is that the frequency of living alone is high and activities are easily restricted, and it is inconvenient to seek medical treatment in time. The physiological function of elderly patients gradually deteriorates [13], their sensitivity to pain is reduced, and they may suffer from other comorbidities that affect their judgment [14]. Compared with men, women have more atypical symptoms [15]. In addition, psychological factors may affect the response pattern of women seeking help [16]. Women often do not realize that they are at risk of suffering from myocardial infarction, and often choose to seek help from others rather than go to a professional medical institution for medical treatment when they are unwell, which leads to delays in medical treatment for more female patients [17]. Other sociodemographic factors, such as low education, low income, no medical insurance, manual labor, etc., will prolong the decision-making delay time of ACS patients. The reason is that patients with low education level lack knowledge of ACS and cannot recognize symptoms in time, which affects patients to seek medical help quickly [18]. Low-income or uninsured patients are unable to pay for medical expenses [19], leading to delays in medical treatment. Patients with physical labor have less awareness of the disease, and at the same time will be affected by low income and concerns about medical expenses [20]. Environmental factors such as the onset at night, the state at the time of the onset of symptoms, the place of residence, and the form of residence are important factors that cause delay in decision-making. Generally, patients who develop disease at night think that there is no senior doctor at night, and they cannot get effective treatment at one time. Or, at this time, the patient does not want to bother others and chooses to continue suffering. Secondly, the traffic is inconvenient at night [21]. The state of patients at the onset of symptoms is another environmental factor. Patients who are sleeping or resting at the onset of symptoms have a longer delay than those engaged in physical activity [22]. The patient’s place of residence is negatively related to whether there is a delay in decision-making. The place of residence is far from the hospital, the journey to the hospital is longer, and the rural residence or travel outside are all related to the longer delay [23]. The influence of residence form on decision-making delay is manifested in patients who live alone have longer decision-making delays than those who live with their families [24]. This may be because when the patient’s symptoms occur, the caregiver will find the discomfort the first time, call the emergency call and give corresponding treatment, thereby shortening the delay time.
Structural equation, gologit and the theoretical basis of random forest
There are two basic models in SEM: measured model and structural model. The measurement model is composed of latent variables and measured variables. In terms of mathematical definition, a measurement model is a linear function of a set of observed variables. Observed variables refer to data obtained through surveys, and latent variables refer to data that cannot be directly measured. Latent variables need to be measured through observation variables. In the structure of the SEM model, the general rectangular symbol is used to represent the observed variable, and the ellipse symbol is used to represent the latent variable. The structural model represents the relationship between latent variables. The relationship between latent variables is divided into two types: correlation and direct action. Measurement model is a model that represents the relationship between observed variables and latent variable indicators. It requires some theory to support the relationship between latent variables and observed variables. The basic principles of structural equation modeling can be summarized as: two types of variables (explicit variable and latent variable), two models (measurement model and structural model), and two approaches (the path between latent and explicit variables, and the path between latent variables). The structure diagram of the structural equation model is shown in Fig. 1.

Structural equation model.
(1) Measurement model
The measurement model uses observed variables to construct latent variables. The relationship between latent variables and observed variables constitutes the connotation of the entire conceptual model. Usually it is written as the following measurement equation.
Among them:
ξ——represents exogenous latent variable.
η——represents endogenous latent variable.
x——represents exogenous index.
y——represents endogenous index.
δ——represents error term of x.
ɛ——represents error term of y.
∧ x ——represents the relationship between exogenous indicators and exogenous latent variables.
∧ y ——represents the relationship between endogenous indicators and endogenous latent variables.
(2) Structural model
The structural model is mainly used to describe the linear relationship between latent variables. The calculation formula of the structural model is as follows:
Among them:
B——represents the relationship between endogenous latent variables.
Γ——represents the influence of exogenous latent variables on endogenous latent variables.
ζ——represents residual term of structural equation.
(3) Latent variable
Variables that cannot be obtained by direct measurement are called latent variables, and there are two types of endogenous latent variables and exogenous latent variables. Endogenous latent variables are also called (Endogenous Factors, which represent the latent variables affected by other latent variables; Exogenous latent variables are also called Exogenous Factors, which represent latent variables determined by other factors outside the system.
(4) Observable indicators:
Indicators are also called observed variables. Indicators contain systematic errors and random errors. Indicators are divided into endogenous indicators and exogenous indicators. Endogenous indicators: indicators that can indirectly measure endogenous latent variables; Exogenous indicators: indicators that can indirectly measure exogenous latent variables.
Modeling process of structural equation model
Generally speaking, the steps and process of establishing a structural equation model mainly include the following steps, as shown in Fig. 2:

Structural equation model modeling.
(1) Model setting
Structural equation model provides quantitative analysis for the observed variables and establishes the causal relationship between the observed variables. Model setting is to give a path diagram based on related theories, that is, the relative influence and causality between variables.
(2) Model assumptions
Model assumptions are made to determine the relationship between variables. The general model setting has the following 3 aspects: The relationship between observed variables and latent variables; The relationship between latent variables (mainly causation and correlation); According to the researcher’s knowledge and experience, the relationship or value of parameters such as factor correlation coefficient or factor load is set.
The ordered Logit model is an extension of the binomial Logit model, which is mainly used to deal with the ordered multi-class results of the dependent variable. The ordered Logit model of the jth level is:
In the formula:
X——represents vector of independent variables;
B——represents vector of regression coefficients;
α j ——represents the intercept of the j-th level;
K——represents the number of independent variables, x k is the kth independent variable, k = 12, ⋯ , K.
β k ——represents the regression coefficient of the k-th independent variable;
P (Y ⩽ j|X)——Cumulative probability, and there is
Therefore, the probability model of the ordered Logit model is:
The generalized ordered Logit model can relax the proportional dominance assumption of some independent variables and add two parameters that do not satisfy the hypothesis dominance variable and its coefficient. Therefore, the generalized ordered Logit model can be expressed as:
Among them:
β j ——represents the regression coefficient vector of the jth level;
α j ——represents the intercept of the j-th level, and α1 < α2;
T——represents a vector of independent variables that do not meet the proportional advantage assumption;
γ
j
——represents a vector that does not satisfy the regression coefficient of the proportional advantage hypothesis vector T in the j-th level. Therefore, the probability model of the generalized ordered Logit model is:
The advantages of the generalized ordered Logit model are: Compared with the two-category Logit model, the generalized ordered Logit regression model can be used to check whether there are significant differences in the influence of the different orders of the independent variables on the dependent variables. It overcomes the limitations of the ordered logit model. The important limitation of the ordered logit model lies in its proportional advantage assumption.
Model goodness of fit test
When the model is established, the goodness of fit is used to test the error size between the predicted value of the model and the truth, so as to test and evaluate the predictive performance of the model.
(1) Pearson χ2 test (Pearsonχ2)
Pearson χ2 is used to test the hypothesis of the validity of the model through frequency (frequency is the comparison between the occurrence and non-occurrence of events predicted by the model and the occurrence and non-occurrence of observed events).
The standard χ2 statistic calculation formula is:
In the formula:
K——1, 2, ⋯ , K
K——represents number of types of covariance types;
O k ——represents observation frequency in the k-th covariant type;
E k ——represents the prediction frequency in the k-th covariant type.
The smaller the value of the χ2 statistic, the smaller the difference between the predicted value and the observed value, and the better the fitting effect of the model. On the contrary, it shows that the model fitting effect is worse.
(2) Deviation statistics
The deviation statistic is the likelihood ratio statistic between the saturated model and the fitted model. We assume that
When the value
If the independent variables in the model have continuous values, some covariances will have different values, which will lead to a wide variety of covariance types. At this time, it is not suitable to use the D statistic and Pearson χ2 statistic to test the goodness of fit of the model. However, the Hoamer- Lemeshow goodness of fit index can be used.
(3) Information Measurement Index
AIC criterion (Akaike’s information criterion) and SC criterion (Shwarts criterion) are more common information measurement indicators used to fit the model.
1) AIC indicator
The AIC indicator formula is as follows:
In the formula:
M——represents the number of independent variables in the model;
G——represents the number of total response variable categories minus 1;
N——represents the number of samples.
2) SC index
The SC index formula is as follows:
In the formula:
d . f . s——represents the degree of freedom of the model, and its value is the difference between the sample size and the estimated coefficient of the model;
n——represents the total number of sample sizes.
SC
s
> 0 indicates that the set model is worse than the saturated model, and SC
s
< 0 indicates that the set model is better than the saturated model. Another calculation formula of SC indicator is:
In the formula: d . f′ . s——represents the number of independent variables.
SC′ > 0 indicates that the effect of the set model is worse than that of the null hypothesis model, and SC′ < 0 indicates that the effect of the set model is better than the null hypothesis model.
In a linear model, R2 is a commonly used indicator, and its value is the regression error sum of squares to the total sum of squares,
It can describe the percentage of the change in the dependent variable explained by the independent variable. In the Logit model, a class R2 index (AnalogusR2) can be defined by the likelihood value, which is recorded as the likelihood ratio index LRI (likelihood ratio index).
Like R2, the value range of LRI is [0, 1]. The larger the value of LRI, the better the fitting effect of the model. When LRI is 0, it means that the independent variable and the dependent variable are not correlated. Under ideal conditions, the value of LRI reaches 1, which means that the model is fully fitted.
Random forest prediction is based on a set of independent prediction results with the most votes as the final result, which is more accurate than using the best model alone. The principle of the model is shown in Fig. 3:

Principle of Random Forest Model.
The random forest algorithm has many advantages: It performs well on the data set and has great advantages over other algorithms; It can handle high-dimensional data without the need for feature selection; It has fast training speed; It is not easy to produce over-fitting; It is easy to make a parallel method; It can effectively estimate the actual data, and can maintain good accuracy;
The main disadvantages are: The random model is a black box that is difficult to explain; Random forests are more sensitive to variables with a large number of levels, and tend to give more weight to such variables. Since the random forest model cannot perform continuous output, the performance of the random forest in the regression problem is not as good as the classification problem.
Decision tree
Random forest is composed of several decision trees. Decision tree is a simple and efficient classification model, which is widely used in the field of data analysis. Each classification tree in the random forest is a binary tree. The decision tree uses a top-down recursive method to compare attribute values at internal nodes, that is, starting from the root node and branching down from the node according to different attribute values.
The decision tree starts from the root node, branches, forms several intermediate nodes, and finally reaches a certain leaf node. This path can be regarded as a classification rule, and the decision tree is a collection of tree structure rules composed of several such classification rules.
The basic process of constructing a decision tree is as follows: At the beginning, all data is regarded as a node; Each attribute is compared for purity, and the attribute with the best purity is selected for branching; On the basis of the branch in the previous step, according to the value of its attribute, all the data branches are recorded as leaf nodes as K1, K2, ⋯ , K
n
(n is the number of attribute values of the node); The child node K1, K2, ⋯ , K
n
is recursively repeated the above 2 and 3 steps. When the purity of each node meets the requirements, stop branching.
Commonly used decision tree algorithms include ID3 algorithm, CART algorithm, and C4.5 algorithm. The main difference between different algorithms is the choice of test attribute standards. ID3 is the criterion for selecting information gain, C4.5 uses information gain ratio, and CART algorithm uses Gini index. At the same time, the algorithm used to generate the decision tree in this paper is CART.
The specific division process of the decision tree is shown in Fig. 4. Each piece of data is judged from the root node. After passing through the attribute judgment and meeting the node purity requirements, the branch is stopped, and we can know which category it belongs to, and get the prediction result.

Diagram of decision tree.
There are three commonly used classification standards for internal node splitting in decision trees: information gain, information gain ratio, and Gini index. The specific calculations of the three types of indicators are as follows:
1. The calculation steps of information gain are as follows:
(1) The information entropy Info (D) of the data set D is calculated
(2) The conditional information entropy Info
A
(D) of feature A to data set D is calculated.
(3) Information gain is calculated.
2. Information gain ratio
Information gain ratio improved information gain will always tend to select attributes with more attribute values. It is defined as the information gain ratio of a certain feature A to the data set D, which is calculated as follows:
3. Gini index
Among them, p k is the probability that the sample belongs to the k-th category, and K is the total number of categories.
For a particular sample set D, its Gini index is:
Random forest parameters
Random forest involves many parameters, such as the number of decision trees nTree, the maximum number of features MF (max features) considered when dividing random forests, the minimum number of leaf nodes MSL (min samples leaf), the maximum depth of decision trees (max depth), internal node re The minimum number of samples required for division (min samples split), the minimum sample weight sum of leaf nodes (min weight fraction leaf), the maximum number of leaf nodes (max leaf nodes), and the minimum impurity of node division (min impurity split), etc. However, random forest can achieve good classification prediction results without adjusting too many parameters in the actual modeling process. In the research of this paper, we mainly consider the following three main parameters that have a greater impact on model performance.
1. nTree: It represents the number of decision trees generated by the random forest.
In theory, the larger the value of nTree, the better the effect. However, this is not the case in reality. The more trees, the longer the model calculation time. Often setting a reasonable number of decision trees will achieve good results.
2. MF: A subset of the feature set is randomly selected, which is the largest number of feature vectors used by a single decision tree in the random forest.
In random forest, the fewer the number of sub-feature sets, the more the variance of the model will decrease, and the more the deviation of the model will increase. According to previous experience, for classification problems, the general MF value is the square root of the total number of features.
3. MSL: minimum number of leaf nodes, minimum sample leaf size.
The value of MSL limits the minimum number of samples for leaf nodes. If the number of leaf nodes is less than the number of samples, they will be pruned together with the sibling nodes. The default is 1, we can enter the integer of the minimum number of samples or the percentage of the minimum number of samples to the total number of samples.
The construction process of random forest is shown in the figure below, and the specific steps are as follows: First, the sub-sample set is constructed. For each traffic incident learner (that is, decision tree), the bootsrap resampling method is used. N sample data are randomly replaced from the original data set S to form a new sub-sample set, and this process is repeated to form K sub-sample sets, which are used as training samples for each decision tree. Due to this randomness, the deviation of the forest usually increases slightly (relative to the deviation of a single non-random tree). However, due to the averaging, the variance will also decrease, which can usually compensate for the increase in deviation, resulting in a better model overall. Second, the attribute subspace is constructed. For each node, from all the feature variables randomly M, m features are randomly selected, m < M. Then, the decision tree is built. In the process of random forest generation, according to the sub-sample set and sub-vector set constructed above, K decision trees are generated, and each decision tree corresponds to each training subset. The random forest model is constructed. The K decision trees generated in the previous step are combined into a random forest, and the training data is used to train the model. Model prediction. When the established random forest accepts the input prediction data, the K decision trees in the random forest vote on the prediction data respectively, and count all the voting results. The final result is the result with more votes as the final output result of the model.
For simplicity, we assume that the input of the original time series is m, and the forecast data series is n. Fig. 6 shows the topology of a GGNN with a three-layer network structure. In the topology shown in Fig. 6, the input layer is 4, the number of hidden layers is 9, and the number of output layers is 1. Among them, the input of GGNN is the fitting value of the original time series by the four improved gray models. The fitted value is input into the 3-layer GGNN network structure, and the predicted value is obtained after training and fitting. In the process of training and fitting, genetic algorithm is used to optimize the weight and threshold of GGNN.

Random forest establishment and workflow.

Three-layer network topology.
The model constructed in this paper analyzes the risk factors of delayed medical treatment in patients with acute coronary syndrome in mountainous areas. This article collects the results through investigators and counts the collected results. The statistical response to acute coronary syndrome is shown in Table 1.
Responses to acute coronary syndromes (n = 250)
Responses to acute coronary syndromes (n = 250)
In this study, because there are extreme values in the delay time, it belongs to a non-normal distribution, so the mean and the median are quite different. Among them, the average delay time of patients’ decision to seek medical treatment is 360 minutes, and the median is 130 minutes. The average delay time of the patient transfer process is 60 minutes, and the median is 30 minutes. The average in-hospital delay time for patients is 34 minutes, and the median was 20 minutes. The decision-making time of patients exceeded 1 hour, accounting for 70.8% (177 patients). The decision-making time is divided into time periods for statistical analysis results, as shown in Table 2 and Fig. 7.
Distribution of patient decision-making time period (n = 250)

Statistical diagram of the distribution of patient decision-making time periods.
The statistical results of the risk factors affecting the delay in seeking medical treatment of patients with acute coronary syndrome are shown in Table 3 and Fig. 8.
Statistical table of factors affecting delay in medical decision-making

Statistical diagram of factors affecting delay in medical decision-making.
It can be seen from the above figure and table that the model constructed in this paper can analyze the risk factors that affect the delay of medical treatment in patients with acute coronary syndrome in mountainous areas, and the analysis results have certain reliability, and can be used as a theoretical reference for subsequent timely medical treatment.
Acute coronary syndrome (ACS) is a group of clinical syndromes in which the rupture of coronary atherosclerotic plaques causes secondary thrombosis. The decision-making delay of ACS patients deserves further discussion. The shorter the delay time, the more valuable clinical rescue time can be won and the survival rate of patients will be improved. Delay in patient decision-making for medical treatment is still the main obstacle that affects the early treatment of ACS patients, and is affected by various factors such as disease type, age, cognition and emotion. Therefore, clinical staff and community health educators should strengthen patient health education and nursing intervention, and change the concept of medical treatment. Based on machine learning, this paper constructs a machine learning-based analysis model for the delay in seeking medical treatment for acute coronary syndromes, and analyzes actual data through this model. The research results verify the reliability of this model.
Footnotes
Acknowledgments
This work was supported by Zhejiang Provincial Natural Science Foundation of China (Grant Nos. LY18G030016, LQ20G030005).
