Pathogen data analysis method, device and equipment based on piecewise linear fitting and storage medium

By determining the optimal number of breakpoints in pathogen data analysis and using ABIC and R2 values ​​as evaluation indicators, a target fitting model is constructed, which solves the problem of inflexible breakpoint selection in existing technologies and achieves more efficient pathogen data analysis.

CN119495440BActive Publication Date: 2025-11-21GUANGZHOU KINGMED CENTER FOR CLINICAL LABORATORY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411494368.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-11-21
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

Existing piecewise linear fitting methods typically determine the number of breakpoints manually or by fixing a fixed number, which makes them difficult to apply to complex and diverse pathogen data. This can lead to overfitting or underfitting of the model, affecting the reliability of pathogen data analysis.

Method used

By acquiring pathogen data and preprocessing it, several candidate breakpoints are determined. The fitting model corresponding to each candidate breakpoint is evaluated using a preset combination information criterion or coefficient of determination. The optimal number of breakpoints is determined based on minimizing the ABIC value or maximizing the R2 value, and the target fitting model is constructed.

Benefits of technology

It improves the model's applicability and generalization ability to complex and diverse pathogen data, avoids the limitations of traditional breakpoint selection, enhances the model's accuracy and stability, and can better balance the model's complexity and fit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119495440B_ABST
    Figure CN119495440B_ABST
Patent Text Reader

Abstract

The application discloses a pathogen data analysis method and device based on piecewise linear fitting, equipment and a storage medium, relates to the technical field of data analysis, and comprises the following steps: acquiring pathogen data, preprocessing the pathogen data, and obtaining processed pathogen data; determining a number of candidate breakpoints, and fitting a model based on the number of candidate breakpoints; using a preset combination information criterion or a decision coefficient to evaluate the fitting model corresponding to each candidate breakpoint, and determining the optimal breakpoint number according to the minimum ABIC value or the maximum R 2 value; determining the fitting model corresponding to the optimal breakpoint number as the target fitting model, and obtaining a data analysis result based on the target fitting model. The application can effectively deal with complex and diverse pathogen data, avoid the limitations of breakpoint selection in the traditional mode, and thus improve the applicability and generalization ability of the fitting model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data analysis, and particularly relates to a pathogen data analysis method and device based on piecewise linear fitting, equipment and a storage medium. BACKGROUND

[0002] In epidemiological research, piecewise linear fitting can be applied to analyze the trend of respiratory pathogen infection rate in different age groups, and by identifying key age breakpoints, it helps better analyze and understand the transmission pattern of pathogens and high-risk age groups. Therefore, the key of piecewise linear fitting is the selection of breakpoints.

[0003] At present, most piecewise linear fitting methods usually determine the number of breakpoints based on artificial determination of breakpoints or use a fixed number of breakpoints to construct a piecewise fitting model, and then determine the target fitting model based on the Akaike information criterion (AIC) or the Bayesian information criterion (BIC). This subjective and fixed method lacks flexibility when facing complex and diverse pathogen data, and there are problems of overfitting or underfitting of the model, which leads to poor applicability of the model, and further affects the reliability of the pathogen data analysis results based on the model. SUMMARY

[0004] The main purpose of the present application is to provide a pathogen data analysis method and device based on piecewise linear fitting, equipment and a storage medium, which aims to solve the technical problem that the existing piecewise fitting method is usually based on artificial determination of breakpoints or uses a fixed number of breakpoints, which is difficult to apply to the analysis of complex and diverse pathogen data.

[0005] To achieve the above-mentioned purpose, the present application provides a pathogen data analysis method based on piecewise linear fitting, which comprises:

[0006] Obtaining pathogen data and preprocessing the pathogen data to obtain processed pathogen data;

[0007] Determining a plurality of candidate breakpoint numbers, and fitting a model based on each candidate breakpoint number for the processed pathogen data;

[0008] Using a preset combination information criterion or a coefficient of determination to evaluate the fitting model corresponding to each candidate breakpoint number, and determining the optimal breakpoint number according to the minimum ABIC value or the maximum R 2 value;

[0009] Determining the fitting model corresponding to the optimal breakpoint number as the target fitting model, and obtaining a data analysis result based on the target fitting model.

[0010] In an embodiment, the step of determining a plurality of candidate breakpoint numbers and fitting the processed pathogen data with a model based on each of the candidate breakpoint numbers comprises:

[0011] obtaining a preset candidate breakpoint number range, determining a plurality of candidate breakpoint numbers based on the preset candidate breakpoint number range, and the preset candidate breakpoint number range being obtained by a user based on a task requirement in advance;

[0012] fitting the processed pathogen data with a model according to each of the candidate breakpoint numbers by using an R language segmented package, and obtaining a fitting model corresponding to each of the candidate breakpoint numbers.

[0013] In an embodiment, the step of fitting the processed pathogen data with a model according to each of the candidate breakpoint numbers by using a preset combination information criterion or a decision coefficient, and determining an optimal breakpoint number according to a minimum ABIC value or a maximum R 2 value;

