A method and system for polynomial regression analysis of discrete data

By employing multinomial regression analysis, the problems of low efficiency and insufficient accuracy in discrete data processing in industrial equipment data analysis are solved. High-precision nonlinear fitting is achieved, improving the accuracy and efficiency of data analysis. This method is applicable to industrial control systems and data analysis software.

CN122087253APending Publication Date: 2026-05-26SD STEEL RIZHAO CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SD STEEL RIZHAO CO LTD
Filing Date
2025-12-24
Publication Date
2026-05-26

Smart Images

  • Figure CN122087253A_ABST
    Figure CN122087253A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of numerical analysis technology, specifically relating to a method and system for polynomial regression analysis of discrete data. The method includes the following steps: Step S1, data loading and matrix construction; Step S2, polynomial feature expansion; Step S3, order and coefficient initialization; Step S4, matrix solving; Step S5, residual evaluation and order optimization; Step S6, optimal model determination. This technical solution overcomes the shortcomings of existing technologies in terms of efficiency, accuracy, and intelligence by combining the nonlinear fitting capability of polynomials, the optimal solution of matrix solving, and RSS-driven adaptive model selection. It provides an efficient, high-precision, and adaptive discrete data analysis solution, which is of great significance for promoting the discrete data analysis and intelligent upgrading of industrial equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of numerical analysis technology, specifically relating to a method and system for polynomial regression analysis of discrete data. Background Technology

[0002] Currently, in the field of industrial equipment data analysis, the processing of discrete data generally relies on manual analysis or simple numerical statistical methods, resulting in low analysis efficiency and insufficient accuracy. In some industrial scenarios, discrete data is displayed linearly, with each pair of data points directly connected by a straight line. While this improves display speed, it fails to accurately and continuously reflect the inherent patterns and trends in equipment operation. This is especially true under conditions of complex data fluctuations and significant nonlinear characteristics, where such methods struggle to achieve high-precision fitting, thus affecting the accurate judgment and optimized control of equipment status, processes, and production quality. Therefore, achieving high-precision, adaptive curve fitting of discrete data while ensuring computational efficiency has become a pressing technical problem in industrial data analysis.

[0003] In view of this, it is very necessary to provide a method and system for polynomial regression analysis of discrete data in this invention to solve the above-mentioned defects in the prior art. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of the existing technology by providing a method and system for designing a multinomial regression analysis for discrete data, thereby solving the aforementioned technical problems.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for polynomial regression analysis of discrete data includes the following steps: Step S1, the data loading and matrix construction step, in which: Read discrete data samples to construct a feature data matrix X and actual result label data y; Step S2, the polynomial feature expansion step, in which: The feature data matrix X is expanded exponentially to generate a polynomial feature matrix. ; Step S3, the initialization of order and coefficients, in which: Set the highest order n of the polynomial regression and initialize the coefficient vector θ; Step S4, the matrix solution step, in which: The optimal coefficient vector θ is solved using the matrix method; Step S5, the residual evaluation and order optimization step, in which: Calculate the RSS (Residual Sum of Squares) value and optimize the RSS value by adjusting the highest order n of the polynomial; Step S6, the step of determining the optimal model, in which: Select the polynomial order n and the corresponding coefficient vector θ that minimize the RSS value to generate the final polynomial fitting function F(x).

[0006] Preferably, step S1 specifically includes: Discrete data is read into a matrix, which is divided into feature data matrix X and actual result label data y; feature data matrix X is an n×p matrix, where n is the number of samples, p is the number of features, and includes an intercept term column vector; feature data matrix X is a first power matrix.

[0007] This step can achieve the following technical effects: Ensuring model completeness: Introducing the intercept term enables the multinomial regression model to fit data that does not pass through the origin, improving the model's generality and fitting ability; Unifying data structure: Clearly defining the matrix dimensions (n ​​is the number of samples, p is the number of features) provides a precise data structure foundation for all subsequent matrix operations (such as transpose, inversion, and multiplication), avoiding algorithmic errors caused by dimension mismatch, and enhancing the robustness and feasibility of the method.

[0008] Preferably, step S2 specifically includes: The first-order characteristic data matrix X is transformed into a multinomial characteristic matrix through power expansion. Where the 1 inside the parentheses is a vector. The polynomial function F(x) to be fitted is in the form of:

