Nursing man-hour prediction method based on multi-label learning and storage medium
Through multi-label learning prediction methods, the problem of unreasonable resource allocation in traditional nursing work forecasting methods is solved, and more accurate nursing work forecasting is provided, which improves the efficiency and quality of medical services.
Patent Information
- Application Number
- CN202411430742.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-10
AI Technical Summary
Traditional nursing work hours prediction methods rely on empirical judgments or simple statistical models, resulting in insufficient or over-allocation of nursing resources, unable to accurately reflect complex and dynamic nursing needs, and affect the efficiency and quality of medical services.
Using a prediction method based on multi-label learning, multi-label machine learning models (such as MLKNN, Binary Relevance, Classifier Chain, Label Powerset) are trained to optimize parameters to improve prediction accuracy by collecting and preprocessing patients' basic information and nursing work data. , providing more accurate nursing work hours predictions.
A more accurate and comprehensive prediction of complex nursing tasks is achieved, helping medical institutions to plan and allocate nursing resources more effectively and improve the efficiency and quality of medical services.
Smart Images

Figure CN119296745A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of medical service technology, and specifically to a nursing man-hour prediction method and storage medium based on multi-label learning. Background Art
[0002] With the acceleration of global population aging, the demand for healthcare has increased significantly, especially in the field of nursing services. Reasonable prediction of nursing workload is of great significance for improving the quality of medical services, optimizing resource allocation, and improving patient satisfaction.
[0003] Traditional nursing hours prediction methods mainly rely on empirical judgment or simple statistical models (linear regression models and some simple linear correlation analysis). For example, the study of ICU nursing human resource allocation model based on therapeutic intervention scoring system and nursing hours measurement selected the TISS-28 mathematical model, which is a simple linear regression model. The disadvantage is that it is not accurate enough and cannot make reasonable predictions for special patients and special diseases, which often leads to unbalanced and unreasonable allocation of nursing resources. In addition, the complexity of nursing projects is also a shortcoming of using linear regression models to predict nursing hours. These methods often cannot accurately reflect the complexity and dynamic changes of nursing needs, resulting in insufficient or excessive allocation of nursing resources, which in turn affects the efficiency and quality of medical services. Developing a nursing hours prediction method based on multi-label learning and its storage medium can promote the development of medical services in a more efficient and personalized direction. Summary of the invention
[0004] The technical solution of the present invention aims at the technical problem that the existing technical solutions are too single, and provides a solution that is significantly different from the existing technology. It mainly provides a nursing work time prediction method and storage medium based on multi-label learning, which is used to solve the technical problem that the traditional nursing work time prediction method proposed in the above background technology is prone to insufficient or excessive allocation of nursing resources.
[0005] The technical solution adopted by the present invention to solve the above technical problems is:
[0006] A method for predicting nursing man-hours based on multi-label learning, including a method for building a prediction model and a method for applying the prediction model;
[0007] The prediction model building method comprises the following steps:
[0008] S1-1. Obtain input information: collect the patient's basic treatment information as feature data; collect nursing hours data as label data;
[0009] S1-2, encode the input information: pre-process the feature data, including data cleaning, missing value processing and special feature classification processing; pre-process the label data, take the patient's daily nursing project data as labels, and then convert these data into binary and save the binary digits and maximum digits information;
[0010] S1-3, training model: input the processed feature data and label data into the multi-label machine learning model for training and parameter optimization;
[0011] S1-4, Verification model: Input new test data for prediction, obtain the frequency of basic treatment nursing items for each patient in hospital every day, and finally multiply the frequency by the average nursing time of a single nursing item through the integration method to obtain the final result, and determine the basic nursing time and number of items for each patient every day;
[0012] The application method of the prediction model comprises the following steps:
[0013] S2-1. Input the patient's basic treatment information;
[0014] S2-2, the system performs information processing;
[0015] S2-3, automatic prediction by model: the system automatically inputs the coded patient information into the finalized prediction model for prediction;
[0016] S2-4. Output the frequency and duration of each nursing item for the patient's daily hospitalization.
[0017] Specifically, in step S1-1, the patient's basic information includes age, gender, smoking history, disease diagnosis and hospitalization days; the nursing time data includes the number of basic treatment items and the average duration.
[0018] Specifically, in step S1-2, feature data is preprocessed as follows: for each numerical feature, use its index to extract the corresponding column from the data set; through an automated conversion process, all non-numeric data items are converted to numerical types. If any error is encountered during the conversion process, the corresponding value is set to a null value, and the converted numerical features are converted to integer types; finally, the encoded features are stored in a dictionary, where the key is the feature name and the value is an array reshaped as a column vector to ensure compatibility with subsequent processing; for each special value feature, a statistical summary is performed based on the specific data, the main categories are classified separately, and the remaining minor categories are summarized as others.
[0019] Specifically, in step S1-2, the preprocessing of the label data includes cleaning, missing value processing, and binary conversion;
[0020] Label data cleaning and missing value processing: First, create a structure for storing and processing data; then, through an automated conversion process, convert all non-numeric data items to numeric types. Data items that fail to be converted are marked as missing and uniformly replaced with zero values to ensure data integrity; finally, through a standardization step, all data items are converted to integer types.
[0021] Specifically, in step S1-3, the multi-label machine learning model is any one of MLKNN, Binary Relevance, Classifier Chain, and Label Powerset.
[0022] Specifically, in step S1-3, when optimizing parameters, a search space is defined. In the objective function, the parameter search space of the random forest classifier is defined, including the number of trees, the maximum depth, the minimum number of samples required for splitting, and the minimum number of samples for leaf nodes;
[0023] Parameter optimization using Optuna: Create an Optuna study object, specify the objective to minimize the Hamming loss, and then find the best parameter combination; use the best parameter combination found to initialize a new random forest classifier and wrap it in a multi-label machine learning model for training and prediction.
[0024] Specifically, in step S1-4, the average nursing time is data manually measured by nursing staff in the hospital in the early stage, and the average nursing time is obtained after average value processing.
[0025] The present invention also provides a storage medium, in which a computer program is stored, and the computer program is configured to execute the above-mentioned nursing man-hour prediction method based on multi-label learning when running.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] The present invention uses historical data to input a multi-label machine learning model to train a nursing time prediction model. Multi-label learning, as a machine learning method that can simultaneously predict multiple related output labels, provides a new solution for nursing time prediction. Different from traditional nursing time prediction, most of them use linear regression models and some simple linear correlation analysis, which have the disadvantage of insufficient accuracy and inability to make reasonable predictions for special patients and special diseases, which often leads to unbalanced and unreasonable allocation of nursing resources. The present invention can better capture and utilize the correlation between labels through multi-label learning, which is crucial for understanding and predicting the complex interdependencies in nursing tasks. In addition, the complexity of nursing projects is also a shortcoming of other methods that use linear regression models to predict nursing hours, and the multi-label model in the present invention can overcome this problem. By simultaneously predicting multiple related nursing tasks, the present invention can provide more accurate and comprehensive nursing time predictions, thereby helping medical institutions to more effectively plan and allocate nursing resources and improve the efficiency and quality of medical services.
[0028] The present invention will be explained in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A flowchart of the prediction model application method of the present invention;
[0030] Figure 2 This is a feature extraction result diagram in Embodiment 1 of the present invention;
[0031] Figure 3 This is a comparison chart of the model evaluation indicators of the present invention;
[0032] Figure 4 This is an example diagram of the operation results in the first embodiment of the present invention, and the table data is the daily nursing time in minutes;
[0033] Figure 5 The following is a flow chart of the design concept of the present invention. DETAILED DESCRIPTION
[0034] To facilitate understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings, but the present invention can be implemented in different forms and is not limited to the embodiments described in the text. On the contrary, these embodiments are provided to make the content disclosed in the present invention more thorough and comprehensive.
[0035] Embodiment 1: A method for predicting nursing man-hours based on multi-label learning, including a method for building a prediction model and a method for applying the prediction model. Different hospitals Different departments of the same hospital need to build models separately.
[0036] The prediction model building method comprises the following steps:
[0037] S1-1. Obtain input information: Collect the patient's basic information (age, gender, smoking history, disease diagnosis, and number of days in hospital, etc.) as feature data; collect nursing work time data (including the number and average duration of basic treatment items, that is, the duration of each nursing work for each patient's daily hospitalization) as label data.
[0038] In this embodiment, a total of 1,149 inpatient data from the respiratory department of a hospital were collected. The daily nursing items of each patient were monitored, and the item frequency data and the duration data of a single nursing item were obtained. The basic information of each patient was also collected, including age, gender, smoking history, disease diagnosis, and length of hospital stay. Among them, the digital feature character type of age, length of hospital stay, etc. is digital type, and the disease diagnosis, etc. is text type.
[0039] S1-2, encode the input information:
[0040] (1) Preprocess the feature data, including data cleaning, missing value processing, and special feature classification processing. Input the pure numerical data intact, and input the classified data after special classification. For example, smoking history is divided into none - 0, yes - 1, and quit smoking - 2. For example, occupation classification: none - 0, farmer - 1, worker - 2, employee - 3, other - 4. The results are as follows: Figure 2 shown.
[0041] The feature data preprocessing is as follows: Initialize an empty dictionary to store the encoded feature data. Loop through each feature in the dictionary. For each numerical feature, use its index to extract the corresponding column from the dataset. Through an automated conversion process, all non-numeric data items are converted to numeric types (for example, use the pd.to_numeric function to convert the extracted text features to numeric types). If any errors are encountered during the conversion process (for example, the string cannot be converted to a number), the corresponding value will be set to NaN (null value). Convert the converted numeric features to integer types because the model requires integer input to ensure the consistency of the values. Finally, store the encoded features in a dictionary, where the keyword is the feature name and the value is an array reshaped into a column vector. This is done to ensure compatibility with subsequent processing; for each special value feature, statistical summaries are performed based on the specific data, and the main categories (referring to >= 20 samples) are classified separately, and the remaining minor categories are summarized as others. For example, when processing occupational features, first extract the occupational feature column. Define more complex encoding rules to assign different codes according to the values of occupational features. Codes from 0 to 3 are assigned according to occupational types (such as "retired", "staff", "farmer", and "worker"). All occupational types that do not meet these conditions are classified as "others" and assigned code 4. Finally, the encoded results are reshaped and stored in the dictionary.
[0042] (2) Preprocess the label data, taking the patient's daily care item data as labels, such as blood sugar and blood pressure measurement, and then convert these data into binary and save the binary digits and maximum digits information. Specifically include:
[0043] Label data cleaning and missing value processing: First, create a structure for storing and processing data (e.g., DataFrame). Then, through an automated conversion process, all non-numeric data items are converted to numeric types (e.g., using the .apply() method of DataFrame and the pd.to_numeric function to try to convert all values in the DataFrame to numeric types). Data items that fail to be converted are marked as missing and uniformly replaced with zero values (e.g., using the fillna(0) method to replace all missing NaN values with 0) to ensure data integrity. Finally, through a standardization step, all data items are converted to integer types.
[0044] Binary conversion of label data: First, to reduce sparsity. In multi-label datasets, especially when each instance may be assigned multiple labels, directly processing labels may lead to data sparsity problems. By converting labels to binary representation, this sparsity problem can be converted into a format that is easier to handle. Reduce computational complexity: By encoding the values of multiple labels as binary strings, the number of labels that the model needs to process directly can be reduced. In this way, the computational complexity can be effectively reduced even for large-scale multi-label problems. Processing relationships between labels, binary representations can more easily reveal the potential relationships between labels. For example, different label combinations are represented by combinations of binary bits, which helps the model capture the interactions between labels.
[0045] The advantages of binary conversion are: Improve model adaptability. Binary representation increases the flexibility of handling multi-label problems, allowing the model to better adapt to different data features and structures. Enhance model interpretability. Through binary encoding, the model may be easier to interpret in some cases because you can directly see which bit changes are associated with specific predicted outputs. Improve computational efficiency. Compared with directly processing a large number of multi-category labels, binary representation can simplify the complexity of the problem, thereby improving computational efficiency.
[0046] S1-3. Training model: Input the processed feature data and label data into the multi-label machine learning model for training and parameter optimization.
[0047] In this embodiment, the multi-label machine learning model uses MLKNN (multi-label k-nearest neighbor), which is a multi-label classification method based on the k-nearest neighbor algorithm. It takes into account the relevance of each label and uses the maximum a posteriori probability to predict the existence of each label. Advantages: MLKNN works better when dealing with multi-label problems, especially when the training data set is large. It can automatically discover the correlation between labels and has good robustness to noisy data.
[0048] Parameter optimization: Define the search space. In the objective function, the parameter search space of the random forest classifier is defined, including n_estimators (the number of trees), max_depth (the maximum depth of the tree), min_samples_split (the minimum number of samples required to split an internal node), and min_samples_leaf (the minimum number of samples required at a leaf node).
[0049] Parameter optimization using Optuna: Create an Optuna study object, specify the goal to minimize the Hamming loss, and then find the best parameter combination through more than 40 trials. Training and evaluation, use the best parameter combination found to initialize a new random forest classifier and wrap it in a multi-label machine learning model for training and prediction. Performance evaluation, calculate and output the Hamming loss, micro-average precision, recall, and F1 score of the model on the test set to evaluate the performance of the optimized model.
[0050] Optuna: is an automatic machine learning hyperparameter optimization framework that automates and optimizes the hyperparameter selection process of machine learning models. It was developed by Preferred Networks of Japan and is open source. Optuna provides a simple API that allows users to efficiently search the hyperparameter space and find the optimal hyperparameter configuration to improve the performance of the model.
[0051] This process shows how to improve the performance of multi-label classification models through automated parameter optimization techniques. The effectiveness and practicality of model optimization are ensured through carefully designed parameter search space and objective function, as well as comprehensive performance evaluation.
[0052] S1-4. Verify the model: Input new test data for prediction, and obtain the frequency of basic treatment nursing items for each patient in hospital every day (frequency is the number of times each inpatient performs each nursing item every day, for example, blood pressure measurement times = 2). Finally, the frequency is multiplied by the average nursing time of a single nursing item through the integration method to obtain the final result, and determine the basic nursing time for each patient every day (such as Figure 4 The average nursing time is the data manually measured by the nursing staff in the hospital in the early stage, and the average nursing time is obtained after the average value is processed.
[0053] Please refer to the attached Figure 1 , the application method of the prediction model includes the following steps:
[0054] S2-1. Input of basic patient treatment information: The user enters information such as age, gender, past medical history and main diagnosis into the system;
[0055] S2-2. The system processes information: The system automatically encodes the patient information entered and performs special encoding for specific types:
[0056] S2-3, automatic prediction by model: the system automatically inputs the coded patient information into the finalized prediction model for prediction;
[0057] S2-4. Output the frequency and duration of each nursing item for the patient's daily hospitalization.
[0058] Embodiment 2: This embodiment differs from Embodiment 1 in that:
[0059] In this embodiment, the multi-label machine learning model uses Binary Relevance, which decomposes the multi-label problem into multiple independent binary classification problems, and each label is predicted independently of other labels. Advantages: Simple implementation, each label can be trained independently, so it can be applied to any binary classification algorithm. In addition, it can be well extended to problems with a large number of labels and can be easily integrated into existing single-label classification systems.
[0060] The rest is the same as the first embodiment.
[0061] Embodiment 3: This embodiment differs from Embodiment 1 in that:
[0062] In this embodiment, the multi-label machine learning model uses Classifier Chain, which is a method for converting a multi-label classification problem into a chained single-label classification problem. Each classifier uses the output of the previous classifier as one of its features during training. Advantages: By considering the dependencies between labels, Classifier Chain can improve classification performance to a certain extent. It can capture the correlation between labels and pass this correlation when predicting.
[0063] The rest is the same as the first embodiment.
[0064] Embodiment 4: This embodiment differs from Embodiment 1 in that:
[0065] In this embodiment, the multi-label machine learning model uses Label Powerset, which transforms the multi-label problem into a multi-classification problem, in which each possible label combination becomes a new class. Advantages: This method considers all combinations of labels, so it can capture the complex relationship between labels. It performs better in cases where labels are highly dependent because it treats the entire label set as a whole.
[0066] The rest is the same as the first embodiment.
[0067] According to the concept of the present invention (such as Figure 5 As shown), the four multi-label models in Examples 1 to 4 were tested and evaluated, and the Hamming loss, micro-average precision, micro-average recall, and micro-average F1 score methods were used for evaluation. The results are shown in Figure 3 shown.
[0068] Among them, Hamming Loss: Hamming Loss measures the difference between the predicted label and the true label, that is, the proportion of wrong labels. Advantages: Hamming loss directly reflects the accuracy of label prediction. The lower the Hamming loss, the more accurate the model prediction. It is suitable for multi-label classification problems and can give an intuitive error rate measurement.
[0069] Micro Precision: Micro Precision is to calculate the precision after summarizing the results of all categories, that is, first calculate the total true positives, false positives, and false negatives, and then calculate the precision. Advantages: The micro-average method can balance the importance of each category, especially when the labels of the dataset are unevenly distributed, and can provide a fair performance evaluation. It is particularly suitable for situations where the sample size of some categories in the dataset is much larger than that of other categories.
[0070] Micro Recall: Similar to micro average precision, micro average recall also aggregates the true positives and false negatives of all categories and then calculates the recall. Advantages: Micro average recall can also provide a more fair and comprehensive performance evaluation in imbalanced datasets, ensuring that all categories are considered.
[0071] Micro F1-Score: Micro F1-Score is the harmonic average of precision and recall, combining the calculation methods of micro-average precision and micro-average recall. Advantages: F1-score can balance precision and recall, especially when you are not sure which one is more important, F1-score provides a comprehensive performance evaluation indicator. Micro-average F1-score is suitable for unbalanced data sets, ensuring fair evaluation of all categories.
[0072] Summary: These evaluation methods provide a comprehensive performance assessment for multi-label classification problems. By combining these different metrics, the performance of the model can be understood from multiple perspectives, including its ability to predict correct labels, avoid incorrect labels, and balance precision and recall. This helps developers identify the strengths and weaknesses of the model, allowing for more effective model selection and optimization.
[0073] Depend on Figure 3 ,The score comparison bar chart of the four models shows that each model can be used in this system, but the model with the best score is BinaryRelevance, because each of its evaluation indicators is higher than the other three models, so it is concluded that the most applicable model is BinaryRelevance.
[0074] The above is an exemplary description of the present invention in combination with the accompanying drawings. It is obvious that the specific implementation of the present invention is not limited to the above-mentioned method. As long as such non-substantial improvements are made by adopting the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.
Claims
1. A nursing man-hour prediction method based on multi-label learning, characterized by: Including methods for building prediction models and methods for applying prediction models; The prediction model building method comprises the following steps: S1-1. Obtain input information: collect the patient's basic information as feature data; collect nursing hours data as label data; S1-2, encode the input information: pre-process the feature data, including data cleaning, missing value processing and special feature classification processing; pre-process the label data, take the patient's daily nursing project data as labels, and then convert these data into binary and save the binary digits and maximum digits information; S1-3, training model: input the processed feature data and label data into the multi-label machine learning model for training and parameter optimization; S1-4, Verification model: Input new test data for prediction, and obtain the frequency of basic treatment nursing items for each patient in hospital every day. Finally, multiply the frequency by the average nursing time of a single nursing item through the integration method to obtain the basic nursing time and number of items for each patient every day. The application method of the prediction model comprises the following steps: S2-1. Input the patient's basic treatment information; S2-2, the system performs information processing; S2-3, automatic prediction by model: the system automatically inputs the coded patient information into the finalized prediction model for prediction; S2-4. Output the frequency and duration of each nursing item for the patient's daily hospitalization.
2. According to claim 1, a nursing man-hour prediction method based on multi-label learning is characterized in that: In step S1-1, the patient's basic information includes age, gender, smoking history, disease diagnosis and hospitalization days; the nursing time data includes the number of basic treatment items and the average duration.
3. According to claim 1, a nursing man-hour prediction method based on multi-label learning is characterized in that: In step S1-2, feature data preprocessing is specifically as follows: for each numerical feature, use its index to extract the corresponding column from the data set; use the method of converting text to numbers to convert the extracted text features into numerical types. If any error is encountered during the conversion process, the corresponding value is set to a null value, and the converted numerical features are converted to integer types; finally, the encoded features are stored in a dictionary, where the key is the feature name and the value is an array reshaped into a column vector to ensure compatibility with subsequent processing; for each special value feature, a statistical summary is performed based on the specific data, the main categories are classified separately, and the remaining minor categories are summarized as others.
4. According to claim 1, a nursing man-hour prediction method based on multi-label learning is characterized in that: In step S1-2, the preprocessing of the label data includes cleaning, missing value processing and binary conversion; Label data cleaning and missing value processing: First, create a structure for storing and processing data; then, through an automated conversion process, convert all non-numeric data items to numeric types, and data items that fail to be converted are marked as missing and uniformly replaced with zero values to ensure data integrity; finally, through a standardization step, all data items are converted to integer types to facilitate subsequent data processing and analysis.
5. According to claim 1, a nursing man-hour prediction method based on multi-label learning is characterized in that: In step S1-3, the multi-label machine learning model is any one of MLKNN, Binary Relevance, Classifier Chain, and LabelPowerset.
6. The method for predicting nursing man-hours based on multi-label learning according to claim 1 is characterized in that: In step S1-3, when optimizing parameters, the search space is defined. In the objective function, the parameter search space of the random forest classifier is defined, including the number of trees, the maximum depth, the minimum number of samples required for splitting, and the minimum number of samples for leaf nodes; Parameter optimization using Optuna: Create an Optuna study object, specify the objective to minimize the Hamming loss, and then find the best parameter combination; use the best parameter combination found to initialize a new random forest classifier and wrap it in a multi-label machine learning model for training and prediction.
7. The method for predicting nursing man-hours based on multi-label learning according to claim 1 is characterized in that: In step S1-4, the average nursing time is data manually measured by nursing staff in the hospital in the early stage, and the average nursing time is obtained after average value processing.
8. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program is configured to execute the nursing man-hour prediction method based on multi-label learning according to any one of claims 1 to 7 when running.