[0014] calculating an ABIC value of the fitting model corresponding to each of the candidate breakpoint numbers based on a preset combination information criterion, wherein the preset combination information criterion is a weighted combination of AIC and BIC;

[0015] calculating an R 2 value of the fitting model corresponding to each of the candidate breakpoint numbers based on a decision coefficient;

[0016] determining the candidate breakpoint number of the fitting model with a minimum ABIC value as the optimal breakpoint number;

[0017] or, determining the candidate breakpoint number of the fitting model with a maximum R 2 value as the optimal breakpoint number.

[0018] In an embodiment, the step of determining the candidate breakpoint number of the fitting model with a maximum R 2 value as the optimal breakpoint number comprises:

[0019] selecting, from the fitting models corresponding to each of the candidate breakpoint numbers, a fitting model with a maximum R 2 value under a preset growth threshold condition, and determining the corresponding candidate breakpoint number as the optimal breakpoint number, wherein the preset growth threshold condition is expressed as (1+r), and r is a growth coefficient;

[0020] The calculation formula of the R 2 value is:

[0021]

[0022] In the formula, y i is an observation value, The predicted value is y i The average of the observed values is y

[0023] In an embodiment, the ABIC value is calculated according to the following formula:

[0024] ABIC = a * AIC + (1-a) * BIC

[0025] wherein a is a weight parameter, AIC is an AIC value of a fitting model corresponding to each candidate breakpoint number calculated based on AIC, and BIC is a BIC value of the fitting model corresponding to each candidate breakpoint number calculated based on BIC.

[0026] In an embodiment, the step of determining the fitting model corresponding to the optimal breakpoint number as a target fitting model and obtaining a data analysis result based on the target fitting model comprises:

[0027] determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, wherein the target fitting model is represented by a plurality of linear equations;

[0028] generating a visual representation of the target fitting model according to the pathogen data and the linear equations using a plotting function of R language.

[0029] In an embodiment, the step of obtaining pathogen data and pre-processing the pathogen data to obtain processed pathogen data comprises:

[0030] collecting original pathogen data and constructing data sets corresponding to different age stages based on the original pathogen data;

[0031] performing data sorting and data cleaning on the pathogen data in each data set to obtain processed pathogen data.

[0032] In addition, to achieve the above object, the present application further provides a pathogen data analysis device based on segmented linear fitting, which comprises:

[0033] a data preprocessing module configured to obtain pathogen data and pre-process the pathogen data to obtain processed pathogen data;

[0034] a breakpoint selection module configured to determine a plurality of candidate breakpoint numbers and perform model fitting on the processed pathogen data based on each candidate breakpoint number; perform model evaluation on the fitting model corresponding to each candidate breakpoint number using a preset combination information criterion or a determination coefficient, and determine an optimal breakpoint number according to a minimum ABIC value or a maximum R 2 value;

[0035] An output module configured to determine the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtain a data analysis result based on the target fitting model.

[0036] In addition, to achieve the above object, the present application further provides a pathogen data analysis device based on piecewise linear fitting, which comprises a memory, a processor, and a pathogen data analysis program based on piecewise linear fitting stored in the memory and executable on the processor, and the pathogen data analysis program based on piecewise linear fitting is configured to implement the steps of the pathogen data analysis method based on piecewise linear fitting as described above.

[0037] In addition, to achieve the above object, the present application further provides a storage medium, which stores a pathogen data analysis program based on piecewise linear fitting, and the pathogen data analysis program based on piecewise linear fitting implements the steps of the pathogen data analysis method based on piecewise linear fitting as described above when executed by a processor.

[0038] The present application discloses a pathogen data analysis method based on piecewise linear fitting, which comprises the following steps: obtaining pathogen data, and preprocessing the pathogen data to obtain processed pathogen data; determining a plurality of candidate breakpoint numbers, and performing model fitting on the processed pathogen data based on each candidate breakpoint number; performing model evaluation on the fitting model corresponding to each candidate breakpoint number by using a preset combination information criterion or a coefficient of determination, and determining an optimal breakpoint number according to a minimum ABIC value or a maximum R 2 value; determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtaining a data analysis result based on the target fitting model. Since the optimal breakpoint number is determined from a plurality of candidate breakpoint numbers, the present application can effectively deal with complex and diverse pathogen data, avoiding the limitations of breakpoint selection in traditional methods, thereby improving the applicability and generalization ability of the model to different types of data. Specifically, the ABIC value or the R 2 value is used as the basis for selecting the optimal breakpoint number, which improves the accuracy and rationality of breakpoint selection compared with the traditional single standard optimization method, and can better balance the complexity and fitting degree of the model. BRIEF DESCRIPTION OF DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, those skilled in the art can obtain other drawings according to these drawings without any creative effort.