[0009] This step can achieve the following technical effects: Achieving nonlinear mapping: Through power expansion, the original one-dimensional discrete data x is mapped to a high-dimensional feature space (x, x², …), enabling the linear regression model to fit complex nonlinear relationships. The computation process is simple, providing a more accurate foundation for the analysis of discrete data. Establishing clear mathematical objectives: The form of the function to be fitted is clearly given, transforming the engineering problem into a clear mathematical optimization problem (solving coefficients). … n This makes the solution process reliable and the results interpretable.

[0010] Preferably, step S3 specifically includes: Set the highest order n of the polynomial to be regressed according to the specific application scenario, and set the coefficient vector θ to be calculated based on the highest order. .

[0011] This step can achieve the following technical effects: It provides flexibility and controllability: allows users to preset the highest order n based on prior knowledge or computational resources, achieving a balance between fitting accuracy (higher order) and model simplicity (lower order); it defines the optimization variable: the coefficient vector θ is defined as the target variable to be optimized, providing a clear optimization object for the method of this invention.

[0012] Preferably, step S4 specifically includes: The optimal parameter θ is solved using the matrix method, and the expression is:

[0013] Among them, X Let X be the transpose of the feature data matrix. Then, the predicted label value can be calculated from the coefficient vector θ and the feature data: .

[0014] This step can achieve the following technical effects: Guaranteeing the global optimal solution: The matrix solution method can provide a mathematically unique and globally optimal parameter estimate for the linear model, ensuring the theoretical optimality of the fit; High computational efficiency: Compared with iterative algorithms such as gradient descent, when the data scale (n and p) is moderate, there is no need to set the number of iterations and convergence steps, and it can be solved directly in one go, which improves the operation speed, reduces the computational complexity, and can meet the real-time requirements of industry.

[0015] Preferably, step S5 specifically includes: Using the residual sum of squares (RSS) as the loss function, the RSS value is calculated as follows:

[0016] The steps of solving for the optimal parameter θ and calculating the RSS value are repeated to obtain RSS values ​​of multiple different orders. Error analysis is performed on these RSS values, and the polynomial order with the smallest RSS value is selected.

[0017] This step can achieve the following technical effects: Provides quantitative evaluation criteria: RSS provides an objective and calculable numerical indicator for model fitting, transforming the comparison of models of different orders from subjective judgment to objective data comparison; Enables automated model selection: Through the steps of "trying different orders, calculating RSS, and selecting the minimum RSS", the optimal order of the polynomial is automatically and data-driven, avoiding manual trial and error and improving analysis efficiency and accuracy; Balances fitting and overfitting: Prefers to select the order with the minimum but not too high RSS, ensuring fitting accuracy while suppressing overfitting caused by excessively high orders, thus improving the model's generalization ability.

[0018] Furthermore, the present invention also provides a multinomial regression analysis system for discrete data, comprising: The data loading and matrix construction module contains: Read discrete data samples to construct a feature data matrix X and actual result label data y; The polynomial feature extension module contains: The feature data matrix X is expanded exponentially to generate a polynomial feature matrix. ; The order and coefficient initialization module contains: Set the highest order n of the polynomial regression and initialize the coefficient vector θ; The matrix solving module contains: The optimal coefficient vector θ is solved using the matrix method; The residual evaluation and order optimization module contains: Calculate the RSS (Residual Sum of Squares) value and optimize the RSS value by adjusting the highest order n of the polynomial; The optimal model determination module contains: Select the polynomial order n and the corresponding coefficient vector θ that minimize the RSS value to generate the final polynomial fitting function F(x).

[0019] Preferably, the data loading and matrix construction module specifically includes: Discrete data is read into a matrix, which is divided into feature data matrix X and actual result label data y; feature data matrix X is an n×p matrix, where n is the number of samples, p is the number of features, and includes an intercept term column vector; feature data matrix X is a first power matrix.

