Medical institution drug demand prediction method based on multi-source information, terminal and medium
Through crawling technology, a drug demand forecasting model based on XGBoost has been constructed, which solves the problems of few research on drug demand forecasting in medical institutions in the existing technology, and realizes accurate prediction of drug demand demand of medical institutions, and improves the efficiency of drug inventory management and supply chain optimization.
Patent Information
- Application Number
- CN202411672433.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-25
AI Technical Summary
There are few researches on drug demand forecasts in medical institutions in the prior art, and there are certain limitations, making it difficult to accurately predict drug demands in medical institutions.
Crawling technology is used to obtain characteristic data of medical institutions, analyze the correlation between these data and annual drug sales, build a drug demand forecast model based on XGBoost, and perform feature engineering and parameter tuning.
By deeply analyzing the relationship between the characteristics of medical institutions and drug demand, the predictive model constructed can accurately predict the drug demand of medical institutions, improving the efficiency of drug inventory management and supply chain optimization.
Smart Images

Figure CN119887270A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pharmaceutical logistics big data processing, and in particular to a method, terminal and medium for predicting drug demand of medical institutions based on multi-source information. Background Art
[0002] Medical institutions are the most critical sales terminals in the pharmaceutical market and the key places where patients receive medical services. Their number is increasing year by year as the pharmaceutical market expands. Drug demand forecasting is a quantitative estimate of future demand for each drug sales terminal, which is crucial for pharmaceutical companies to make efficient, safe and reliable production planning and logistics scheduling decisions. Therefore, accurate demand forecasting for medical institutions can provide reliable data support for pharmaceutical companies, help them optimize resource allocation and improve industry efficiency.
[0003] The construction scale, specialty category and other information of medical institutions can directly reflect their operating conditions and service capabilities, and are an important basis for predicting their drug demand. In the context of the big data era, many data collection websites have collected data on the scale and specialty category of various medical institutions, but these data are often scattered and heterogeneous, and manual collection is not only inefficient but also prone to errors. In addition, there is little research on the prediction of drug demand in medical institutions in the existing technology, and there are certain limitations. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method for predicting drug demand of medical institutions based on multi-source information in view of the above-mentioned defects of the prior art. The technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present invention provides a method for predicting drug demand of medical institutions based on multi-source information, wherein the method comprises:
[0006] Using crawler technology to obtain medical institution characteristic data, analyzing the correlation between the medical institution characteristic data and the annual sales volume of drugs, and obtaining high-correlation features, wherein the medical institution characteristic data includes numerical characteristic data and categorical characteristic data;
[0007] Based on the highly correlated features, a drug demand prediction model based on XGBoost is constructed, feature engineering is performed on the highly correlated features, and parameters of the drug demand prediction model are tuned;
[0008] Obtain the average annual drug demand of medical institutions, and based on the drug demand forecasting model after parameter tuning, output the drug demand forecast results of medical institutions under different classification conditions.
[0009] In one implementation, crawler technology is used to obtain characteristic data of medical institutions, including:
[0010] Build a crawler program using the Python language requests library and BeautifulSoup library;
[0011] And crawler technology is used to crawl the characteristic data of the medical institution from a preset data collection website.
[0012] In one implementation, the correlation between the medical institution characteristic data and the annual sales volume of drugs is analyzed to obtain highly correlated features, including:
[0013] For the numerical feature data, the Spearman correlation coefficient is used to analyze the first correlation coefficient between the numerical feature data and the annual sales volume of the drug, and based on the first correlation coefficient, the features with high correlation with the annual sales volume of the drug in the numerical feature data are screened out;
[0014] For the categorical feature data, the Kruskal-Wails H test is used to verify its relationship with the drug sales volume, and the second correlation coefficient is obtained. Based on the second correlation coefficient, the features in the categorical feature data that have a high correlation with the annual drug sales volume are screened out.
[0015] In one implementation, before analyzing the correlation between the medical institution characteristic data and the annual sales volume of drugs to obtain the highly correlated features, the method further includes:
[0016] The characteristic data of the medical institutions are screened to remove medical institutions with missing characteristics.
[0017] In one implementation, analyzing the correlation between the medical institution characteristic data and the annual sales volume of drugs to obtain high-correlation features further includes:
[0018] For the numerical feature data, the Spearman correlation coefficient between them is calculated to verify whether there is multicollinearity;
[0019] If multicollinearity exists, principal component analysis is used to perform dimensionality reduction processing on the numerical feature data to obtain key principal components, and the key principal components are used as substitute values for the numerical feature data.
[0020] In one implementation, feature engineering is performed on the highly correlated features, including:
[0021] Performing maximum and minimum normalization processing on the numerical feature data in the highly correlated features;
[0022] The categorical feature data in the highly correlated features are subjected to one-hot encoding processing, and each categorical value is converted into a binary vector.
[0023] In one implementation, the parameter tuning of the drug demand prediction model includes:
[0024] Determine the tuning parameters and their value ranges, and initialize the particle values;
[0025] For each particle, use its parameter combination to train the drug demand prediction model and calculate the fitness function value;
[0026] Update the particle's speed and position based on the particle's historical optimal position and global optimal position;
[0027] The iterative process stops when the predetermined number of iterations or a certain termination condition is reached.
[0028] In a second aspect, an embodiment of the present invention provides a medical institution drug demand prediction system based on multi-source information, wherein the system comprises:
[0029] A correlation analysis module, used to obtain medical institution characteristic data by using crawler technology, analyze the correlation between the medical institution characteristic data and the annual sales volume of drugs, and obtain highly correlated features, wherein the medical institution characteristic data includes numerical characteristic data and categorical characteristic data;
[0030] A model building and parameter tuning module, which is used to build a drug demand prediction model based on XGBoost based on highly correlated features, perform feature engineering on the highly correlated features, and perform parameter tuning on the drug demand prediction model;
[0031] The drug demand forecasting module is used to obtain the average annual drug demand of medical institutions, and based on the drug demand forecasting model after parameter optimization, output the drug demand forecast results of medical institutions under different classification conditions.
[0032] In the third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory, a processor, and a medical institution drug demand prediction program based on multi-source information stored in the memory and executable on the processor, and when the processor executes the medical institution drug demand prediction program based on multi-source information, the steps of the medical institution drug demand prediction method based on multi-source information of any one of the above-mentioned schemes are implemented.
[0033] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein a medical institution drug demand prediction program based on multi-source information is stored on the computer-readable storage medium, and when the medical institution drug demand prediction program based on multi-source information is executed by a processor, the steps of the medical institution drug demand prediction method based on multi-source information described in any one of the above-mentioned schemes are implemented.
[0034] Beneficial effects: Compared with the prior art, the present invention provides a method for predicting drug demand in medical institutions based on multi-source information. The present invention first uses crawler technology to obtain medical institution feature data, analyzes the correlation between the medical institution feature data and the annual sales volume of drugs, and obtains high-correlation features, wherein the medical institution feature data includes numerical feature data and category feature data. Then, based on the high-correlation features, a drug demand prediction model based on XGBoost is constructed, feature engineering is performed on the high-correlation features, and parameter tuning is performed on the drug demand prediction model. Finally, the average annual drug demand of the medical institution is obtained, and based on the drug demand prediction model after parameter tuning, the drug demand prediction results of the medical institution under different classification conditions are output. Aiming at the problem of drug demand prediction in medical institutions, the present invention deeply analyzes the connection between medical institution characteristics and drug demand, and constructs a drug demand prediction model based on the XGBoost algorithm. This method provides strong support for drug inventory management, supply chain optimization, etc. of medical institutions, and has broad application prospects and practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flowchart of a preferred embodiment of a method for predicting drug demand of a medical institution based on multi-source information provided by an embodiment of the present invention.
[0036] Figure 2 It is a schematic diagram of particle swarm optimization iteration in one implementation of the present invention.
[0037] Figure 3 It is a schematic diagram comparing the prediction results of six feature input combinations after parameter adjustment in one implementation of the present invention.
[0038] Figure 4 It is a schematic diagram comparing the prediction accuracy of sales intervals in each year in one implementation of the present invention.
[0039] Figure 5 It is a schematic diagram comparing the prediction accuracy of medical institutions at different levels in one implementation of the present invention.
[0040] Figure 6 It is a schematic diagram comparing the prediction accuracy of medical institutions of various specialty categories in one implementation of the present invention.
[0041] Figure 7 It is a schematic diagram of the architecture of a medical institution drug demand forecasting system based on multi-source information provided by an embodiment of the present invention.
[0042] Figure 8 It is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0044] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations or steps, nor must they be executed in the order described. For example, some operations or steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0045] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0046] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first control information and the second control information are only used to distinguish different control information, and their order is not limited.
[0047] Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit the differences.
[0048] It should be further understood that the term “and / or” used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0049] The current research in the field of demand forecasting has made remarkable achievements. However, there are few studies on drug demand forecasting in medical institutions, and there are certain limitations. The research mainly focuses on medical institutions with rich historical sales data, and the influencing factors are the external characteristic information such as the promotion policy and geographical location of the medical institutions. However, the inherent characteristic attributes of the medical institutions themselves, such as the medical scale and specialty category, as important reference factors for patients to choose medical institutions, also have an important impact on drug demand. Therefore, by deeply analyzing its impact mechanism on drug demand, the accuracy and practicality of drug sales forecasting can be improved, thereby improving the industry benefits of pharmaceutical logistics.
[0050] In view of the problems of the prior art, this embodiment provides a method for predicting the demand for medicines in medical institutions based on multi-source information. In view of the problem of predicting the demand for medicines in medical institutions, the relationship between the characteristics of medical institutions and the demand for medicines is deeply analyzed, and a drug demand prediction model based on the XGBoost algorithm is constructed. This method provides strong support for the inventory management of medicines in medical institutions, supply chain optimization, etc., and has broad application prospects and practical value. In specific applications, this embodiment first uses crawler technology to obtain the characteristic data of medical institutions, analyzes the correlation between the characteristic data of the medical institutions and the annual sales volume of medicines, and obtains high-correlation features, wherein the characteristic data of medical institutions include numerical feature data and category feature data. Then, based on the features of high correlation, a drug demand prediction model based on XGBoost is constructed, the features of the high correlation are subjected to feature engineering construction, and the parameters of the drug demand prediction model are optimized. Finally, the average annual drug demand of the medical institution is obtained, and based on the drug demand prediction model after parameter tuning, the drug demand prediction results of the medical institution under different classification conditions are output.
[0051] The method for predicting drug demand in medical institutions based on multi-source information in this embodiment can be applied to a terminal, which can be a computer, a mobile phone, a smart TV or other intelligent product terminal. Figure 1 As shown in , the method for predicting drug demand of medical institutions based on multi-source information in this embodiment includes the following steps:
[0052] Step S100: Acquire medical institution characteristic data using crawler technology, analyze the correlation between the medical institution characteristic data and the annual sales volume of drugs, and obtain highly correlated features, wherein the medical institution characteristic data includes numerical characteristic data and categorical characteristic data.
[0053] Specifically, in this embodiment, a crawler program can be constructed by using the python language requests library and the BeautifulSoup library; and the crawler technology is used to crawl the medical institution characteristic data from a preset data collection website. The crawled medical institution characteristic data includes numerical characteristic data (such as the number of beds, building area, number of employees, number of senior professional titles, number of departments, and the number of years from establishment to this year) and category characteristic data (such as medical grade, specialty category).
[0054] After obtaining the medical institution characteristic data, this embodiment further analyzes the correlation between the medical institution characteristic data and the annual sales volume of drugs to obtain high correlation features. In practical application, this embodiment first preprocesses the acquired medical institution characteristic data to obtain preprocessed data, specifically screening the medical institution characteristic data to remove medical institutions with missing features. Next, this embodiment uses the Spearman correlation coefficient to analyze the first correlation coefficient between the numerical characteristic data and the annual sales volume of drugs, and based on the first correlation coefficient, screens out the features with high correlation with the annual sales volume of drugs in the numerical characteristic data. This embodiment can set a correlation threshold, for example, if the correlation threshold is 0.6, the numerical characteristic data with a first correlation coefficient greater than 0.6 can be screened out to obtain high correlation features, and specifically five features with high correlation with drug sales can be screened out. For the category characteristic data, this embodiment uses the Kruskal-Wails H test to verify its relationship with drug sales, obtains the second correlation coefficient, and based on the second correlation coefficient, screens out two features with high correlation with the annual sales volume of drugs in the category characteristic data. For example, the correlation threshold is set to 0.01, so that the calculated second correlation coefficient is < 0.01, and features with high correlation with drug sales are extracted.
[0055] In this embodiment, after selecting the characteristics of Mr. Wu with high correlation to the annual sales volume of drugs from the numerical feature data, these five characteristics may have multicollinearity. Multicollinearity refers to the situation where there is a high linear correlation between two or more feature variables in the regression model. This phenomenon poses a potential threat to the stability, explanatory power and prediction accuracy of the model. Since the numerical feature data has a clear numerical measurement, when they are input into the model, they will increase the redundant information of the model, resulting in reduced explanatory power and significantly reduced prediction accuracy. For this reason, this embodiment
[0056] For the numerical feature data, the Spearman correlation coefficients between them are calculated to verify whether there is multicollinearity. If there is multicollinearity, the principal component analysis method is used to reduce the dimension of the numerical feature data to obtain the key principal component, which can be the first component above a threshold (such as 0.8). The key principal component can be used as a substitute value for the numerical feature data.
[0057] Step S200: Based on the highly correlated features, a drug demand prediction model based on XGBoost is constructed, feature engineering is performed on the highly correlated features, and parameters of the drug demand prediction model are tuned.
[0058] The problem solved by the method for predicting drug demand in medical institutions in this embodiment has the following characteristics and requirements: (1) The stability of the prediction results is high: reliable and stable prediction results are needed to help the pharmaceutical industry formulate production and scheduling strategies. (2) The data set is high in dimension: it contains seven factors with high correlation with drug demand, and the model input set dimension is seven dimensions. (3) The data set contains categorical features: it contains two categorical features, namely grade and specialty category. According to the above requirements, this embodiment selects XGBoost as the model for drug demand prediction. The advantage of XGBoost is that it can effectively prevent overfitting and improve the stability of the prediction results. Secondly, XGBoost performs well in processing high-dimensional data sets. It can automatically select and optimize feature combinations through internal algorithms to improve the accuracy of prediction and output feature importance. In addition, XGBoost's adaptive processing of multi-category features does not require cumbersome feature engineering construction, which greatly simplifies the data preprocessing process. Finally, XGBoost can enable the model to obtain accurate results in a relatively short time through block storage and parallel computing. Therefore, XGBoost is finally selected as the model for predicting drug demand in medical institutions.
[0059] Based on this, after acquiring the highly correlated features, this embodiment constructs a drug demand prediction model based on XGBoost based on the highly correlated features. Next, feature engineering is performed on the highly correlated features. Specifically, this embodiment can perform maximum and minimum normalization processing on the numerical feature data in the highly correlated features to linearly transform the original data into the [0,1] interval. The maximum and minimum normalization processing on the numerical feature data is expressed as the following formula:
[0060]
[0061] Among them, x maxmin is the normalized eigenvalue, x is the original eigenvalue, and x max and x min They are respectively the maximum and minimum values of the numerical feature data in the data set.
[0062] Perform unique hot encoding on the categorical feature data in the highly correlated features, converting each category value into a binary vector. The length of this vector is equal to the number of categories. In this vector, the position corresponding to a specific category will be set to 1, and all other positions will be set to 0.
[0063] Furthermore, this embodiment uses a particle swarm algorithm to perform parameter tuning on the drug demand prediction model, specifically including: determining the parameter tuning parameters and value ranges, and initializing the particle values; for each particle, using its parameter combination to train the drug demand prediction model, and calculating the fitness function value; updating the particle's speed and position according to the particle's historical optimal position and global optimal position; iterative processing until a predetermined number of iterations or a certain termination condition is reached. This embodiment can improve the prediction accuracy of the model, reduce overfitting, and optimize computational efficiency by reasonably adjusting the model parameters.
[0064] Step S300: Obtain the average annual drug demand of medical institutions, and output the drug demand forecast results of medical institutions under different classification conditions based on the drug demand forecast model after parameter optimization.
[0065] This embodiment summarizes the average annual drug demand of medical institutions, analyzes it based on the drug demand forecasting model after parameter tuning, and outputs the drug demand forecasting results of medical institutions under different classifications. For example, medical institutions are classified by medical grade, and drug demand forecasting results of medical institutions of different medical grades are output; medical institutions are classified by specialty category, and drug demand forecasting results of medical institutions of different specialty categories are output.
[0066] The present embodiment is described below by using specific application examples:
[0067] The drug demand forecasting model built based on S300 was used to conduct instance verification using seven medical characteristic data (number of beds, building area, number of employees, number of senior professional titles, number of departments, grades, and specialty categories) of 10,103 medical institutions in Group G from January 1, 2019 to December 31, 2021, and the average annual demand for drugs over three years. In order to effectively evaluate the prediction performance of the model, 80% of the data set (a total of 8,801 medical institutions) was randomly selected as the training set, and the remaining 20% of the data set (a total of 2,200 medical institutions) was used as the test set.
[0068] The evaluation indicator selected is MAPE, which can measure the percentage of error to the true value. This value is the basis for calculating the prediction accuracy. Subtracting the MAPE value from 100% is the prediction accuracy. The smaller the value, the higher the prediction accuracy. The formula is as follows:
[0069]
[0070] Prediction accuracy = 100% - MAPE
[0071] In the above evaluation index formula, y i represents the predicted value, represents the true value, and N represents the number of calculated samples.
[0072] The principal component pca_1 with the highest explained variance ratio obtained after principal component analysis was used as the input of the model, and the two categorical features of grade and specialty category were used to tune the main parameters of the drug demand forecasting model using the particle swarm algorithm. The performance of the drug demand forecasting model was significantly improved after tuning. Specifically, using the initial parameter settings of the model commonly used by demand forecasting scholars, the prediction accuracy of the drug demand forecasting model was 89.16%, and the training time was 0.31s. After using PSO to adjust the parameters, the prediction accuracy of the model was increased to 92.76%, an increase of 3.6%. The training time was reduced to 0.06s, a decrease of 80.65%. The particle swarm tuning iteration diagram is shown below. Figure 2 shown.
[0073] In order to verify the effectiveness of pca_1 combined with two categorical feature data as model input in predicting drug demand in medical institutions, the remaining four principal components (pca_2, pca_3, pca_4, pca_5) obtained after principal component analysis were selected and combined with the two categorical feature data respectively. At the same time, the original five numerical feature drug demand prediction models were combined with two categorical feature drug demand prediction models. A total of six sets of feature combinations were constructed as model inputs. By comparing the performance of the six sets of feature inputs in the final prediction accuracy, the best feature combination was selected. The experimental results show that when the original five numerical features are combined with two categorical features as input, although the model training time is the longest, reaching 0.31s, the prediction accuracy is the best, which is 94.06%. The comparison of the prediction results of the six feature input combinations after parameter adjustment is shown in the figure below. Figure 3 shown.
[0074] In order to systematically evaluate the prediction performance of the prediction model under different conditions, the applicability of the model was analyzed from three dimensions: annual demand, specialty category, and level. First, the drug demand prediction model was used to predict the accuracy of drug demand in medical institutions with different annual demand scales. The results showed that the model has good applicability and stability in predicting the annual drug demand of medical institutions with a demand scale of 10,000-100,000, and the prediction accuracy is over 95%. Among them, the annual demand range with the highest prediction accuracy is 90,000-100,000, with an accuracy of 97.02%. The prediction accuracy of each annual sales range is as follows: Figure 4 As shown. Secondly, the drug demand forecasting model shows good applicability in predicting the annual drug demand of medical institutions of different levels. Among them, the medical institution with the highest prediction accuracy is Grade 3B, with an accuracy of 96.52%. The medical institution with the lowest prediction accuracy is Grade 2C, with an accuracy of 94.38%. The prediction accuracy of medical institutions of different levels is shown as follows: Figure 5As shown. Finally, the prediction accuracy of the model when predicting hospitals of different specialty categories shows certain differences. Among them, the individual prediction accuracy of three types of specialized hospitals is higher than that of all hospitals. The highest is comprehensive hospitals, with an accuracy of 96.23%. This may be because comprehensive hospitals cover a wider range of disease types and patient groups, and the change pattern of drug demand between comprehensive hospitals of similar size is relatively close. Therefore, the drug demand prediction model is easier to grasp the changes in their demand. The individual prediction accuracy of the other six types of hospitals is lower than that of all hospitals. The lowest is cancer hospitals, with an accuracy of 85.58%. This is because the more specialized the hospital, the more its drug demand is affected by the specific disease type and patient demand. As a result, even if the scale is similar, there will be significant differences in drug demand. This difference increases the difference between the model's predicted value and the true value, thereby affecting the prediction accuracy. The prediction accuracy of medical institutions of each specialty category is shown as follows. Figure 6 shown.
[0075] This embodiment achieves the following technical effects through the above technical solution:
[0076] This embodiment provides a method for predicting drug demand in medical institutions based on multi-source information, which has the advantages of being lightweight, fast and efficient. By simply providing the relevant characteristic data of each medical institution, drug demand prediction can be completed in less than 1 second, and the prediction accuracy exceeds 90% in many cases. This makes the model very practical in practical applications.
[0077] Based on the above embodiments, the present invention also provides a medical institution drug demand forecasting system based on multi-source information, such as Figure 7 As shown, the medical institution drug demand prediction system based on multi-source information of this embodiment includes: a correlation analysis module, a model construction and parameter tuning module 20 and a drug demand prediction module 30. Specifically, the correlation analysis module 10 is used to obtain medical institution characteristic data using crawler technology, analyze the correlation between the medical institution characteristic data and the annual sales volume of drugs, and obtain high-correlation features, wherein the medical institution characteristic data includes numerical feature data and categorical feature data. The model construction and parameter tuning module 20 is used to construct an XGBoost-based drug demand prediction model based on high-correlation features, perform feature process construction on the high-correlation features, and perform parameter tuning on the drug demand prediction model. The drug demand prediction module 30 is used to obtain the average annual drug demand of medical institutions, and based on the drug demand prediction model after parameter tuning, output the drug demand prediction results of medical institutions under different classification conditions.
[0078] The working principles of each module in the medical institution drug demand prediction system based on multi-source information in this embodiment are the same as the principles of each step in the above method embodiment, and will not be repeated here.
[0079] Each module in the above-mentioned medical institution drug demand forecasting system based on multi-source information can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the terminal in the form of hardware, or can be stored in the memory in the terminal in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0080] Based on the above embodiment, the present invention further provides a terminal, the principle block diagram of the terminal can be as follows: Figure 8 The terminal may include one or more processors 100 ( Figure 8 Only one is shown in the figure), a memory 101 and a computer program 102 stored in the memory 101 and executable on one or more processors 100, for example, a sleep analysis program based on multi-sensor data. When one or more processors 100 execute the computer program 102, the various steps in the embodiment of the sleep analysis method based on multi-sensor data can be implemented. Alternatively, when one or more processors 100 execute the computer program 102, the functions of various modules / units in the embodiment of the sleep analysis system based on multi-sensor data can be implemented, which is not limited here.
[0081] In one embodiment, the processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0082] In one embodiment, the memory 101 may be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 101 may also include both an internal storage unit of the electronic device and an external storage device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
[0083] Those skilled in the art will understand that Figure 8 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0084] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, operating database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double operational data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting drug demand in medical institutions based on multi-source information, characterized in that: The method comprises: Using crawler technology to obtain medical institution characteristic data, analyzing the correlation between the medical institution characteristic data and the annual sales volume of drugs, and obtaining high-correlation features, wherein the medical institution characteristic data includes numerical characteristic data and categorical characteristic data; Based on the highly correlated features, a drug demand prediction model based on XGBoost is constructed, feature engineering is performed on the highly correlated features, and parameters of the drug demand prediction model are tuned; Obtain the average annual drug demand of medical institutions, and based on the drug demand forecasting model after parameter tuning, output the drug demand forecast results of medical institutions under different classification conditions.
2. The method for predicting drug demand of medical institutions based on multi-source information according to claim 1, characterized in that: Use crawler technology to obtain characteristic data of medical institutions, including: Build a crawler program using the Python language requests library and BeautifulSoup library; And crawler technology is used to crawl the characteristic data of the medical institution from a preset data collection website.
3. The method for predicting drug demand of medical institutions based on multi-source information according to claim 1, characterized in that: The correlation between the medical institution characteristic data and the annual sales volume of drugs is analyzed to obtain highly correlated features, including: For the numerical feature data, the Spearman correlation coefficient is used to analyze the first correlation coefficient between the numerical feature data and the annual sales volume of the drug, and based on the first correlation coefficient, the features with high correlation with the annual sales volume of the drug in the numerical feature data are screened out; For the categorical feature data, the Kruskal-Wails H test is used to verify its relationship with the drug sales volume, and the second correlation coefficient is obtained. Based on the second correlation coefficient, the features in the categorical feature data that have a high correlation with the annual drug sales volume are screened out.
4. The method for predicting drug demand of medical institutions based on multi-source information according to claim 3 is characterized in that: Before analyzing the correlation between the medical institution characteristic data and the annual sales volume of drugs to obtain the highly correlated features, the following steps are also included: The characteristic data of the medical institutions are screened to remove medical institutions with missing characteristics.
5. The method for predicting drug demand of medical institutions based on multi-source information according to claim 3 is characterized in that: Analyze the correlation between the medical institution characteristic data and the annual sales volume of drugs to obtain high correlation features, and also include: For the numerical feature data, the Spearman correlation coefficient between them is calculated to verify whether there is multicollinearity; If multicollinearity exists, principal component analysis is used to perform dimensionality reduction processing on the numerical feature data to obtain key principal components, and the key principal components are used as substitute values for the numerical feature data.
6. The method for predicting drug demand of medical institutions based on multi-source information according to claim 1, characterized in that: Performing feature engineering construction on the highly correlated features includes: Performing maximum and minimum normalization processing on the numerical feature data in the highly correlated features; The categorical feature data in the highly correlated features are subjected to one-hot encoding processing, and each categorical value is converted into a binary vector.
7. The method for predicting drug demand of medical institutions based on multi-source information according to claim 1, characterized in that: Parameter tuning of the drug demand prediction model includes: Determine the tuning parameters and their value ranges, and initialize the particle values; For each particle, use its parameter combination to train the drug demand prediction model and calculate the fitness function value; Update the particle's speed and position based on the particle's historical optimal position and global optimal position; The iterative process stops when the predetermined number of iterations or a certain termination condition is reached.
8. A medical institution drug demand forecasting system based on multi-source information, characterized in that: The system comprises: A correlation analysis module, used to obtain medical institution characteristic data by using crawler technology, analyze the correlation between the medical institution characteristic data and the annual sales volume of drugs, and obtain highly correlated features, wherein the medical institution characteristic data includes numerical characteristic data and categorical characteristic data; A model building and parameter tuning module, which is used to build a drug demand prediction model based on XGBoost based on highly correlated features, perform feature engineering on the highly correlated features, and perform parameter tuning on the drug demand prediction model; The drug demand forecasting module is used to obtain the average annual drug demand of medical institutions, and based on the drug demand forecasting model after parameter optimization, output the drug demand forecast results of medical institutions under different classification conditions.
9. A terminal, characterized in that: The terminal includes a memory, a processor, and a medical institution drug demand prediction program based on multi-source information stored in the memory and executable on the processor. When the processor executes the medical institution drug demand prediction program based on multi-source information, the steps of the medical institution drug demand prediction method based on multi-source information as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a medical institution drug demand prediction program based on multi-source information. When the medical institution drug demand prediction program based on multi-source information is executed by the processor, the steps of the medical institution drug demand prediction method based on multi-source information as described in any one of claims 1-7 are implemented.