[0041] Figure 1 Flowchart of a first embodiment of a pathogen data analysis method based on piecewise linear fitting according to the present application;

[0042] Figure 2 Flowchart of a second embodiment of a pathogen data analysis method based on piecewise linear fitting according to the present application;

[0043] Figure 3 Flowchart of a third embodiment of a pathogen data analysis method based on piecewise linear fitting according to the present application;

[0044] Figure 4 Flowchart of a pathogen data analysis method based on piecewise linear fitting according to the present application;

[0045] Figure 5 Relationship diagram of piecewise linear fitting based on the relationship between the infection rate of Streptococcus pneumoniae BA0008 and the age of a patient;

[0046] Figure 6 Structural block diagram of a first embodiment of a pathogen data analysis device based on piecewise linear fitting according to the present application;

[0047] Figure 7 Structural diagram of a pathogen data analysis device based on piecewise linear fitting according to the present application.

[0048] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.

[0050] In order to better understand the technical solutions of the present application, the following will be described in detail with reference to the drawings of the specification and specific embodiments.

[0051] The embodiments of the present application provide a pathogen data analysis method based on piecewise linear fitting, which is described with reference to Figure 1 , Figure 1 Flowchart of a first embodiment of a pathogen data analysis method based on piecewise linear fitting according to the present application, in the embodiment, the method comprises steps S10-S40:

[0052] Step S10: Obtain pathogen data, and pre-process the pathogen data to obtain processed pathogen data.

[0053] It should be noted that the present embodiment can be applied in the scenario of data analysis of pathogen data, and can also be applied in other scenarios where segmented linear fitting is required for data analysis of large data sets. The execution subject of the method of the present embodiment can be a computing electronic device having functions of data processing, network communication, and program running, such as a mobile phone, a tablet, a computer, or a data analysis server, or other data analysis devices capable of achieving the same or similar functions. Here, the pathogen data analysis device based on segmented linear fitting (hereinafter referred to as "analysis device") can be taken as an example to explain and describe the embodiments of the present application.

[0054] It can be understood that the pathogen data can be multi-pathogen infection rate data, for example, when the current task requirement is to analyze the change trend of respiratory pathogen infection rate of different age groups, the pathogen data can be data including patient age, pathogen number, and corresponding infection rate, which can reflect the change of infection rate of multiple pathogens with age.

[0055] In order to facilitate analysis, the collected original pathogen data can be pre-processed to facilitate subsequent model fitting. Therefore, step S10 specifically includes steps S101-S102:

[0056] Step S101: Collect original pathogen data, and construct data sets corresponding to different age stages based on the original pathogen data.

[0057] It should be understood that first, different age stages can be set, for example, the age stages can be set as 0-2, 2-4, 4-6,..., 98-100, and then the original pathogen data is grouped according to the corresponding patient age and based on the above set age stages, thereby obtaining data sets corresponding to different age stages.

[0058] It should be noted that since each original pathogen data can correspond to a pathogen number, the data can be further classified and arranged according to the pathogen number in each data set.

[0059] Step S102: Data sorting and data cleaning are performed on the pathogen data in each data set to obtain processed pathogen data.

[0060] It can be understood that after the data is sorted, the pathogen data in each data set can be sorted and cleaned. Through data sorting, it can be ensured that the subsequent fitting model can accurately capture the specific changes of each age stage, and through data cleaning, the integrity and data quality of the data can be ensured, providing a solid data foundation for subsequent model fitting.

[0061] Specifically, first, the pathogen data in each data set can be sorted according to the size of the patient's age, ensuring that the pathogen data is sorted in ascending order of age. Then the data can be cleaned, including handling missing values and outliers. Regarding the handling of missing values: missing values can be deleted or filled with reasonable substitute values such as mean, median, etc.; regarding outliers, it can be determined according to the specific situation whether to be proposed, in order to avoid the adverse effects of the outliers on the subsequent fitting results.

[0062] Step S20: Determine the number of candidate breakpoints, and perform model fitting on the processed pathogen data based on the number of candidate breakpoints.

[0063] It should be understood that the number of candidate breakpoints can be a breakpoint number predefined by the user based on historical experience. Specifically, first, a preset candidate breakpoint number range can be obtained, and then a number of candidate breakpoints can be determined based on the preset candidate breakpoint number range. The preset candidate breakpoint number range can be pre-configured by the user based on task requirements and historical experience, for example, it can be configured as 1 to 4, that is, the number of breakpoints can be determined as 1, 2, 3, and 4.

[0064] It can be understood that based on each candidate breakpoint number, a segmented linear model can be used for model fitting of the corresponding candidate breakpoint number. In order to construct a segmented linear fitting model, R language tools can be used. R language is a widely used language and environment for statistical analysis and graphical representation, especially suitable for data analysis, statistical learning and graphical representation.

[0065] The package (Packages) in R language is a mechanism to extend the function of R, which contains a series of functions, datasets and documents, so that users can perform more complex data processing and analysis. In this embodiment, the segmented package in R language can be used to perform model fitting, which allows users to specify independent variables and dependent variables and automatically adjust the position of the breakpoint to optimize the model.