[0020] This module can achieve the following technical effects: Ensuring model completeness: Introducing the intercept term enables the multinomial regression model to fit data that does not pass through the origin, improving the model's generality and fitting ability; Unifying data structure: Clearly defining the matrix dimensions (n ​​is the number of samples, p is the number of features) provides a precise data structure foundation for all subsequent matrix operations (such as transpose, inversion, and multiplication), avoiding algorithmic errors caused by dimension mismatch, and enhancing the robustness and feasibility of the method.

[0021] Preferably, the polynomial feature extension module specifically includes: The first-order characteristic data matrix X is transformed into a multinomial characteristic matrix through power expansion. Where the 1 inside the parentheses is a vector. The polynomial function F(x) to be fitted is in the form of:

[0022] This module can achieve the following technical effects: Achieving nonlinear mapping: Through power expansion, the original one-dimensional discrete data x is mapped to a high-dimensional feature space (x, x², …), enabling the linear regression model to fit complex nonlinear relationships. The computation process is simple, providing a more accurate foundation for the analysis of discrete data. Establishing clear mathematical objectives: The form of the function to be fitted is clearly given, transforming the engineering problem into a clear mathematical optimization problem (solving coefficients). … n This makes the solution process reliable and the results interpretable.

[0023] Preferably, the order and coefficient initialization module specifically includes: Set the highest order n of the polynomial to be regressed according to the specific application scenario, and set the coefficient vector θ to be calculated based on the highest order. .

[0024] This module can achieve the following technical effects: It provides flexibility and controllability: allows users to preset the highest order n based on prior knowledge or computational resources, achieving a balance between fitting accuracy (higher order) and model simplicity (lower order); it defines the optimization variable: the coefficient vector θ is defined as the target variable to be optimized, providing a clear optimization object for the method of this invention.

[0025] Preferably, the matrix solving module specifically includes: The optimal parameter θ is solved using the matrix method, and the expression is:

[0026] Among them, X Let X be the transpose of the feature data matrix. Then, the predicted label value can be calculated from the coefficient vector θ and the feature data: .

[0027] This module can achieve the following technical effects: Guaranteeing the global optimal solution: The matrix solution method can provide a mathematically unique and globally optimal parameter estimate for the linear model, ensuring the theoretical optimality of the fit; High computational efficiency: Compared with iterative algorithms such as gradient descent, when the data scale (n and p) is moderate, there is no need to set the number of iterations and convergence steps, and it can be solved directly in one go, which improves the operation speed, reduces the computational complexity, and can meet the real-time requirements of industry.

[0028] Preferably, the residual evaluation and order optimization module specifically includes: Using the residual sum of squares (RSS) as the loss function, the RSS value is calculated as follows:

[0029] The steps of solving for the optimal parameter θ and calculating the RSS value are repeated to obtain RSS values ​​of multiple different orders. Error analysis is performed on these RSS values, and the polynomial order with the smallest RSS value is selected.

[0030] This module can achieve the following technical effects: Provides quantitative evaluation criteria: RSS provides an objective and calculable numerical indicator for model fitting, transforming the comparison of models of different orders from subjective judgment to objective data comparison; Enables automated model selection: Through the steps of "trying different orders, calculating RSS, and selecting the minimum RSS", the optimal order of the polynomial is automatically and data-driven, avoiding manual trial and error and improving analysis efficiency and accuracy; Balances fitting and overfitting: Prefers to select the order with the minimum but not too high RSS, ensuring fitting accuracy while suppressing overfitting caused by excessively high orders, thus improving the model's generalization ability.

