Outpatient Volume Prediction Method and Device Based on Ensemble Learning
Through the fusion training of the outpatient quantity prediction model based on ensemble learning, the outpatient quantity prediction model is solved, which solves the problem of overfitting outpatient quantity prediction in the prior art and improves the prediction accuracy.
Patent Information
- Application Number
- CN202210442771.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-25
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-04-25
AI Technical Summary
The prior art is prone to overfitting in outpatient volume prediction, resulting in a decrease in prediction accuracy.
Using an integrated learning method, by obtaining outpatient derived data, the sub-learning model of the integrated learning model is trained separately, and the intermediate model is obtained, and the prediction results are fused with the training data to be trained, and the target outpatient quantity prediction model is finally obtained.
Through the fusion training of the integrated learning model, the accuracy of outpatient volume prediction of the model is improved and the risk of overfitting is reduced.
Smart Images

Figure CN114970677B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method and device for predicting outpatient volume based on ensemble learning. Background Art
[0002] In recent years, with the rise of artificial intelligence and deep learning, people have begun to attempt to use machine learning methods to predict the outpatient volume of hospitals and achieved certain success.
[0003] However, in this field currently, the neural networks used in the prior art can fit large-scale data and greatly improve the model accuracy by adjusting the non-linear activation function and the number of network layers. However, there is a problem of easy overfitting, which will reduce the prediction accuracy of the outpatient volume. Summary of the Invention
[0004] The present invention provides a method and device for predicting outpatient volume based on ensemble learning to improve the prediction accuracy of the outpatient volume of the model.
[0005] According to one aspect of the present invention, there is provided a method for predicting outpatient volume based on ensemble learning, including:
[0006] Obtaining outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set;
[0007] Training sub-learning models of the ensemble learning model respectively based on each of the training data sets to obtain at least one intermediate model, and fusing the prediction results of the intermediate models for the training data with the corresponding training data to obtain first fusion data, and training the sub-learning models to be trained in the ensemble learning model according to the first fusion data to obtain a target outpatient volume prediction model;
[0008] Fusing the prediction results of the intermediate models for the test data set with the test data set to obtain second fusion data, and inputting the second fusion data into the target outpatient volume prediction model to obtain a predicted outpatient volume.
[0009] According to another aspect of the present invention, there is provided a device for predicting outpatient volume based on ensemble learning, including:
[0010] A derived data acquisition module for obtaining outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set;
[0011] A target model generation module, configured to train sub - learning models of an ensemble learning model based on each of the training data sets respectively, to obtain at least one intermediate model, and fuse the prediction results of the training data based on the intermediate model with the corresponding training data to obtain first fusion data, and train the sub - learning models to be trained in the ensemble learning model according to the first fusion data to obtain a target outpatient volume prediction model;
[0012] An outpatient volume prediction module, configured to fuse the prediction results of the test data set based on the intermediate model with the test data set to obtain second fusion data, and input the second fusion data into the target outpatient volume prediction model to obtain a predicted outpatient volume.
[0013] According to another aspect of the present invention, there is provided an electronic device, which includes:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the outpatient volume prediction method based on ensemble learning according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, there is provided a computer - readable storage medium storing computer instructions for enabling a processor to implement the outpatient volume prediction method based on ensemble learning according to any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention obtains outpatient - derived data, where the outpatient - derived data includes at least one training data set and a test data set; trains sub - learning models of an ensemble learning model based on each training data set respectively to obtain at least one intermediate model, and fuses the prediction results of the training data based on the intermediate model with the corresponding training data to obtain first fusion data, and trains the sub - learning models to be trained in the ensemble learning model according to the first fusion data to obtain a target outpatient volume prediction model; fuses the prediction results of the test data in the outpatient - derived data based on the intermediate model with the test data to obtain second fusion data, and inputs the second fusion data into the target outpatient volume prediction model to obtain a predicted outpatient volume. By training and predicting the ensemble learning model with the fusion data containing prediction results, the model can learn more feature information, thereby improving the accuracy of the outpatient volume prediction of the model.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0021] Figure 1 is a flowchart of a method for predicting outpatient volume based on ensemble learning according to Embodiment 1 of the present invention;
[0022] Figure 2 is a flowchart of a method for predicting outpatient volume based on ensemble learning according to Embodiment 2 of the present invention;
[0023] Figure 3 is a flowchart of a method for predicting outpatient volume of an ensemble learning model according to Embodiment 2 of the present invention;
[0024] Figure 4 is a flowchart of a method for predicting outpatient volume based on ensemble learning according to Embodiment 3 of the present invention;
[0025] Figure 5 is a flowchart of a method for predicting outpatient volume of an ensemble learning model according to Embodiment 3 of the present invention;
[0026] Figure 6 is a schematic structural diagram of a device for predicting outpatient volume based on ensemble learning according to Embodiment 4 of the present invention;
[0027] Figure 7 is a schematic structural diagram of an electronic device for implementing the method for predicting outpatient volume based on ensemble learning in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the following clearly and completely describes the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 FIG. 1 is a flowchart of a method for predicting outpatient volume based on ensemble learning provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of automatically predicting outpatient volume through an ensemble learning model. This method can be executed by an outpatient volume prediction device based on ensemble learning. The outpatient volume prediction device based on ensemble learning can be implemented in the form of hardware and / or software. The outpatient volume prediction device based on ensemble learning can be configured in an electronic device, such as a terminal and / or a server. As Figure 1 shown, the method includes:
[0032] S110. Obtain outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set.
[0033] Among them, outpatient-derived data refers to new feature data obtained by processing original outpatient data, which can be used for model training and testing. The data processing method can include one or more of the following methods: data cleaning, data screening, data reconstruction, and feature engineering, etc. The outpatient-derived data can include, but is not limited to, at least one training data set and a test data set. The training data set can be used to train the ensemble learning model, and the test data set can be used to test the trained model. It should be noted that the ratio of the training data set to the test data set can be set according to experience and is not limited here.
[0034] Specifically, the method for obtaining outpatient-derived data can include: directly obtaining from a preset storage location (such as a sample database); or, collecting original outpatient data in real time through a data collection device, and performing a series of data processing processes on the original outpatient data to obtain outpatient-derived data. The present embodiment does not limit the acquisition method of outpatient-derived data.
[0035] Based on the above embodiments, the obtaining of outpatient-derived data includes: obtaining original outpatient data, performing data screening on the original outpatient data to obtain screened outpatient data; performing feature engineering processing on the screened outpatient data to obtain initial outpatient-derived data; and partitioning the initial outpatient-derived data to obtain outpatient-derived data.
[0036] Among them, the original outpatient data refers to the outpatient data that has not been processed and cannot be directly used for model training and testing. It may include, but is not limited to, outpatient volume data, department data, hospitalization data, and third-party data, etc. Among them, the third-party data may include, but is not limited to, environmental factors such as temperature, humidity, weather, or flow-limiting factors. The screened outpatient data refers to the data obtained by screening the original outpatient data. The purpose of data screening is to remove the data that is incorrectly stored due to system and business reasons, which can improve the reliability of the data. The purpose of feature engineering processing is to convert the screened outpatient data into training data or test data that the model can recognize. Further, by partitioning the initial outpatient-derived data, training datasets and test datasets with different proportions can be obtained, which can be used to implement the training of the ensemble learning model and the prediction of outpatient volume.
[0037] Exemplarily, the original outpatient data can be obtained from the database, and the original outpatient data can be changed in real time according to the changes in the business, thereby making the obtained outpatient-derived data more flexible. Further, after obtaining the original outpatient data, data screening is performed on the original outpatient data. The data screening includes data cleaning, data reconstruction, format conversion, etc., to obtain screened outpatient data. Further, according to the screened outpatient data, feature engineering processing is performed. The feature engineering processing may include, but is not limited to, feature acquisition, feature cleaning, dimensionality reduction and other processing operations, to obtain initial outpatient-derived data that can be used for model training or testing; then the initial outpatient-derived data can be partitioned to obtain training datasets and test datasets with different proportions, which can be used for the training and testing of the ensemble learning model respectively. Among them, the training dataset can be historical data, including outpatient volume data; the test dataset does not include outpatient volume data.
[0038] S120. Based on each of the training datasets, train the sub-learning models of the ensemble learning model to obtain at least one intermediate model, and fuse the prediction results of the intermediate model for the training data with the corresponding training data to obtain first fusion data. Train the sub-learning models to be trained in the ensemble learning model according to the first fusion data to obtain the target outpatient volume prediction model.
[0039] Among them, the ensemble learning model refers to a model that contains multiple combined sub-learning models to complete the prediction task. The ensemble learning model can include multiple sub-learning models, and each sub-learning model is an untrained initialized model. The types of each sub-learning model can be the same or different, which is not limited here. The intermediate model refers to the model obtained after the sub-learning model is trained. The number of intermediate models can be one or more. The training data can be part of the data of each training dataset or all of the data of each training dataset, which is not limited here.
[0040] Specifically, train the sub-learning models of the ensemble learning model according to each training dataset to obtain at least one intermediate model; after obtaining the intermediate model, the training data can be input into the intermediate model to obtain a prediction result, and the training data and the prediction result can be fused to obtain the first fused data. The first fused data can be understood as feature-enhanced training data. The first fused data can be used to train the sub-learning model to be trained in the ensemble learning model, enabling the model to learn more reliable features and improving the prediction accuracy of the target outpatient volume prediction model.
[0041] S130. Based on the prediction result of the intermediate model for the test dataset and the test dataset, fuse them to obtain the second fused data, and input the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0042] Among them, the second fused data can be understood as enhanced prediction data. Inputting the second fused data into the target outpatient volume prediction model will also obtain a more accurate predicted outpatient volume. The predicted outpatient volume can be the predicted outpatient volume of a single department or the predicted outpatient volume of the whole hospital, which is not limited here.
[0043] Specifically, input the test dataset into the intermediate model to obtain a prediction result, and fuse the prediction result with the test dataset to obtain the second fused data. It should be noted that the target outpatient volume prediction model is trained by the first fused data, and the second fused data is also input into the target outpatient volume prediction model, that is, both the training data and the prediction data are feature-enhanced fused data, enabling the ensemble learning model to learn richer features during the training and prediction processes, thereby improving the accuracy of the predicted outpatient volume.
[0044] An embodiment of the present invention provides a method for predicting outpatient volume based on ensemble learning. By obtaining outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set; training sub-learning models of the ensemble learning model based on each training data set respectively to obtain at least one intermediate model, and fusing the prediction results of the training data based on the intermediate model with the corresponding training data to obtain first fused data, training the sub-learning model to be trained in the ensemble learning model according to the first fused data to obtain a target outpatient volume prediction model; fusing the prediction results of the test data in the outpatient-derived data based on the intermediate model with the test data to obtain second fused data, and inputting the second fused data into the target outpatient volume prediction model to obtain a predicted outpatient volume. By training and predicting the ensemble learning model with the fused data containing prediction results, the model can learn more features, thereby improving the accuracy of the outpatient volume prediction of the model.
[0045] Embodiment 2
[0046] Figure 2 FIG. is a flowchart of a method for predicting outpatient volume based on ensemble learning provided by Embodiment 2 of the present invention. The embodiments of the present invention can be combined with each of the above optional solutions. In the embodiments of the present invention, optionally, the ensemble learning model includes a first sub-learning model and a third sub-learning model; the training of the sub-learning models of the ensemble learning model based on each training data set respectively to obtain at least one intermediate model, and fusing the prediction results of the training data based on the intermediate model with the corresponding training data to obtain first fused data, training the sub-learning model to be trained in the ensemble learning model according to the first fused data to obtain a target outpatient volume prediction model includes: training the first sub-learning model based on the first training data set to obtain a first intermediate model, inputting the second training data set into the first intermediate model to obtain a first prediction result; fusing the first prediction result and the second training data set to obtain first fused data; training the third sub-learning model based on the first fused data to obtain a target outpatient volume prediction model.
[0047] As Figure 2 shown, the method of the embodiment of the present invention specifically includes the following steps:
[0048] S210. Obtain outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set.
[0049] S220. Train the first sub-learning model based on the first training data set to obtain a first intermediate model, input the second training data set into the first intermediate model to obtain a first prediction result.
[0050] S230. Integrate the first prediction result and the second training dataset to obtain a first integrated data.
[0051] S240. Train the third sub - learning model based on the first integrated data to obtain a target outpatient volume prediction model.
[0052] S250. Integrate the prediction result of the test dataset based on the intermediate model and the test dataset to obtain a second integrated data, and input the second integrated data into the target outpatient volume prediction model to obtain a predicted outpatient volume.
[0053] In this embodiment, the ensemble learning model may include a first sub - learning model, a second sub - learning model, and a third sub - learning model. Among them, the types of each sub - learning model are the same. For example, each sub - learning model may be an initialized LightGBM (Light Gradient Boosting Machine) model, XGBoost, etc. In addition, to ensure the model accuracy and fitting degree, the ensemble learning model may include Boosting (boosting algorithm) and Stacking (fusion algorithm). 5 - fold cross - validation can be used during the training process, and the loss function can adopt mean squared error (MSE) and mean absolute error (MAE).
[0054] Based on the above embodiments, the integrating the first prediction result and the second training dataset to obtain a first integrated data includes: inserting the first prediction result into the second training dataset to obtain a first integrated data.
[0055] Specifically, the first prediction result can be inserted into the starting position, the ending position, or the middle position of the second training dataset, which is not limited herein. It should be noted that the first prediction result can be inserted in the form of a column.
[0056] Exemplarily, as Figure 3 shown, train an initialized LightGBM model according to the first training dataset to obtain a first intermediate model; where the first training dataset formula D 1 is expressed as follows:
[0057]
[0058] where d mn represents the value of the nth feature of the mth data. It should be noted that the n features here can be n features selected by the user, not all features.
[0059] Furthermore, input the second training dataset into the first intermediate model for prediction to obtain a first prediction result; the second training dataset D 2and the first prediction result are respectively expressed as follows:
[0060]
[0061]
[0062] Wherein, represents the feature data of the prediction result. Further, the second training data set is fused with the first prediction result to obtain the first fusion data. The formula of the first fusion data R 1 is expressed as follows:
[0063]
[0064] Use the first fusion data to train the initialized LightGBM model to obtain the final target outpatient volume prediction model.
[0065] Based on the above embodiments, the ensemble learning model further includes a second sub - learning model. The prediction result of the test data set by the intermediate model is fused with the test data set to obtain the second fusion data. Inputting the second fusion data into the target outpatient volume prediction model to obtain the predicted outpatient volume, including: training the second sub - learning model based on the second training data set to obtain a second intermediate model, inputting the test data set into the second intermediate model to obtain a second prediction result; fusing the second prediction result and the test data set to obtain the second fusion data; inputting the second fusion data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0066] Exemplarily, as Figure 3 shown, train the initialized LightGBM model according to the second training data set to obtain the second intermediate model. Further, input the test data set into the second intermediate model for prediction to obtain the second prediction result; the test data set D 3 and the second prediction result are respectively expressed as follows:
[0067]
[0068]
[0069] Further, fuse the test data set with the second prediction result to obtain the second fusion data. The formula of the second fusion data R 2 is expressed as follows:
[0070]
[0071] Input the second fusion data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0072] In this embodiment, the outpatient-derived data can be outpatient-derived data of multiple departments. After obtaining the predicted outpatient volume, the method further includes: determining the preset scores of the outpatient-derived data of multiple departments, and distinguishing the differences in data distribution and feature derivation of the outpatient-derived data of each department. Further, a preset proportion of features can be selected according to the preset scores, so as to facilitate the adaptive selection of features by each department during the next modeling, greatly reducing the modeling time and feature construction time.
[0073] An embodiment of the present invention provides an outpatient volume prediction method based on ensemble learning. By training and predicting an ensemble learning model with fusion data containing prediction results, the model can learn more feature information, thereby improving the accuracy of the outpatient volume prediction of the model. Among them, the ensemble learning model is composed of three sub-learning models. The prediction result of the first intermediate model can be used for the training of the second sub-learning model, and the prediction result of the second intermediate model can be used for the training of the third sub-learning model, enhancing the data association of each sub-learning model.
[0074] Embodiment III
[0075] Figure 4The flowchart of a method for predicting outpatient volume based on ensemble learning provided in Embodiment 3 of the present invention. The embodiments of the present invention can be combined with each optional solution in the above embodiments. In the embodiments of the present invention, optionally, each sub - learning model of the ensemble learning model is trained based on each of the training data sets to obtain at least one intermediate model, and the prediction results of the training data by the intermediate models are fused with the corresponding training data to obtain the first fused data. The sub - learning model to be trained in the ensemble learning model is trained based on the first fused data to obtain the target outpatient volume prediction model, including: training each of the sub - learning models based on the training data in the training data set to obtain the intermediate models corresponding to each of the sub - learning models; inputting the cross - validation data in the training data set into the intermediate models corresponding to each of the sub - learning models to obtain the prediction results corresponding to each of the intermediate models; fusing the prediction results corresponding to each of the intermediate models and the training data set to obtain the first fused data; training the sub - learning model to be trained based on the first fused data to obtain the target outpatient volume prediction model; correspondingly, fusing the prediction results of the test data set by the intermediate models and the test data set to obtain the second fused data, and inputting the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume, including: inputting the test data set into each of the intermediate models to obtain the prediction results corresponding to each of the intermediate models; fusing the prediction results corresponding to each of the intermediate models and the test data set to obtain the second fused data; inputting the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0076] As Figure 4 shown, the method of the embodiment of the present invention specifically includes the following steps:
[0077] S310. Obtain outpatient - derived data, where the outpatient - derived data includes at least one training data set and a test data set.
[0078] S320. Train each of the sub - learning models based on the training data in the training data set to obtain the intermediate models corresponding to each of the sub - learning models, and input the cross - validation data in the training data set into the intermediate models corresponding to each of the sub - learning models to obtain the prediction results corresponding to each of the intermediate models.
[0079] S330. Fuse the prediction results corresponding to each of the intermediate models and the training data set to obtain the first fused data.
[0080] S340. Train the sub - learning model to be trained based on the first fused data to obtain the target outpatient volume prediction model.
[0081] S350. Input the test data set into each of the intermediate models to obtain prediction results corresponding to each of the intermediate models.
[0082] S360. Integrate the prediction results corresponding to each of the intermediate models and the test data set to obtain a second integrated data, and input the second integrated data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0083] In this embodiment, the outpatient-derived data may include a training data set and a test data set. The training data set may be divided into multiple portions of training data. The training data in the training data set may be used to train each sub-learning model. The number of sub-learning models is multiple, that is, each sub-learning model can be trained simultaneously to improve the model training speed. The cross-validation data may be data selected from the training data set. This data is not used to train the model but is used to test and validate each of the intermediate models after training.
[0084] Exemplarily, as Figure 5 shown, the ensemble learning model includes six sub-learning models. Among them, five sub-learning models (i.e., Model1, Model2, Model3, Model4, and Model5) can be used for training, and the trained intermediate models are used for prediction. Another sub-learning model can be used to train the target outpatient volume prediction model (i.e., the final model). Divide the training data set (i.e., data set 1) into 5 small portions. Among them, 4 small portions of data are used for model training (Learn), and the other portion is used for cross-validation (Predict). Combine the prediction results obtained from the cross-validation of each portion to obtain meta-feature 1, and combine it with the training data set to obtain the first integrated data (i.e., integrated data 1); input the test data set (i.e., data set 2) into the 5 trained intermediate models respectively to obtain 5 prediction results, and calculate the mean value of the 5 prediction results to obtain meta-feature 2. Combine meta-feature 2 with the test data set to obtain the second integrated data (i.e., integrated data 2); use integrated data 1 to train another sub-learning model to obtain the target outpatient volume prediction model (i.e., the final model), and input integrated data 2 into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0085] Based on the above embodiments, the outpatient-derived data includes timestamp-derived features, time-series value-derived features, and attribute variable-derived features; the timestamp-derived features include timestamp features, boolean features, and time difference features; the time-series value-derived features include lag features, sliding window statistical features, and extended window statistical features; the attribute variable-derived features include non-outpatient volume features.
[0086] Among them, the timestamp-derived features refer to the feature data derived from timestamps; the time-series value-derived features refer to the feature data derived from time-series relationships; the attribute variable-derived features refer to the feature data derived from non-outpatient volume data.
[0087] Table 1
[0088]
[0089] Specifically, the timestamp features refer to the derivation of each time granularity. For example: year, month, quarter, week, day, the number of working days in the month, the number of non-working days in the month, etc. The features derived from timestamps can be used to capture the fluctuations in outpatient volume caused by time granularity. As shown in Table 1, Table 1 is a summary example table of timestamp features under different time granularities in this case.
[0090] Boolean features can be judgments on each time granularity. For example: whether it is the beginning / end of the year, whether it is the beginning / end of the month, whether it is the beginning / end of the week, whether it is the Spring Festival, whether it is the Mid-Autumn Festival, whether it is the National Day, whether it is other special holidays, etc. The features derived therefrom can be used to capture specific dates or time nodes. Exemplarily, as shown in Table 2, Table 2 is a summary table of judgment examples of boolean features in this case. Among them, non-restrictively, Table 2 uses 0 / 1 to distinguish whether it is a specific date.
[0091] Table 2
[0092]
[0093] Table 3
[0094]
[0095] The time difference features can be the measurement of specified and special time nodes. For example: the number of days from the beginning / end of the year, the number of days from the beginning / end of the quarter, the number of days from the beginning / end of the month, the number of days from the beginning / end of the week, the number of days from the day with the largest number of outpatient visits last time, the number of days from the day with the least number of outpatient visits in the current year last time, the number of days from the Spring Festival, the number of days from the National Day, the number of days from special holidays, etc. The features derived therefrom can be used to measure the fluctuations in outpatient volume caused by the length of the distance from special dates. Exemplarily, as shown in Table 3. Table 3 is a summary display of the example table of the number of days from special dates of time difference features in this case.
[0096] The time-series value-derived features can include but are not limited to: lag features, sliding window statistical features, and extended window statistical features.
[0097] The lag feature can be a measure of the outpatient volume at a specified past time, for example: the outpatient volume in the past n time granularities, where n is a positive integer, and the time granularity refers to year, month, week, day, hour, minute, second, etc., such as: the outpatient volume in the past 1 day; the outpatient volume on the current working day in the past specified time granularity, such as: the outpatient volume on the same day of last month; the difference in outpatient volume between the past n time granularities and the past n + 1 time granularities, such as: the difference in outpatient volume between the past 1 day and the past 2 days; the year-on-year / month-on-month of the outpatient volume in the past n time granularities, such as: the year-on-year / month-on-month of the outpatient volume in the past 1 day. The features derived therefrom measure the correlation between the current outpatient volume and the outpatient volume at a specified past time. Exemplarily, as shown in Table 4. Table 4 is an example table of lag features.
[0098] Table 4
[0099]
[0100] The sliding window statistical feature can be a statistic of the outpatient volume in a specified past period, for example: the statistical feature in the past n time granularities, and the statistical feature refers to the average value / maximum value / minimum value, etc., such as: the average value of the outpatient volume in the past 1 week; the statistical feature of the outpatient volume up to the current time in the specified time granularity, such as: the total of the outpatient volume up to the current time this month. The features derived therefrom measure the correlation between the current outpatient volume and the fluctuation of the outpatient volume in the past period. Exemplarily, as shown in Table 5. Table 5 is an example table of sliding window statistical features.
[0101] Table 5
[0102]
[0103] The extended window statistical feature is equivalent to a generalized sliding window statistical feature, which measures the statistical feature of the outpatient volume of this department up to the current time and the statistical feature of the outpatient volume of other departments. The features derived therefrom measure the overall outpatient volume distribution and overall proportion of this department. Exemplarily, as shown in Table 6. Table 6 is an example table of extended window statistical features.
[0104] Table 6
[0105]
[0106] In the medical scenario, in addition to the inherent attributes of the department itself, due to the arrangement of hospital personnel, equipment, etc., other departments will indirectly affect the outpatient volume of the current department. Therefore, it is necessary to incorporate the outpatient volume or attributes of other departments into the construction of the feature engineering of this department.
[0107] Based on the above embodiments, the method for determining the time series value derived feature includes: determining the correlation information between the outpatient volumes of each department; determining the time series value derived feature based on the correlation information between the outpatient volumes of each department.
[0108] The method for determining the time series value derived feature refers to the time series value derived feature of department correlation. The correlation information may refer to the correlation between departments.
[0109] Exemplarily, the correlation between the fluctuations of the outpatient volume of each department can be measured by a correlation analysis method to obtain correlation information. Further, the correlation degree of each department can be determined based on the correlation information, and the correlation information of the department that meets the preset correlation degree condition is determined as a time series value derived feature. Among them, the correlation analysis method can be a Pearson correlation coefficient method, a Spearson rank correlation coefficient method, etc., which are not limited here. The preset correlation degree condition can be a threshold condition set based on experience.
[0110] It is understandable that since different departments have different operating characteristics and the outpatient volume of a department is also affected by the operations of other departments, when performing feature engineering for a department, in addition to constructing universal features, this embodiment will calculate the correlation coefficient of outpatient volume between departments, analyze the dependency relationship of departments at the same level or the inclusion relationship between superior and subordinate departments, etc., to mine the intrinsic correlation features between departments, and use the correlation features to train and predict the model to improve the prediction accuracy of the model.
[0111] Table 7
[0112] Correlation coefficient Current department Department A Department B Current department 1 0.98 0.17 Department A 0.98 1 0.25 Department B 0.17 0.25 1
[0113] Exemplary, as shown in Table 7. Table 7 is an example table of department correlation features.
[0114] Table 8
[0115]
[0116] According to the correlation coefficient matrix diagram, the departments with the greatest correlation with the current outpatient volume are: Department A, Department C, Department D, and Department E, and the time series derived features of the outpatient volume of these departments are constructed, as shown in Table 8. Table 8 is an example table of time series derived features of the outpatient volume of each department.
[0117] Attribute variable derived features include but are not limited to: encoding, continuous variable intervalization, linear / nonlinear transformation, attribute variable derived features are mainly for other data besides outpatient volume data, such as: department data: the number of medical staff on duty in the department on the day, the number of doctors, the number of nurses, level, weather, etc., one-hot, cross one-hot, frequency coding, binarization, etc. Attribute variable derived features are intended to improve the accuracy of the model by transforming the data, as shown in Table 9 for example. Table 9 is an example table of attribute variable derived features.
[0118] Table 9
[0119]
[0120] It should be emphasized that by training an ensemble learning model with the above-mentioned outpatient-derived data containing rich features, the problem of single features is solved, the coverage of outpatient-derived data is greatly expanded, the accuracy of the ensemble learning model is effectively improved, and by training the ensemble learning model with the above-mentioned outpatient-derived data, the model can be used to mine the fluctuations in outpatient volume caused by reasons such as continuity and causality between departments.
[0121] An embodiment of the present invention provides a method for predicting outpatient volume based on ensemble learning. By training and predicting an ensemble learning model with fusion data containing prediction results, the model can learn more feature information, thereby improving the accuracy of outpatient volume prediction of the model.
[0122] Embodiment 4
[0123] Figure 6 It is a schematic structural diagram of an outpatient volume prediction device provided in Embodiment 4 of the present invention. As Figure 6 shown, the device includes:
[0124] A derivative data acquisition module 410, configured to acquire outpatient derivative data, where the outpatient derivative data includes at least one training data set and a test data set; a target model generation module 420, configured to train sub-learning models of an ensemble learning model based on each of the training data sets to obtain at least one intermediate model, and fuse the prediction results of the intermediate models for the training data with the corresponding training data to obtain first fusion data, and train the sub-learning models to be trained in the ensemble learning model according to the first fusion data to obtain a target outpatient volume prediction model; an outpatient volume prediction module 430, configured to fuse the prediction results of the intermediate models for the test data set with the test data set to obtain second fusion data, and input the second fusion data into the target outpatient volume prediction model to obtain a predicted outpatient volume.
[0125] Based on any optional technical solution in the embodiment of the present invention, optionally, the derivative data acquisition module 410 may further be configured to:
[0126] Acquire original outpatient data, perform data screening on the original outpatient data to obtain screened outpatient data;
[0127] Perform feature engineering processing on the screened outpatient data to obtain initial outpatient derivative data;
[0128] Divide the initial outpatient derivative data to obtain outpatient derivative data.
[0129] Based on any optional technical solution in the embodiments of the present invention, optionally, the outpatient-derived data includes timestamp-derived features, time-series value-derived features, and attribute variable-derived features; the timestamp-derived features include timestamp features, boolean features, and time difference features; the time-series value-derived features include lag features, sliding window statistical features, and extended window statistical features; the attribute variable-derived features include non-outpatient volume features.
[0130] Based on any optional technical solution in the embodiments of the present invention, optionally, the device is further configured to:
[0131] Determine the correlation information between the outpatient volumes of each department;
[0132] Determine the time-series value-derived features based on the correlation information between the outpatient volumes of each department.
[0133] Based on any optional technical solution in the embodiments of the present invention, optionally, the integrated learning model includes a first sub-learning model and a third sub-learning model. The target model generation module 420 is specifically configured to:
[0134] Train the first sub-learning model based on the first training dataset to obtain a first intermediate model, input the second training dataset into the first intermediate model to obtain a first prediction result;
[0135] Fuse the first prediction result and the second training dataset to obtain first fusion data;
[0136] Train the third sub-learning model based on the first fusion data to obtain a target outpatient volume prediction model.
[0137] Based on any optional technical solution in the embodiments of the present invention, optionally, the integrated learning model further includes a second sub-learning model. The outpatient volume prediction module 430 is specifically configured to:
[0138] Train the second sub-learning model based on the second training dataset to obtain a second intermediate model, input the test dataset into the second intermediate model to obtain a second prediction result;
[0139] Fuse the second prediction result and the test dataset to obtain second fusion data;
[0140] Input the second fusion data into the target outpatient volume prediction model to obtain a predicted outpatient volume.
[0141] Based on any optional technical solution in the embodiments of the present invention, optionally, the device is further configured to:
[0142] Insert the first prediction result into the second training dataset to obtain the first fusion data.
[0143] Based on any optional technical solution in the embodiments of the present invention, optionally, the target model generation module 420 may further be configured to:
[0144] Train each of the sub - learning models based on the training data in the training dataset to obtain intermediate models corresponding to each of the sub - learning models, and input the cross - validation data in the training dataset into the intermediate models corresponding to each of the sub - learning models to obtain prediction results corresponding to each of the intermediate models;
[0145] Fuse the prediction results corresponding to each of the intermediate models and the training dataset to obtain the first fusion data;
[0146] Train the sub - learning model to be trained based on the first fusion data to obtain the target outpatient volume prediction model;
[0147] Based on any optional technical solution in the embodiments of the present invention, optionally, the outpatient volume prediction module 430 may further be configured to:
[0148] Input the test dataset into each of the intermediate models to obtain prediction results corresponding to each of the intermediate models;
[0149] Fuse the prediction results corresponding to each of the intermediate models and the test dataset to obtain the second fusion data;
[0150] Input the second fusion data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
[0151] The outpatient volume prediction device based on ensemble learning provided by the embodiments of the present invention can execute the outpatient volume prediction method based on ensemble learning provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0152] Embodiment Five
[0153] Figure 7FIG. 0 shows a schematic structural diagram of an electronic device 10 that can be used to implement an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0154] As Figure 7 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0155] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0156] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the outpatient volume prediction method based on integrated learning.
[0157] In some embodiments, the outpatient volume prediction method based on ensemble learning can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the outpatient volume prediction method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the outpatient volume prediction method by any other suitable means (e.g., by means of firmware).
[0158] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0159] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0160] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0161] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0162] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0163] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0164] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0165] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for predicting outpatient volume based on ensemble learning, characterized in that, it includes: Obtain outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set; Based on each of the training data sets, train the sub-learning models of the ensemble learning model to obtain at least one intermediate model, and fuse the prediction results of the training data based on the intermediate model with the corresponding training data to obtain the first fused data. Train the sub-learning models to be trained in the ensemble learning model according to the first fused data to obtain the target outpatient volume prediction model; Fuse the prediction results of the test data set based on the intermediate model with the test data set to obtain the second fused data, and input the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume; The ensemble learning model includes a first sub-learning model and a third sub-learning model; The step of training the sub-learning models of the ensemble learning model based on each of the training data sets to obtain at least one intermediate model, and fusing the prediction results of the training data based on the intermediate model with the corresponding training data to obtain the first fused data, and training the sub-learning models to be trained in the ensemble learning model according to the first fused data to obtain the target outpatient volume prediction model includes: Train the first sub-learning model based on the first training data set to obtain the first intermediate model, and input the second training data set into the first intermediate model to obtain the first prediction result; Fuse the first prediction result and the second training data set to obtain the first fused data; Train the third sub-learning model based on the first fused data to obtain the target outpatient volume prediction model; The ensemble learning model further includes a second sub-learning model. The step of fusing the prediction results of the test data set based on the intermediate model with the test data set to obtain the second fused data, and inputting the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume includes: Train the second sub-learning model based on the second training data set to obtain the second intermediate model, and input the test data set into the second intermediate model to obtain the second prediction result; Fuse the second prediction result and the test data set to obtain the second fused data; Input the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
2. The method according to claim 1, characterized in that, the step of obtaining outpatient-derived data includes: Obtain the original outpatient data, perform data screening on the original outpatient data to obtain the screened outpatient data; Perform feature engineering processing on the screened outpatient data to obtain the initial outpatient-derived data; Divide the initial outpatient-derived data to obtain the outpatient-derived data.
3. The method according to claim 1, characterized in that, The outpatient-derived data includes timestamp-derived features, time-series value-derived features, and attribute variable-derived features; among them, the timestamp-derived features include timestamp features, boolean features, and time difference features; the time-series value-derived features include lag features, sliding window statistical features, and extended window statistical features; the attribute variable-derived features include non-outpatient volume features.
4. The method according to claim 3, wherein, the method for determining the time-series value-derived features includes: determining the correlation information between the outpatient volumes of each department; determining the time-series value-derived features based on the correlation information between the outpatient volumes of each department.
5. The method according to claim 1, wherein, training the sub-learning models of the ensemble learning model based on each of the training data sets to obtain at least one intermediate model, and fusing the prediction results of the intermediate models for the training data with the corresponding training data to obtain the first fused data, and training the sub-learning models to be trained in the ensemble learning model according to the first fused data to obtain the target outpatient volume prediction model, includes: training each of the sub-learning models based on the training data in the training data set to obtain the intermediate models corresponding to each of the sub-learning models, inputting the cross-validation data in the training data set into the intermediate models corresponding to each of the sub-learning models to obtain the prediction results corresponding to each of the intermediate models; fusing the prediction results corresponding to each of the intermediate models and the training data set to obtain the first fused data; training the sub-learning models to be trained based on the first fused data to obtain the target outpatient volume prediction model; correspondingly, fusing the prediction results of the intermediate models for the test data set with the test data set to obtain the second fused data, and inputting the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume, includes: inputting the test data set into each of the intermediate models to obtain the prediction results corresponding to each of the intermediate models; fusing the mean of the prediction results corresponding to each of the intermediate models and the test data set to obtain the second fused data; inputting the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
6. An outpatient volume prediction device based on ensemble learning, wherein, it includes: a derived data acquisition module, configured to acquire outpatient-derived data, where the outpatient-derived data includes at least one training data set and a test data set; a target model generation module, configured to train the sub-learning models of the ensemble learning model based on each of the training data sets to obtain at least one intermediate model, and fuse the prediction results of the intermediate models for the training data with the corresponding training data to obtain the first fused data, and train the sub-learning models to be trained in the ensemble learning model according to the first fused data to obtain the target outpatient volume prediction model; An outpatient volume prediction module, which is used to fuse the prediction result of the test data set by the intermediate model with the test data set to obtain second fused data, and input the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume; The ensemble learning model includes a first sub-learning model and a third sub-learning model. The target model generation module is specifically configured to: Train the first sub-learning model based on a first training data set to obtain a first intermediate model, and input a second training data set into the first intermediate model to obtain a first prediction result; Fuse the first prediction result and the second training data set to obtain first fused data; Train the third sub-learning model based on the first fused data to obtain a target outpatient volume prediction model; The ensemble learning model further includes a second sub-learning model. The outpatient volume prediction module is specifically configured to: Train the second sub-learning model based on the second training data set to obtain a second intermediate model, and input the test data set into the second intermediate model to obtain a second prediction result; Fuse the second prediction result and the test data set to obtain second fused data; Input the second fused data into the target outpatient volume prediction model to obtain the predicted outpatient volume.
7. An electronic device Characterized in that The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the outpatient volume prediction method based on ensemble learning according to any one of claims 1-5.
8. A computer-readable storage medium Characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the outpatient volume prediction method based on ensemble learning according to any one of claims 1-5 when executed by a processor.
Citation Information
Patent Citations
Model training method and device, electronic equipment
CN108280462A
Medical auxiliary diagnosis method and device based on federated learning, equipment and storage medium
CN112201342A
Intelligent customer screening method and system based on integrated learning algorithm
CN112765451A