[0066] In a specific implementation, the processed pathogen data can be used as the original dataset required by the segmented package in R language, and the data can be iteratively fitted through the functions in the package, and then the best breakpoint position under different breakpoint numbers can be determined through the segmented package, that is, the fitting model corresponding to each candidate breakpoint number is obtained.

[0067] Step S30: performing model evaluation on the fitting model corresponding to each of the candidate breakpoint numbers by using a preset combination information criterion or a determination coefficient, and determining the optimal breakpoint number according to a minimum ABIC value or a maximum R 2 value.

[0068] It should be understood that the AIC can select the optimal model by maximizing the likelihood function of the model while penalizing the number of parameters in the model, and a smaller AIC value usually indicates that the model has achieved a good balance between fitting data and maintaining simplicity; the BIC value is similar to the AIC value, which is more sensitive to the number of parameters as the sample size increases, and the BIC is based on Bayesian theory, which also tends to select a simpler model when the sample size is large, and the ABIC value can be a weighted combination of the AIC value and the BIC value.

[0069] It can be understood that the determination coefficient (R 2 ) is a statistical indicator for measuring the degree of explanation of the model to the variability of the data, which is usually between 0 and 1. The greater the R 2 value, the stronger the ability of the model to explain the data.

[0070] In a specific implementation, the candidate breakpoint number corresponding to the fitting model with the minimum ABIC value or the maximum R 2 value can be selected as the optimal breakpoint number.

[0071] Step S40: determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtaining a data analysis result based on the target fitting model.

[0072] It should be understood that the target fitting model can be the fitting model with the minimum ABIC value or the maximum R 2 value, and the fitting model can be regarded as an accurate infection rate change model, so that the user can better interpret the original pathogen data based on the infection rate change model, thereby meeting different epidemiological research and analysis needs.

[0073] In this embodiment, by determining the optimal breakpoint number from a plurality of candidate breakpoint numbers, the complex and diverse pathogen data can be effectively dealt with, and the limitations of breakpoint selection in the traditional method are avoided, thereby improving the applicability and generalization ability of the model to different types of data. And by introducing the parallel computing technology of R language, the computing efficiency is significantly improved, so that the method can quickly converge to the optimal solution in large-scale data processing or multi-pathogen analysis, reduces the dependence of the model on the initial conditions, enhances the stability and repeatability of the model, and is more conducive to meeting the real-time analysis needs in epidemiological research.

[0074] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as the above-mentioned embodiment one can refer to the above introduction, and the subsequent will not be described in detail. On this basis, please refer to Figure 2 , Figure 2 The flowchart of the second embodiment of the pathogen data analysis method based on piecewise linear fitting of the present application is shown.

[0075] In this embodiment, considering that when performing model evaluation, it is often difficult to achieve the best balance between model complexity and goodness of fit when using AIC and BIC criteria alone when dealing with high noise or unbalanced sample data, resulting in overfitting or underfitting problems, step S30, specifically comprising steps S301-S304:

[0076] Step S301: calculating the ABIC value of the fitting model corresponding to each candidate breakpoint number based on the preset combination information criterion, wherein the preset combination information criterion is a weighted combination of AIC and BIC.

[0077] It should be understood that the preset combination information criterion in this embodiment can be referred to as ABIC, which is a weighted combination of AIC and BIC, used to consider the complexity and goodness of fit of the model at the same time, and the calculation formula of the ABIC value is:

[0078] ABIC = α × AIC + (1-α) × BIC

[0079] In the formula, α is a weight parameter, usually taking a value of 0.5, AIC is the AIC value of the fitting model corresponding to each candidate breakpoint number calculated based on AIC, and BIC is the BIC value of the fitting model corresponding to each candidate breakpoint number calculated based on BIC.

[0080] The calculation formulas of AIC value and BIC value are respectively:

[0081] AIC = 2k-2ln(L)

[0082] BIC = kln(n)-2ln(L)

[0083] In the formula, k is the number of parameters of the fitting model, L is the maximum likelihood function value of the fitting model, and n is the sample size.

[0084] Step S302: calculating the R 2 value of the fitting model corresponding to each candidate breakpoint number based on the coefficient of determination;

[0085] It should be understood that ABIC comprehensively considers the goodness of fit and complexity of the model, which can effectively prevent overfitting, and further considers the explanatory power of the model to the data when evaluating the model, and the coefficient of determination (R2 )。R 2 The calculation formula of R

[0086]

[0087] In the formula, y i is an observation value, is a predicted value, and y i is an average of observation values. R 2 The closer the value is to 1, the stronger the model's ability to explain the data.

[0088] Step S303: The candidate breakpoint number of the fitting model with the minimum ABIC value is determined as the optimal breakpoint number.