[0031] The beneficial effects of this invention lie in achieving high-precision, nonlinear data fitting: Addressing the deficiency of existing "linear display" methods in failing to accurately reflect the inherent nonlinear laws of data, this invention constructs a polynomial feature matrix and employs a polynomial regression model to fit complex nonlinear relationships and trends in discrete data. Compared to simple linear connections or linear regression, this invention generates fitting curves that better reflect the continuous changes in physical or technological processes, thereby improving the accuracy and realism of data analysis and providing a more reliable data foundation for industrial decision-making. It achieves an excellent balance between computational efficiency and fitting accuracy: Addressing the issues of time-consuming complex algorithms and insufficient accuracy of simple methods in existing technologies, this invention uses closed-form solutions of normal equations based on matrix solving for parameter determination. This method mathematically guarantees the global optimality of parameter estimation, and due to its no-iteration, one-time solution characteristic, it has extremely high computational efficiency for small to medium-sized datasets. Compared to iterative algorithms such as gradient descent, it avoids learning rate adjustment and convergence waiting; compared to more complex nonlinear fitting algorithms, it significantly reduces computational complexity. This enables this invention to provide high-precision fitting results while meeting the real-time or near-real-time analysis requirements of industrial sites. This invention achieves adaptive optimization of model complexity (polynomial order): Addressing the common challenge of "how to determine the best-fitting model," this invention innovatively introduces an automated model evaluation and selection mechanism based on the residual sum of squares (RSS). By presetting a range of orders and automatically calculating and comparing the RSS values ​​of models of different orders, the optimal polynomial order can be objectively and automatically selected. This process not only avoids the subjectivity and inefficiency of manual trial and error but also prevents overfitting due to overly complex (high-order) models or underfitting due to overly simple (low-order) models by selecting an appropriate order, ensuring the generalization ability and robustness of the final model. It also enhances the automation and intelligence of industrial data analysis: This invention integrates discrete data reading, feature processing, model fitting, evaluation, and selection into a complete automated process. Users only need to provide the raw data and set the order of exploration to obtain the optimal fitting function. This changes the inefficient traditional model that relies on manual analysis or simple statistics, improving the overall efficiency and intelligence of data analysis, lowering the professional threshold, and enabling technicians to focus on business interpretation and decision-making based on the fitting results, rather than tedious data processing, thus saving manual processing time. The technical solution is highly universal and easy to integrate and apply: the method of this invention has clear logic and well-defined steps, based on mature linear algebra and numerical analysis theory, and has good numerical stability. Therefore, this method is easy to integrate into various industrial control systems, monitoring platforms, or data analysis software, and can be widely applied to various industrial scenarios that require extracting continuous trends from discrete data, such as equipment condition monitoring, process parameter optimization, and quality prediction and control, with broad prospects for promotion and application.

[0032] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0034] Figure 1 This is a flowchart of a multinomial regression analysis method for discrete data provided by the present invention.

[0035] Figure 2 This is a block diagram illustrating the principle of a multinomial regression analysis system for discrete data provided by the present invention.

[0036] Figure 3 This is a curve showing the RSS of a polynomial regression analysis method for discrete data provided by the present invention as a function of the polynomial order.

[0037] The module consists of 1-data loading and matrix construction, 2-polynomial feature extension, 3-order and coefficient initialization, 4-matrix solving, 5-residual evaluation and order optimization, and 6-optimal model determination. Detailed Implementation

[0038] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The following embodiments are explanations of the present invention, but the present invention is not limited to the following implementation methods.

[0039] Example 1: like Figure 1 As shown in the figure, this embodiment provides a method for polynomial regression analysis of discrete data, which includes the following steps: Step S1, the data loading and matrix construction step, in which: Read discrete data samples to construct a feature data matrix X and actual result label data y; Step S2, the polynomial feature expansion step, in which: The feature data matrix X is expanded exponentially to generate a polynomial feature matrix. ; Step S3, the initialization of order and coefficients, in which: Set the highest order n of the polynomial regression and initialize the coefficient vector θ; Step S4, the matrix solution step, in which: The optimal coefficient vector θ is solved using the matrix method; Step S5, the residual evaluation and order optimization step, in which: Calculate the RSS (Residual Sum of Squares) value and optimize the RSS value by adjusting the highest order n of the polynomial; Step S6, the step of determining the optimal model, in which: Select the polynomial order n and the corresponding coefficient vector θ that minimize the RSS value to generate the final polynomial fitting function F(x).

[0040] Finally, based on the results, a curve is plotted showing how RSS changes with the polynomial order, as shown below. Figure 3 As shown.

[0041] Step S1 specifically includes: Discrete data is read into a matrix, which is divided into feature data matrix X and actual result label data y; feature data matrix X is an n×p matrix, where n is the number of samples, p is the number of features, and includes an intercept term column vector; feature data matrix X is a first power matrix.

[0042] This step can achieve the following technical effects: Ensuring model completeness: Introducing the intercept term enables the multinomial regression model to fit data that does not pass through the origin, improving the model's generality and fitting ability; Unifying data structure: Clearly defining the matrix dimensions (n ​​is the number of samples, p is the number of features) provides a precise data structure foundation for all subsequent matrix operations (such as transpose, inversion, and multiplication), avoiding algorithmic errors caused by dimension mismatch, and enhancing the robustness and feasibility of the method.

[0043] Step S2 specifically includes: The first-order characteristic data matrix X is transformed into a multinomial characteristic matrix through power expansion. Where the 1 inside the parentheses is a vector. The polynomial function F(x) to be fitted is in the form of:

[0044] This step can achieve the following technical effects: Achieving nonlinear mapping: Through power expansion, the original one-dimensional discrete data x is mapped to a high-dimensional feature space (x, x², …), enabling the linear regression model to fit complex nonlinear relationships. The computation process is simple, providing a more accurate foundation for the analysis of discrete data. Establishing clear mathematical objectives: The form of the function to be fitted is clearly given, transforming the engineering problem into a clear mathematical optimization problem (solving coefficients). … nThis makes the solution process reliable and the results interpretable.

[0045] Step S3 specifically includes: Set the highest order n of the polynomial to be regressed according to the specific application scenario, and set the coefficient vector θ to be calculated based on the highest order. .

[0046] This step can achieve the following technical effects: It provides flexibility and controllability: allows users to preset the highest order n based on prior knowledge or computational resources, achieving a balance between fitting accuracy (higher order) and model simplicity (lower order); it defines the optimization variable: the coefficient vector θ is defined as the target variable to be optimized, providing a clear optimization object for the method of this invention.

[0047] Step S4 specifically includes: The optimal parameter θ is solved using the matrix method, and the expression is:

[0048] Among them, X Let X be the transpose of the feature data matrix. Then, the predicted label value can be calculated from the coefficient vector θ and the feature data: .

[0049] This step can achieve the following technical effects: Guaranteeing the global optimal solution: The matrix solution method can provide a mathematically unique and globally optimal parameter estimate for the linear model, ensuring the theoretical optimality of the fit; High computational efficiency: Compared with iterative algorithms such as gradient descent, when the data scale (n and p) is moderate, there is no need to set the number of iterations and convergence steps, and it can be solved directly in one go, which improves the operation speed, reduces the computational complexity, and can meet the real-time requirements of industry.

[0050] Step S5 specifically includes: Using the residual sum of squares (RSS) as the loss function, the RSS value is calculated as follows:

[0051] The steps of solving for the optimal parameter θ and calculating the RSS value are repeated to obtain RSS values ​​of multiple different orders. Error analysis is performed on these RSS values, and the polynomial order with the smallest RSS value is selected.

[0052] This step can achieve the following technical effects: Provides quantitative evaluation criteria: RSS provides an objective and calculable numerical indicator for model fitting, transforming the comparison of models of different orders from subjective judgment to objective data comparison; Enables automated model selection: Through the steps of "trying different orders, calculating RSS, and selecting the minimum RSS", the optimal order of the polynomial is automatically and data-driven, avoiding manual trial and error and improving analysis efficiency and accuracy; Balances fitting and overfitting: Prefers to select the order with the minimum but not too high RSS, ensuring fitting accuracy while suppressing overfitting caused by excessively high orders, thus improving the model's generalization ability.

[0053] Example 2: like Figure 2 As shown in the figure, this embodiment provides a multinomial regression analysis system for discrete data, including: Data loading and matrix construction module 1, in which: Read discrete data samples to construct a feature data matrix X and actual result label data y; Polynomial feature extension module 2, in which: The feature data matrix X is expanded exponentially to generate a polynomial feature matrix. ; Order and coefficient initialization module 3, in which: Set the highest order n of the polynomial regression and initialize the coefficient vector θ; Matrix solving module 4, in which: The optimal coefficient vector θ is solved using the matrix method; Residual evaluation and order optimization module 5, in which: Calculate the RSS (Residual Sum of Squares) value and optimize the RSS value by adjusting the highest order n of the polynomial; Optimal model determination module 6, in which: Select the polynomial order n and the corresponding coefficient vector θ that minimize the RSS value to generate the final polynomial fitting function F(x).