[0089] Step S304: The candidate breakpoint number of the fitting model with the maximum R 2 value is determined as the optimal breakpoint number.

[0090] It should be understood that the candidate breakpoint number of the fitting model with the maximum R 2 value under the condition of meeting the preset growth threshold (1+r) can be selected, where r is a growth coefficient, and the corresponding candidate breakpoint number is determined as the optimal breakpoint number.

[0091] In a specific implementation, the coefficient of determination strategy is to compare the R 2 values of the fitting models with different breakpoint numbers, and select the model with the maximum R 2 value under the condition of meeting the growth threshold (1+r), to determine the optimal breakpoint number.

[0092] Therefore, by comparing the ABIC values and R 2 values of the fitting models under each candidate breakpoint number, the candidate breakpoint number with the minimum ABIC value or the maximum R value and the corresponding breakpoint position can be determined, and the candidate breakpoint number and the optimal breakpoint position are determined as the optimal breakpoint number and the optimal breakpoint position.

[0093] In this embodiment, the ABIC values of the fitting models corresponding to each candidate breakpoint number are calculated based on the preset combined information criterion, where the preset combined information criterion is a weighted combination of AIC and BIC; the R 2 values of the fitting models corresponding to each candidate breakpoint number are calculated based on the coefficient of determination; and the candidate breakpoint number of the fitting model with the minimum ABIC value or the maximum R 2 value is determined as the optimal breakpoint number. Since the ABIC value and the R 2The value is taken as an evaluation index for breakpoint selection, and an iterative search mechanism is combined to automatically optimize the number and position of breakpoints to ensure that an ideal fitting effect is obtained under different data environments. Compared with the traditional single standard optimization method, the multi-index joint optimization strategy in this embodiment significantly improves the accuracy and rationality of breakpoint selection, and can better balance the complexity and fitting degree of the model.

[0094] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as the above embodiments one and two can be referred to the above introduction, and the following will not be repeated. On this basis, please refer to Figure 3 , Figure 3 The flowchart of the third embodiment of the pathogen data analysis method based on piecewise linear fitting of the present application.

[0095] In this embodiment, considering that the visualization means in the existing method is relatively simple, lacking in-depth analysis and intuitive display of the fitting result, step S40 specifically includes steps S401-S402:

[0096] Step S401: determining the fitting model corresponding to the optimal number of breakpoints as a target fitting model, the target fitting model being represented as a plurality of linear equations.

[0097] It should be noted that the target fitting model can be represented in the following form:

[0098]

[0099] In the formula, Y i represents the infection rate of the i-th sample, X i represents the age of the i-th patient, a k and β k are the intercept and slope of the k-th segment, respectively, ∈ i is an error term. τ1, τ2, τ m-1 are the estimated values of the segmentation points (breakpoints), and m is the optimal number of breakpoints.

[0100] It should be understood that the above model describes the linear regression relationship in different age groups (separated by breakpoints τ), and each segment corresponds to a linear equation. Through this segmented form, the infection rate of respiratory pathogens in different age groups can be more accurately fitted. Through this model, the global trend of the data can be captured, and the variation characteristics between different age groups can also be described in detail.

[0101] Step S402: generating a visual representation of the target fitting model according to the pathogen data and each linear equation using the plotting function of R language.

[0102] It should be understood that after the fitting is completed, the fitting results can be visualized to help the user to understand and interpret the model results more deeply. Since the target fitting model is fitted by the function in the segmented package in R language, the visualization of the target fitting model can also be generated by the drawing function in R language, such as the ggplot2 package.

[0103] Specifically, the line chart of the infection rate versus the patient age can be drawn by the ggplot2 package in R language, and the position of each breakpoint is marked in the line chart to clearly show the linear trend of each segment. Through the visualization diagram, the user can better understand the fitting effect of the model, and provide intuitive basis for analyzing the transmission mode of the disease involved in the pathogen data.

[0104] In this embodiment, the computing efficiency is significantly improved when processing large-scale, multi-pathogen data, and the results of the segmented linear fitting are clearly displayed through rich visualization tools. Compared with the traditional way, this embodiment provides more intuitive charts for interpreting the results based on the target fitting model, helping the user to quickly identify the infection rate trend of the key age group, and supporting more accurate epidemiological learning analysis and decision-making.

[0105] In addition, reference can be made to Figure 4 The effect of the pathogen data analysis method based on segmented linear fitting of the present application is illustrated with specific experimental data. Figure 4 The full process schematic diagram of the pathogen data analysis method based on segmented linear fitting of the present application.

[0106] In Figure 4 , the pathogen data analysis method based on segmented linear fitting of the present application can be divided into three stages: S1 data preparation and preprocessing, S2 preliminary model establishment and optimization, and S3 final model fitting and visualization.

[0107] S1 data preparation and preprocessing:

[0108] (a) Input data set