[0054] Finally, based on the results, a curve is plotted showing how RSS changes with the polynomial order, as shown below. Figure 3 As shown.

[0055] The data loading and matrix construction module 1 specifically includes: Discrete data is read into a matrix, which is divided into feature data matrix X and actual result label data y; feature data matrix X is an n×p matrix, where n is the number of samples, p is the number of features, and includes an intercept term column vector; feature data matrix X is a first power matrix.

[0056] This module can achieve the following technical effects: Ensuring model completeness: Introducing the intercept term enables the multinomial regression model to fit data that does not pass through the origin, improving the model's generality and fitting ability; Unifying data structure: Clearly defining the matrix dimensions (n ​​is the number of samples, p is the number of features) provides a precise data structure foundation for all subsequent matrix operations (such as transpose, inversion, and multiplication), avoiding algorithmic errors caused by dimension mismatch, and enhancing the robustness and feasibility of the method.

[0057] The polynomial feature extension module 2 specifically includes: The first-order characteristic data matrix X is transformed into a multinomial characteristic matrix through power expansion. Where the 1 inside the parentheses is a vector. The polynomial function F(x) to be fitted is in the form of:

[0058] This module can achieve the following technical effects: Achieving nonlinear mapping: Through power expansion, the original one-dimensional discrete data x is mapped to a high-dimensional feature space (x, x², …), enabling the linear regression model to fit complex nonlinear relationships. The computation process is simple, providing a more accurate foundation for the analysis of discrete data. Establishing clear mathematical objectives: The form of the function to be fitted is clearly given, transforming the engineering problem into a clear mathematical optimization problem (solving coefficients). … n This makes the solution process reliable and the results interpretable.

[0059] The order and coefficient initialization module 3 specifically includes: Set the highest order n of the polynomial to be regressed according to the specific application scenario, and set the coefficient vector θ to be calculated based on the highest order. .

[0060] This module can achieve the following technical effects: It provides flexibility and controllability: allows users to preset the highest order n based on prior knowledge or computational resources, achieving a balance between fitting accuracy (higher order) and model simplicity (lower order); it defines the optimization variable: the coefficient vector θ is defined as the target variable to be optimized, providing a clear optimization object for the method of this invention.

[0061] The matrix solving module 4 specifically includes: The optimal parameter θ is solved using the matrix method, and the expression is:

[0062] Among them, X Let X be the transpose of the feature data matrix. Then, the predicted label value can be calculated from the coefficient vector θ and the feature data: .

[0063] This module can achieve the following technical effects: Guaranteeing the global optimal solution: The matrix solution method can provide a mathematically unique and globally optimal parameter estimate for the linear model, ensuring the theoretical optimality of the fit; High computational efficiency: Compared with iterative algorithms such as gradient descent, when the data scale (n and p) is moderate, there is no need to set the number of iterations and convergence steps, and it can be solved directly in one go, which improves the operation speed, reduces the computational complexity, and can meet the real-time requirements of industry.

[0064] The residual evaluation and order optimization module 5 specifically includes: Using the residual sum of squares (RSS) as the loss function, the RSS value is calculated as follows:

[0065] The steps of solving for the optimal parameter θ and calculating the RSS value are repeated to obtain RSS values ​​of multiple different orders. Error analysis is performed on these RSS values, and the polynomial order with the smallest RSS value is selected.

[0066] This module can achieve the following technical effects: Provides quantitative evaluation criteria: RSS provides an objective and calculable numerical indicator for model fitting, transforming the comparison of models of different orders from subjective judgment to objective data comparison; Enables automated model selection: Through the steps of "trying different orders, calculating RSS, and selecting the minimum RSS", the optimal order of the polynomial is automatically and data-driven, avoiding manual trial and error and improving analysis efficiency and accuracy; Balances fitting and overfitting: Prefers to select the order with the minimum but not too high RSS, ensuring fitting accuracy while suppressing overfitting caused by excessively high orders, thus improving the model's generalization ability.

[0067] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The methods disclosed in the embodiments are described simply because they correspond to the systems disclosed in the embodiments; relevant details can be found in the method section.

[0068] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0069] In the embodiments provided by this invention, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0070] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0071] In addition, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit.

[0072] Similarly, in the various embodiments of the present invention, each processing unit can be integrated into a functional module, or each processing unit can exist physically, or two or more processing units can be integrated into a functional module.

[0073] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0074] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0075] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Any non-creative variations that can be conceived by those skilled in the art, as well as any improvements and modifications made without departing from the principles of the present invention, should fall within the protection scope of the present invention.

Claims

1. A method for polynomial regression analysis of discrete data, characterized in that, Includes the following steps: Step S1, the data loading and matrix construction step, in which: Read discrete data samples to construct a feature data matrix X and actual result label data y; Step S2, the polynomial feature expansion step, in which: The feature data matrix X is expanded exponentially to generate a polynomial feature matrix. ; Step S3, the initialization of order and coefficients, in which: Set the highest order n of the polynomial regression and initialize the coefficient vector θ; Step S4, the matrix solution step, in which: The optimal coefficient vector θ is solved using the matrix method; Step S5, the residual evaluation and order optimization step, in which: Calculate the RSS value and optimize the RSS value by adjusting the highest order n of the polynomial; Step S6, the step of determining the optimal model, in which: Select the polynomial order n and the corresponding coefficient vector θ that minimize the RSS value to generate the final polynomial fitting function F(x).

2. The method for polynomial regression analysis of discrete data according to claim 1, characterized in that, Step S1 specifically includes: Discrete data is read into a matrix, which is divided into feature data matrix X and actual result label data y. The feature data matrix X is an n×p matrix, where n is the number of samples, p is the number of features, and it contains an intercept term column vector.

3. A method for polynomial regression analysis of discrete data according to claim 1 or 2, characterized in that, Step S2 specifically includes: The feature data matrix X is transformed into a polynomial feature matrix through power expansion. The polynomial function F(x) to be fitted is of the form: 。 4. The method for polynomial regression analysis of discrete data according to claim 3, characterized in that, Step S3 specifically includes: Set the highest order n of the polynomial to be regressed according to the specific application scenario, and set the coefficient vector θ to be calculated based on the highest order. .

5. The method for polynomial regression analysis of discrete data according to claim 4, characterized in that, Step S4 specifically includes: The optimal parameter θ is solved using the matrix method, and the expression is: Among them, X Let X be the transpose of the feature data matrix X.

6. The method for polynomial regression analysis of discrete data according to claim 5, characterized in that, Step S5 specifically includes: Using the residual sum of squares (RSS) as the loss function, the RSS value is calculated as follows: The steps of solving for the optimal parameter θ and calculating the RSS value are repeated to obtain RSS values ​​of multiple different orders. Error analysis is performed on these RSS values, and the polynomial order with the smallest RSS value is selected.

7. A polynomial regression analysis system for discrete data, characterized in that, include: The data loading and matrix construction module contains: Read discrete data samples to construct a feature data matrix X and actual result label data y; The polynomial feature extension module contains: The feature data matrix X is expanded exponentially to generate a polynomial feature matrix. ; The order and coefficient initialization module contains: Set the highest order n of the polynomial regression and initialize the coefficient vector θ; The matrix solving module contains: The optimal coefficient vector θ is solved using the matrix method; The residual evaluation and order optimization module contains: Calculate the RSS value and optimize the RSS value by adjusting the highest order n of the polynomial; The optimal model determination module contains: Select the polynomial order n and the corresponding coefficient vector θ that minimize the RSS value to generate the final polynomial fitting function F(x).

8. The polynomial regression analysis system for discrete data according to claim 7, characterized in that, The data loading and matrix construction module specifically includes: Discrete data is read into a matrix, which is divided into feature data matrix X and actual result label data y. The feature data matrix X is an n×p matrix, where n is the number of samples, p is the number of features, and it contains an intercept term column vector.

9. A polynomial regression analysis system for discrete data according to claim 7 or 8, characterized in that, The polynomial feature extension module specifically includes: The feature data matrix X is transformed into a polynomial feature matrix through power expansion. The polynomial function F(x) to be fitted is of the form: 。 10. A polynomial regression analysis system for discrete data according to claim 9, characterized in that, The order and coefficient initialization module specifically includes: Set the highest order n of the polynomial to be regressed according to the specific application scenario, and set the coefficient vector θ to be calculated based on the highest order. .