[0109] In this experiment, the patient infection data recorded by a hospital in a certain area within 15 months is obtained and a data set is constructed, in which the age interval is 0-104 years old, for example, there are 112 patients at the age of 1, and the number of pathogen species is 48. The data set includes patient age, pathogen number, number of infected patients, and corresponding pathogen infection rate (percentage) and other pathogen data. These data cover a variety of respiratory pathogens, such as influenza virus, respiratory syncytial virus and coronavirus, forming a comprehensive, multi-dimensional data set for subsequent segmented linear fitting.

[0110] (b) Data cleaning and classification

[0111] After importing the data, it is cleaned to ensure its quality. The cleaning process includes handling missing values and outliers to ensure the completeness and accuracy of the data. Next, the data is sorted by pathogen number and ordered by patient age. Through these preprocessing steps, a foundation is laid for subsequent segmented linear regression analysis, ensuring that the analysis accurately reflects the infection rate changes in different age groups.

[0112] S2 Model Preliminary Establishment and Optimization:

[0113] (a) Candidate breakpoint range setting

[0114] After data preprocessing is complete, the preset candidate breakpoint number range can be obtained. For example, the pathogen number is "BA0008", which corresponds to the pathogen Streptococcus pneumoniae, and the breakpoint number (nψ) is set to an integer between 1 and 4. The segmented package in R language is used to fit the model for each candidate breakpoint number. The segmented package can optimize the segmented linear model by automatically adjusting the position of the breakpoint, thereby finding the optimal breakpoint configuration (breakpoint number and breakpoint position).

[0115] (b) Optimal breakpoint selection

[0116] To determine the optimal breakpoint number and position, the model evaluation indicators for each candidate breakpoint number can be calculated, including ABIC (a combination of AIC and BIC) and R 2 (squared coefficient of determination). By comparing the ABIC values and R 2 values under each breakpoint configuration, the breakpoint configuration that minimizes the ABIC value or maximizes the R2 value is selected. In this experiment, the ABIC value is used to balance the complexity and fitting degree of the model to the explanatory power of the data.

[0117] The calculation results show that selecting 4 breakpoints can minimize the ABIC value (R 2 indicator is not used), indicating that the model under this configuration has achieved the best balance between complexity and fitting degree. Therefore, it can be determined that 4 breakpoints are the optimal breakpoint number.

[0118] S3 Final Model Fitting and Visualization:

[0119] (a) Final model fitting

[0120] After determining the optimal breakpoint number, these breakpoints are used for the final segmented linear regression fitting. The final target fitting model is one that accurately reflects the changes in pathogen infection rates in different age groups. Through this target fitting model, key age groups can be more accurately identified, and users can gain a deeper understanding of the changes in pathogen infection rates in these age groups.

[0121] (b) result visualization

[0122] To make the analysis results more intuitive, detailed visualization charts can be generated in combination with the fitting results of the target fitting model. Here, refer to Figure 5 for a detailed introduction to the visualization chart, Figure 5 is a segmented linear fitting relationship chart based on the relationship between the S. pneumoniae BA0008 infection rate and the patient's age.

[0123] In Figure 5 , the horizontal axis is the patient's age (Age), and the vertical axis is the S. pneumoniae BA0008 infection rate (BA0008_infection_Rates). The straight line represents the linear fitting line of each age group, the point represents the actual infection rate data point, and the dotted line is the optimal breakpoint position. There are four breakpoints (Breakpoints) in the figure, which are 5.15, 15.22, 69.87, and 97.85.

[0124] The graphical display shows that the model has good fitting effect in each segment, and the infection rate trend of each age group is accurately described. Through this visualization chart, the user can clearly identify the high-risk age group, thereby better guiding the formulation and implementation of public health strategies.

[0125] It should be noted that the above example is only for understanding the present application and does not constitute a limitation on the pathogen data analysis method based on segmented linear fitting of the present application. More forms of simple transformation based on this technical concept are within the protection scope of the present application.

[0126] The present application also provides a pathogen data analysis device based on segmented linear fitting, please refer to Figure 6 , Figure 6 is a module structure diagram of the first embodiment of the pathogen data analysis device based on segmented linear fitting of the present application. The device comprises:

[0127] The data preprocessing module 601 is configured to obtain pathogen data and preprocess the pathogen data to obtain processed pathogen data.

[0128] The breakpoint selection module 602 is configured to determine a number of candidate breakpoints, and perform model fitting on the processed pathogen data based on each candidate breakpoint. A preset combination information criterion or a decision coefficient is used to evaluate the fitting model corresponding to each candidate breakpoint, and the optimal breakpoint number is determined according to the minimum ABIC value or the maximum R 2 value.

[0129] The result output module 603 is configured to determine the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtain a data analysis result based on the target fitting model.

[0130] Further, the breakpoint selection module 602 is further configured to obtain a preset candidate breakpoint number range, determine a plurality of candidate breakpoint numbers based on the preset candidate breakpoint number range, and obtain the preset candidate breakpoint number range based on a task demand preconfigured by a user; perform model fitting on the processed pathogen data according to each candidate breakpoint number by using an R language segmented package to obtain a fitting model corresponding to each candidate breakpoint number.

[0131] Further, the breakpoint selection module 602 is further configured to calculate an ABIC value of the fitting model corresponding to each candidate breakpoint number based on a preset combination information criterion, wherein the preset combination information criterion is a weighted combination of AIC and BIC; calculate a R 2 value of the fitting model corresponding to each candidate breakpoint number based on a coefficient of determination; and determine the candidate breakpoint number of the fitting model with the minimum ABIC value or the maximum R 2 value as the optimal breakpoint number.

[0132] The calculation formula of the ABIC value is as follows:

[0133] ABIC = α × AIC + (1-α) × BIC

[0134] In the formula, α is a weight parameter, AIC is an AIC value of the fitting model corresponding to each candidate breakpoint number calculated based on AIC, and BIC is a BIC value of the fitting model corresponding to each candidate breakpoint number calculated based on BIC.

[0135] Further, the breakpoint selection module 602 is further configured to select, from the fitting models corresponding to the candidate breakpoint numbers, a fitting model with the maximum R 2 value under a preset growth threshold condition, and determine the corresponding candidate breakpoint number as the optimal breakpoint number, wherein the preset growth threshold condition is represented as (1+r), and r is a growth coefficient.

[0136] The calculation formula of the R 2 value is as follows:

[0137]

[0138] In the formula, y i is an observation value, is a prediction value, and y i is an average of observation values.

[0139] Further, the result output module 603 is further configured to determine the fitting model corresponding to the optimal breakpoint number as a target fitting model, the target fitting model is represented as a plurality of linear equations; and generate a visual representation of the target fitting model according to the pathogen data and the linear equations by using a drawing function of R language.

[0140] Further, the data preprocessing module 601 is further configured to collect original pathogen data, and construct data sets corresponding to different age stages based on the original pathogen data; and perform data sorting and data cleaning on the pathogen data in each data set to obtain processed pathogen data.

[0141] By determining the optimal breakpoint number from a plurality of candidate breakpoint numbers, the embodiment can effectively deal with complex and diverse pathogen data, avoid the limitations of breakpoint selection in the traditional way, and thus improve the applicability and generalization ability of the model to different types of data. Specifically, the preset Akaike information criterion ABIC value and the coefficient of determination R 2 value are used as the selection basis for the optimal breakpoint number, which improves the accuracy and rationality of breakpoint selection compared with the traditional single standard optimization method, and can better balance the complexity and fitting degree of the model.

[0142] Other embodiments or specific implementation manners of the pathogen data analysis device based on segmented linear fitting described in the present application can refer to the above-mentioned method embodiments, which will not be described here again.

[0143] The present application also provides a pathogen data analysis device based on segmented linear fitting, which comprises at least one processor and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the pathogen data analysis method based on segmented linear fitting in the above-mentioned embodiment one.

[0144] Reference will be made to the accompanying drawings Figure 7 , Figure 7 for the structural schematic diagram of the pathogen data analysis device based on segmented linear fitting of the present application. The pathogen data analysis device based on segmented linear fitting in the embodiment of the present application can include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players) and the like, and fixed terminals such as digital TVs, desktop computers and the like.Figure 7 The illustrated pathogen data analysis device based on piecewise linear fitting is merely an example and should not bring any limitation to the function and scope of use of the embodiments of the present application.

[0145] As Figure 7 shown, the pathogen data analysis device based on piecewise linear fitting can include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or loaded from a storage device 1003 into a random access memory (RAM) 1004. In the RAM 1004, various programs and data required for operation of the pathogen data analysis device based on piecewise linear fitting are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. In general, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the pathogen data analysis device based on piecewise linear fitting to communicate wirelessly or by wire with other devices to exchange data. Although the pathogen data analysis device based on piecewise linear fitting with various systems is illustrated in the figure, it should be understood that all of the illustrated systems are not required to be implemented or provided. More or less systems can be alternatively implemented or provided.

[0146] The present application also provides a computer-readable storage medium having stored thereon computer-readable program instructions (i.e., computer programs) for performing the pathogen data analysis method based on piecewise linear fitting in the above-described embodiments.

[0147] The computer readable storage medium provided by the present application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), etc., or any suitable combination thereof.

[0148] The above only describes some embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation made by using the contents of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.

Claims

1. A method for pathogen data analysis based on piecewise linear fitting, characterized in that, The method comprises: acquiring pathogen data, and preprocessing the pathogen data to obtain processed pathogen data, the processed pathogen data being sequence data reflecting the change of pathogen infection rate with age, comprising patient age, pathogen number and corresponding infection rate; determining a plurality of candidate breakpoint numbers, and fitting a model to the processed pathogen data based on each of the candidate breakpoint numbers; The fitting models corresponding to the candidate breakpoint numbers are evaluated by using preset Akaike information criterion (ABIC) or coefficient of determination (R 2 value to determine the optimal breakpoint number. determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtaining a data analysis result based on the target fitting model; wherein the step of determining a plurality of candidate breakpoint numbers and fitting a model to the processed pathogen data based on each of the candidate breakpoint numbers comprises: acquiring a preset candidate breakpoint number range, determining a plurality of candidate breakpoint numbers based on the preset candidate breakpoint number range, the preset candidate breakpoint number range being obtained by a user based on task requirements in advance; fitting a model to the processed pathogen data according to each of the candidate breakpoint numbers using the R language segmented package to obtain a fitting model corresponding to each of the candidate breakpoint numbers.

2. The method of claim 1, wherein, The model evaluation is performed on the fitting model corresponding to each candidate breakpoint number by using preset combination information criterion or decision coefficient, and the optimal breakpoint number is determined according to the minimum ABIC value or the maximum R 2 value determination step, comprising: calculating the ABIC value of the fitting model corresponding to each of the candidate breakpoint numbers based on a preset combination information criterion, wherein the preset combination information criterion is a weighted combination of AIC and BIC; calculating an R value of the fitting model corresponding to each of the candidate breakpoint numbers based on the coefficient of determination 2 value; determining the candidate breakpoint number of the fitting model with the smallest ABIC value as the optimal breakpoint number; or, R 2 The candidate breakpoint number of the fitting model with the maximum value is determined as the optimal breakpoint number.

3. The method of claim 2, wherein, The R 2 The step of determining the number of candidate breakpoints of the fitting model with the maximum value as the optimal number of breakpoints comprises: Among the fitting models corresponding to each number of candidate breakpoints, R is selected under the condition of satisfying the preset growth threshold. 2 The fitted model with the largest value is selected, and the number of corresponding candidate breakpoints is determined as the optimal number of breakpoints. The preset growth threshold condition is expressed as (1+r), where r is the growth coefficient. The R 2 The formula for calculating the value is: where y i is the observed value, is the predicted value, y i is the mean of the observed values, and n is the sample size.

4. The method of claim 2, wherein, the calculation formula of the ABIC value is: ABIC = α × AIC + (1-α) × BIC wherein, α is a weight parameter, AIC is the AIC value of the fitting model corresponding to each of the candidate breakpoint numbers calculated based on AIC, and BIC is the BIC value of the fitting model corresponding to each of the candidate breakpoint numbers calculated based on BIC.

5. The method of claim 1, wherein, The step of determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtaining a data analysis result based on the target fitting model comprises: determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, the target fitting model being represented as a plurality of linear equations; generating a visual representation of the target fitting model according to the pathogen data and each of the linear equations using the drawing function of the R language.

6. The method of claim 1, wherein, The step of acquiring pathogen data and preprocessing the pathogen data to obtain processed pathogen data comprises: collecting original pathogen data and constructing data sets corresponding to different age stages based on the original pathogen data; sorting and cleaning the pathogen data in each of the data sets to obtain processed pathogen data.

7. An apparatus for pathogen data analysis based on piecewise linear fitting, characterized by, The device comprises: a data preprocessing module for acquiring pathogen data and preprocessing the pathogen data to obtain processed pathogen data, the processed pathogen data being sequence data reflecting the change of pathogen infection rate with age, comprising patient age, pathogen number and corresponding infection rate; The breakpoint selection module is configured to determine a number of candidate breakpoints, and perform model fitting on the processed pathogen data based on each of the number of candidate breakpoints; perform model evaluation on the fitting model corresponding to each of the number of candidate breakpoints by using a preset Akaike information criterion (ABIC) or a coefficient of determination (R2); and determine an optimal number of breakpoints according to a minimum ABIC value or a maximum R2 value 2 . a result output module for determining the fitting model corresponding to the optimal breakpoint number as a target fitting model, and obtaining a data analysis result based on the target fitting model; The breakpoint selection module is further configured to obtain a preset candidate breakpoint number range, determine a plurality of candidate breakpoint numbers based on the preset candidate breakpoint number range, and obtain a fitting model corresponding to each candidate breakpoint number by using an R language segmented package to perform model fitting on the processed pathogen data according to each candidate breakpoint number.

8. A piecewise linear fitting based pathogen data analysis device, characterized by, The device comprises a memory, a processor, and a segmented linear fitting-based pathogen data analysis program stored on the memory and executable on the processor, and the segmented linear fitting-based pathogen data analysis program is configured to implement the steps of the segmented linear fitting-based pathogen data analysis method according to any one of claims 1 to 6.

9. A storage medium, characterized by The storage medium stores a segmented linear fitting-based pathogen data analysis program, and the segmented linear fitting-based pathogen data analysis program, when executed by a processor, implements the steps of the segmented linear fitting-based pathogen data analysis method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for predicting epidemic situation data in a segmented mode, medium and electronic equipment

    CN111489830A

  • Piecewise linearization of multivariable data

    US11645359B1