CN112712181A - Model construction optimization method, device, equipment and readable storage medium - Google Patents

Model construction optimization method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN112712181A
CN112712181A CN202011624051.3A CN202011624051A CN112712181A CN 112712181 A CN112712181 A CN 112712181A CN 202011624051 A CN202011624051 A CN 202011624051A CN 112712181 A CN112712181 A CN 112712181A
Authority
CN
China
Prior art keywords
model
candidate
matrix
variable
model parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011624051.3A
Other languages
Chinese (zh)
Inventor
黄勇卫
壮青
陈婷
吴三平
庄伟亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202011624051.3A priority Critical patent/CN112712181A/en
Publication of CN112712181A publication Critical patent/CN112712181A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Abstract

The application discloses a model construction optimization method, a device, equipment and a readable storage medium, wherein the model construction optimization method comprises the following steps: obtaining a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to obtain a first candidate model parameter corresponding to each candidate variable; adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables; performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results; and optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model. The method and the device solve the technical problem that the nonlinear model is easy to distort.

Description

Model construction optimization method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of machine learning technology of financial technology (Fintech), and in particular, to a model construction optimization method, apparatus, device, and readable storage medium.
Background
With the continuous development of financial science and technology, especially internet science and technology, more and more technologies (such as distributed technology, artificial intelligence and the like) are applied to the financial field, but the financial industry also puts higher requirements on the technologies, for example, higher requirements on the distribution of backlog in the financial industry are also put forward.
With the continuous development of computer technology, the application field of machine learning is more and more extensive, when a model is constructed, the model is often distorted due to the problem of collinearity among input variables, at present, multiple collinearity among the input variables is usually checked through a variance expansion coefficient to prevent the model from being distorted, but the variance expansion coefficient has the best effect on a multiple linear model but is not suitable for a nonlinear model, and further, for the nonlinear model, the problem that the model is easy to distort even if the multiple collinearity check is performed on the input variables through the variance expansion coefficient still exists.
Disclosure of Invention
The application mainly aims to provide a model construction optimization method, a model construction optimization device, model construction optimization equipment and a readable storage medium, and aims to solve the technical problem that a nonlinear model is easy to distort in the prior art.
In order to achieve the above object, the present application provides a model construction optimization method, which is applied to a model construction optimization device, and includes:
obtaining a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to obtain a first candidate model parameter corresponding to each candidate variable;
adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables;
performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results;
and optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model.
The present application further provides a model building optimization device, the model building optimization device is a virtual device, and the model building optimization device is applied to model building optimization equipment, the model building optimization device includes:
the first iterative training module is used for acquiring a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to acquire a first candidate model parameter corresponding to each candidate variable;
the second iterative training module is used for adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables;
a co-linearity checking module, configured to perform multiple co-linearity checking on each candidate variable based on each first candidate model parameter and each second candidate model parameter, so as to obtain multiple co-linearity checking results;
and the optimization module is used for optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model.
The present application further provides a model building optimization apparatus, the model building optimization apparatus is an entity apparatus, the model building optimization apparatus includes: a memory, a processor and a program of the model building optimization method stored on the memory and executable on the processor, which when executed by the processor, may implement the steps of the model building optimization method as described above.
The present application also provides a readable storage medium having stored thereon a program for implementing a model building optimization method, which when executed by a processor, implements the steps of the model building optimization method as described above.
Compared with the technical means of detecting multiple collinearity among input variables through variance expansion coefficients to prevent model distortion in the prior art, the method comprises the steps of obtaining a candidate variable pool and a model to be trained, adding candidate variables in the candidate variable pool into the model to be trained respectively for iterative training to obtain first candidate model parameters corresponding to the candidate variables, namely performing iterative training on the model to be trained independently based on each candidate variable to generate first candidate model parameters of each candidate variable under the condition of no interference of other variables, adding the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to the candidate variables, namely adding the candidate variables into the model to be trained together for iterative training, generating a first candidate model parameter of each candidate variable under the condition of other variable interference, and further performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results, wherein it needs to be noted that if multiple co-linearity exists between the candidate variables, the candidate variables will interfere with each other, so that the difference between the first candidate model parameter and the second candidate model parameter corresponding to the candidate variable is extremely large, further performing multiple co-occurrence detection based on the model parameters generated by the candidate variables under the condition of other variable interference and the model parameters generated without other variable interference, and further performing the multiple co-occurrence detection directly based on the model parameters generated by model iterative training, so that the method can be applied to any type of models, and further based on the multiple co-linearity detection results, and optimizing the model to be trained to obtain a target modeling model, so that the technical defect that the model is easy to distort even if multiple collinearity tests are carried out on input variables through variance expansion coefficients for the nonlinear model in the prior art is overcome, and the problem that the nonlinear model is easy to distort is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic flow chart of a first embodiment of the model building optimization method of the present application;
FIG. 2 is a schematic flow chart of a second embodiment of the model building optimization method of the present application;
fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In a first embodiment of the model building optimization method of the present application, referring to fig. 1, the model building optimization method includes:
step S10, obtaining a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to obtain a first candidate model parameter corresponding to each candidate variable;
in this embodiment, it should be noted that the model to be trained is an untrained machine learning model, the candidate variable pool at least includes a candidate variable, where the candidate variable is a modeling feature corresponding to the model to be trained, for example, if the modeling sample is (a, B, C), where a represents that the age of the user is 35 years old, B represents that the occupation of the user is a teacher, C represents that the deposit of the user is greater than 100 ten thousand, the modeling feature corresponding to a is an age feature a, the modeling feature corresponding to B is an occupation type feature B, and the modeling feature corresponding to C is a deposit number feature C.
Obtaining a candidate variable pool and a model to be trained, respectively adding each candidate variable in the candidate variable pool into the model to be trained for iterative training, obtaining a first candidate model parameter corresponding to each candidate variable, specifically obtaining the candidate variable pool and the model to be trained, and executing the following steps for each candidate variable in the candidate variable pool:
obtaining a first modeling sample corresponding to the candidate variable, wherein the first modeling sample is composed of a feature value of a single candidate variable, the first modeling sample is input into the model to be trained, model prediction is executed, a first model output result corresponding to the first modeling sample is output, a first model loss is calculated based on the first model output result and a first real model output result corresponding to the first modeling sample, a model parameter of the model to be trained is updated based on the first model loss to obtain a first updated model, whether the first updated model meets a preset iterative training end condition or not is judged, if yes, a model parameter corresponding to the candidate variable in the first updated model is obtained as a first candidate model parameter, and if not, the step of obtaining the first modeling sample corresponding to the candidate variable is returned, the preset iteration training end condition comprises loss function convergence, a threshold value of maximum iteration times and the like.
Step S20, adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables;
in this embodiment, each candidate variable is added to the model to be trained together for iterative training, so as to obtain a second candidate model parameter corresponding to each candidate variable, and specifically, a second modeling sample corresponding to all candidate variables is obtained, where the second modeling sample is composed of feature values of all candidate variables, the second modeling sample is input to the model to be trained, model prediction is performed, a second model output result corresponding to the second modeling sample is output, a second model loss is calculated based on the second model output result and a second true model output result corresponding to the second modeling sample, and then the model parameter of the model to be trained is updated based on the second model loss, so as to obtain a second updated model, and whether the second updated model satisfies a preset iterative training end condition is determined, and if the model parameters are not satisfied, returning to the step of obtaining a second modeling sample corresponding to all the candidate variables.
Step S30, performing multiple collinearity tests on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple collinearity test results;
in this embodiment, it should be noted that the multiple co-linearity test is used to check whether the candidate variable is a multiple co-linear variable, where the multiple co-occurring variable is a candidate variable that is co-linear with at least one other candidate variable.
Performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results, specifically, comparing a parameter symbol of the first candidate model parameter corresponding to each candidate variable with a parameter symbol of the corresponding second candidate model parameter to obtain a comparison result, and further determining whether multiple co-linearity variables exist in each candidate variable according to the comparison result to obtain a determination result, and further taking the determination result as the multiple co-linearity test result, wherein it is required to be noted that the first candidate model parameter is a model parameter generated without interference of other variables, the second candidate model parameter is a model parameter generated with interference of other variables, and the parameter symbol of the model parameter can represent the contribution direction of the candidate variable to the model, that is, it indicates whether the candidate variable has a forward contribution or a backward contribution to the output result of the model, and if the sign of the parameter of the first candidate model parameter is different from that of the parameter of the second candidate model parameter for the same candidate variable, it is verified that the candidate variable has changed the direction of the degree of contribution under the co-linearity interference of other candidate variables, and the candidate variable is determined to be the multiple co-linearity variable.
Wherein the first candidate model parameter comprises a first model parameter value and the second candidate model parameter comprises a second model parameter value,
the step of performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results includes:
step S31, acquiring a first parameter positive and negative sign corresponding to each first model parameter value and a second parameter positive and negative sign of each second model parameter value;
in this embodiment, it should be noted that the model parameter value is a single value, at this time, the parameter symbol of the model parameter value is a positive or negative symbol of the model parameter value, the first positive or negative symbol of the parameter is a positive or negative symbol of the first model parameter value and is used for representing the parameter symbol of the first model parameter value, and the second positive or negative symbol of the parameter is a positive or negative symbol of the second model parameter value and is used for representing the parameter symbol of the second model parameter value.
And specifically, extracting the signs and signs of each first model parameter value as the signs and signs of the first parameter corresponding to the first model parameter value, and extracting the signs and signs of each second model parameter value as the signs and signs of the second parameter corresponding to the second model parameter value.
Step S32, performing multiple co-linearity test on each candidate variable by testing whether the sign of the first parameter corresponding to each candidate variable is consistent with the sign of the second parameter corresponding to each candidate variable, so as to obtain the multiple co-linearity test result.
In this embodiment, multiple co-linearity tests are performed on each candidate variable by checking whether the first parameter positive/negative sign corresponding to each candidate variable is consistent with the corresponding second parameter positive/negative sign, so as to obtain the multiple co-linearity test result, and specifically, the following steps are performed for the first parameter positive/negative sign corresponding to each candidate variable and the corresponding second parameter positive/negative sign:
judging whether the positive and negative signs of a first parameter corresponding to the candidate variable are consistent with the positive and negative signs of a second parameter corresponding to the candidate variable, if so, judging that the candidate variable is not a multiple co-linear variable, assigning a variable type label of a first type to the candidate variable to identify that the candidate variable is not the multiple co-linear variable, if not, judging that the candidate variable is the multiple co-linear variable, assigning a variable type label of a second type to the candidate variable to identify that the candidate variable is the multiple co-linear variable, and further taking the variable type label of each candidate variable as the multiple co-linear test result.
And step S40, optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model.
In this embodiment, the model to be trained is optimized based on the multiple co-linear detection result to obtain a target modeling model, and specifically, each multiple co-linear variable in the candidate variable pool is determined based on the multiple co-linear detection result, each multiple co-linear variable is eliminated from the candidate variable pool, and then third modeling sample data corresponding to each candidate variable in the candidate variable pool after each multiple co-linear feature is eliminated is obtained, where the third modeling sample data at least includes a third modeling sample, and then, based on the third modeling sample, iterative optimization is performed on the model to be trained until the model to be trained satisfies a preset iterative training end condition, and the model to be trained is used as the target modeling model.
The step of optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model comprises the following steps:
step S41, judging whether multiple collinearity variables exist in the candidate variable pool or not based on the multiple collinearity detection result;
in this embodiment, it should be noted that the multiple collinearity detection result at least includes a variable type tag of the candidate variable, where the variable type tag is used to identify whether the corresponding candidate variable is a multiple collinearity variable.
And judging whether multiple co-linear variables exist in the candidate variable pool or not based on the multiple co-linear detection result, specifically, determining whether preset co-linear type tags exist in the variable type tags or not, if so, judging that multiple co-linear variables exist in the candidate variable pool, and if not, judging that multiple co-linear variables do not exist in the candidate variable pool, wherein the preset co-linear type tags are variable type tags for identifying the multiple co-linear variables.
Step S42, if yes, the multiple co-linear variables are removed from the candidate variable pool, and the step of adding the candidate variables in the candidate variable pool into the model to be trained respectively for iterative training is returned;
and step S43, if not, using the model to be trained having the second candidate model parameters as the target modeling model.
In this embodiment, if the candidate variable pool exists, the multiple co-linear variables are removed from the candidate variable pool, and the step of adding each candidate variable in the candidate variable pool to the model to be trained respectively for iterative training is returned to continue the multiple co-linear test until no multiple co-linear variables exist in the candidate variable pool, and if the candidate variable pool does not exist, the model to be trained having each second candidate model parameter is used as the target modeling model.
Compared with the technical means of detecting multiple collinearity among input variables through variance expansion coefficients to prevent model distortion in the prior art, the embodiment of the application provides a model construction optimization method, after a candidate variable pool and a model to be trained are obtained, firstly, candidate variables in the candidate variable pool are respectively added into the model to be trained for iterative training to obtain first candidate model parameters corresponding to the candidate variables, namely, the model to be trained is subjected to iterative training independently based on each candidate variable to generate first candidate model parameters of each candidate variable under the condition of no interference of other variables, then, the candidate variables are added into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to the candidate variables, namely, the candidate variables are added into the model to be trained together for iterative training, generating a first candidate model parameter of each candidate variable under the condition of other variable interference, and further performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results, wherein it needs to be noted that if multiple co-linearity exists between the candidate variables, the candidate variables will interfere with each other, so that the difference between the first candidate model parameter and the second candidate model parameter corresponding to the candidate variable is extremely large, further performing multiple co-occurrence detection based on the model parameters generated by the candidate variables under the condition of other variable interference and the model parameters generated without other variable interference, and further performing the multiple co-occurrence detection directly based on the model parameters generated by model iterative training, so that the method can be applied to any type of models, and further based on the multiple co-linearity detection results, and optimizing the model to be trained to obtain a target modeling model, so that the technical defect that the model is easy to distort even if multiple collinearity tests are carried out on input variables through variance expansion coefficients for the nonlinear model in the prior art is overcome, and the problem that the nonlinear model is easy to distort is solved.
Further, referring to fig. 2, based on the first embodiment in the present application, in another embodiment of the present application, the first candidate model parameters comprise a first model parameter matrix, the second candidate model parameters comprise a second model parameter matrix,
the step of performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results includes:
step A10, performing Hash coding on each first model parameter matrix to obtain each first Hash coding matrix;
in this embodiment, it should be noted that the first model parameter matrix is a first candidate model parameter in a matrix form.
Performing hash coding on each first model parameter matrix to obtain each first hash coding matrix, and specifically, performing hash coding on each bit value in each first model parameter matrix to obtain a first hash coding matrix corresponding to each first model parameter matrix, where the first model parameter matrix includes at least one bit value.
Wherein the first hash-coding matrix comprises a binary hash-coding matrix,
the step of performing hash coding on each first model parameter matrix to obtain each first hash coding matrix includes:
step A11, obtaining each bit value in each first model parameter matrix;
in this embodiment, it should be noted that the bit value is a value of a bit of the first model parameter matrix.
Step a12, based on the positive and negative signs of each bit value, respectively performing binary hash coding on each first model parameter matrix to obtain each binary hash coding matrix.
In this embodiment, binary hash coding is performed on each first model parameter matrix based on signs and signs of each bit value to obtain each binary hash coding matrix, specifically, binary division is performed on each bit value in each first model parameter matrix based on signs and signs of each bit value in each first model parameter matrix to obtain each first type bit value and each second type bit value in each first model parameter matrix, and then each first type bit value in each first model parameter matrix is assigned with a first type hash coding value, and each second type bit value in each first model parameter matrix is assigned with a second type hash coding value to obtain a binary hash coding value composed of each first type hash coding value and each first type hash coding value corresponding to each first model parameter matrix The matrix comprises a matrix, wherein the positions of bit numerical values in the first model parameter matrix in the matrix correspond to the positions of hash code values in the binary hash code matrix in the matrix one to one, wherein the hash code values comprise a first type hash code value and a second type hash code value, the first type hash code value can be set to be 1, and the second type hash code value can be set to be 0.
Wherein the first hash-coding matrix comprises a three-value hash-coding matrix,
the step of performing hash coding on each first model parameter matrix to obtain each first hash coding matrix includes:
step B10, obtaining each bit value in each first model parameter matrix;
in this embodiment, it should be noted that the bit value is a value of a bit of the first model parameter matrix.
And step B20, respectively carrying out three-value Hash coding on each first model parameter matrix based on the size of the bit numerical value to obtain each three-value Hash coding matrix.
In this embodiment, based on the size of the bit values, performing three-value hash coding on each of the first model parameter matrices to obtain each of the three-value hash coding matrices, specifically, based on the size of each bit value in each of the first model parameter matrices, performing three-value division on each bit value in each of the first model parameter matrices to hash the bit value greater than a preset first bit threshold value in each of the first model parameter matrices to a first-type three-value hash coding value, hash the bit value smaller than a preset second bit threshold value in each of the first model parameter matrices to a second-type three-value hash coding value, and hash the bit value greater than the preset second bit threshold value and smaller than the preset first bit threshold value in each of the first model parameter matrices to a third-type three-value hash coding value, and further obtaining a three-value hash coding matrix corresponding to each first model parameter matrix, wherein the positions of bit numerical values in the first model parameter matrix in the matrix correspond to the positions of hash coding values in the three-value hash coding matrix in the matrix one to one, the hash coding values include a first type three-value hash coding value, a second type three-value hash coding value and a third type hash coding value, the first type hash coding value can be set to 1, and the second type hash coding value can be set to-1. The third type hash encoding value may be set to 0.
Step A20, performing Hash coding on each second model parameter matrix to obtain each second Hash coding matrix;
in this embodiment, it should be noted that the second hash coding matrix includes a second binary hash coding matrix and a second three-value hash coding matrix.
Performing hash coding on each second model parameter matrix to obtain each second hash coding matrix, specifically, obtaining each second bit value in each second model parameter matrix, and performing binary hash coding on each second model parameter matrix based on a positive sign and a negative sign of each second bit value to obtain a second binary hash coding matrix corresponding to each second model parameter matrix, where the specific step of performing the binary hash coding matrix may refer to steps a11 to a 12.
In another embodiment, the step of performing hash coding on each second model parameter matrix to obtain each second hash coding matrix includes:
and obtaining each second bit value in each second model parameter matrix, and performing three-value hash coding on each second model parameter matrix based on the size of each second bit value to obtain a second three-value hash coding matrix corresponding to each second model parameter matrix, where the specific step of performing the binary hash coding matrix may refer to steps B11 to B12.
Step a30, performing multiple co-linearity test on each candidate variable based on each first hash code matrix and each second hash code matrix, and obtaining the multiple co-linearity test result.
In this embodiment, multiple co-linear inspection is performed on each candidate variable based on each first hash coding matrix and each second hash coding matrix to obtain the multiple co-linear inspection result, specifically, multiple co-linear inspection is performed on each candidate variable by comparing matrix similarity between a first hash coding matrix corresponding to each candidate variable and a corresponding second hash coding matrix to obtain the multiple co-linear inspection result, where it should be noted that the first hash coding matrix may be used to represent a first contribution direction of the corresponding candidate variable to the model without interference of other variables, and the second hash coding matrix may be used to represent a second contribution direction of the corresponding candidate variable to the model with interference of other variables, where the matrix similarity is used to evaluate consistency between the first contribution direction and the second contribution direction, the higher the matrix similarity is, the higher the consistency between the first contribution direction and the second contribution direction is, and when the matrix similarity is smaller than a preset similarity threshold, the inconsistency between the first contribution direction and the second contribution direction is determined, so that the matrix similarity smaller than the preset similarity threshold is proved to exist due to the influence of multiple co-linearity variables on the candidate variables, and the matrix similarity can be used for multiple co-linearity inspection.
Performing multiple co-linearity test on each candidate variable based on each first hash coding matrix and each second hash coding matrix, wherein the step of obtaining the multiple co-linearity test result comprises:
step A31, calculating the matrix similarity of the first Hash code matrix corresponding to each candidate variable and the corresponding second Hash code matrix;
in this embodiment, the matrix similarity between the first hash coding matrix corresponding to each candidate variable and the second hash coding matrix corresponding to each candidate variable is calculated, specifically, the following steps are performed for each candidate variable:
acquiring the number of bits corresponding to the first hash code matrix, wherein the number of bits of the first hash code matrix is the same as that of the second hash code matrix, and further comparing each bit value in the first hash code matrix with each bit value corresponding to the second hash code matrix to acquire the number of different bits between the first hash code matrix and the second hash code matrix, wherein the different bits are bits with different bit values between the first hash code matrix and the second hash code matrix, for example, assuming that the hash code value of the first row and the first column of the first hash code matrix is 1, and the hash code value of the first row and the first column of the second hash code matrix is 0, it is proved that the bits of the first row and the first column of the first column are different bits, and further calculating the ratio of the number of the different bits to the bit value to obtain the matrix similarity.
Step A32, comparing the similarity of each matrix with a preset similarity threshold, and performing multiple co-linearity test on each candidate variable to obtain multiple co-linearity test results.
In this embodiment, the multiple collinearity test is performed on each candidate variable by comparing each matrix similarity with a preset similarity threshold, so as to obtain the multiple collinearity test result, specifically, each matrix similarity is compared with the preset similarity threshold, if the matrix similarity is greater than the preset similarity threshold, it is verified that the candidate variable corresponding to the matrix similarity is not the multiple collinearity variable, if the matrix similarity is not greater than the preset similarity threshold, it is verified that the candidate variable corresponding to the matrix similarity is the multiple collinearity variable, and then a determination result for determining whether each candidate variable is the multiple collinearity variable is taken as the multiple collinearity test result.
The embodiment of the application provides a method for rectangular multiple co-linear inspection based on hash coding, that is, hash coding is performed on each first model parameter matrix to obtain each first hash coding matrix, and hash coding is performed on each second model parameter matrix to obtain each second hash coding matrix, where it is to be noted that the first hash coding matrix may be used to represent a first contribution direction of a corresponding candidate variable to a model without interference of other variables, the second hash coding matrix may be used to represent a second contribution direction of the corresponding candidate variable to the model with interference of other variables, and then based on each first hash coding matrix and each second hash coding matrix, it may be tested whether each candidate variable is affected by other candidate variables to cause a change in the contribution direction, if so, the candidate variables are proved to be multiple co-linear variables, so that the aim of performing multiple co-linear inspection on each candidate variable can be fulfilled, the multiple co-linear inspection result is obtained, multiple co-linear inspection is directly performed on the basis of model parameters generated by model iterative training and can be applied to any type of model, and the model to be trained is optimized on the basis of the multiple co-linear inspection result, so that the target modeling model can be obtained.
Referring to fig. 3, fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 3, the model building optimization apparatus may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the model building optimization device may further include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may comprise a Display screen (Display), an input sub-module such as a Keyboard (Keyboard), and the optional rectangular user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the model building optimization apparatus configuration shown in FIG. 3 does not constitute a limitation of the model building optimization apparatus and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in FIG. 3, a memory 1005, which is one type of computer storage medium, may include an operating system, a network communication module, and a model building optimizer. The operating system is a program that manages and controls model building to optimize the hardware and software resources of the facility, and supports the operation of the model building optimizer as well as other software and/or programs. The network communication module is used for realizing communication among the components in the memory 1005 and communication with other hardware and software in the model building optimization system.
In the model building optimization apparatus shown in fig. 3, the processor 1001 is configured to execute a model building optimization program stored in the memory 1005 to implement the steps of any one of the model building optimization methods described above.
The specific implementation of the model building optimization device of the present application is substantially the same as that of each embodiment of the model building optimization method, and is not described herein again.
The embodiment of the present application further provides a model building optimization device, where the model building optimization device is applied to a model building optimization device, and the model building optimization device includes:
the first iterative training module is used for acquiring a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to acquire a first candidate model parameter corresponding to each candidate variable;
the second iterative training module is used for adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables;
a co-linearity checking module, configured to perform multiple co-linearity checking on each candidate variable based on each first candidate model parameter and each second candidate model parameter, so as to obtain multiple co-linearity checking results;
and the optimization module is used for optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model.
Optionally, the collinearity check module is further configured to:
acquiring a first parameter positive sign and a second parameter positive sign corresponding to each first model parameter value and each second model parameter value;
and performing multiple co-linearity test on each candidate variable by testing whether the sign of the first parameter corresponding to each candidate variable is consistent with the sign of the second parameter corresponding to each candidate variable, so as to obtain the multiple co-linearity test result.
Optionally, the collinearity check module is further configured to:
performing hash coding on each first model parameter matrix to obtain each first hash coding matrix;
performing hash coding on each second model parameter matrix to obtain each second hash coding matrix;
and performing multiple co-linear tests on the candidate variables based on the first hash coding matrixes and the second hash coding matrixes to obtain multiple co-linear test results.
Optionally, the collinearity check module is further configured to:
calculating the matrix similarity of a first Hash coding matrix corresponding to each candidate variable and a second Hash coding matrix corresponding to each candidate variable;
and comparing the similarity of each matrix with a preset similarity threshold value, and performing multiple co-linearity test on each candidate variable to obtain multiple co-linearity test results.
Optionally, the collinearity check module is further configured to:
obtaining each bit value in each first model parameter matrix;
and respectively carrying out binary hash coding on each first model parameter matrix based on the positive and negative signs of each bit value to obtain each binary hash coding matrix.
Optionally, the collinearity check module is further configured to:
obtaining each bit value in each first model parameter matrix;
and respectively carrying out three-value Hash coding on each first model parameter matrix based on the size of the bit numerical value to obtain each three-value Hash coding matrix.
Optionally, the optimization module is further configured to:
judging whether multiple collinear variables exist in the candidate variable pool or not based on the multiple collinear detection result;
if so, removing the multiple co-linear variables from the candidate variable pool, and returning to the step of adding each candidate variable in the candidate variable pool to the model to be trained respectively for iterative training;
and if the model does not exist, taking the model to be trained with the second candidate model parameters as the target modeling model.
The specific implementation of the model building and optimizing apparatus of the present application is substantially the same as that of each embodiment of the model building and optimizing method described above, and is not described herein again.
The embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, which can be further executed by one or more processors for implementing the steps of any one of the model building optimization methods described above.
The specific implementation manner of the readable storage medium of the present application is substantially the same as that of each embodiment of the model building and optimizing method, and is not described herein again.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (10)

1. A model construction optimization method is characterized by comprising the following steps:
obtaining a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to obtain a first candidate model parameter corresponding to each candidate variable;
adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables;
performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results;
and optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model.
2. The model build optimization method of claim 1, wherein the first candidate model parameter comprises a first model parameter value, the second candidate model parameter comprises a second model parameter value,
the step of performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results includes:
acquiring a first parameter positive sign and a second parameter positive sign corresponding to each first model parameter value and each second model parameter value;
and performing multiple co-linearity test on each candidate variable by testing whether the sign of the first parameter corresponding to each candidate variable is consistent with the sign of the second parameter corresponding to each candidate variable, so as to obtain the multiple co-linearity test result.
3. The model build optimization method of claim 1, wherein the first candidate model parameters comprise a first model parameter matrix and the second candidate model parameters comprise a second model parameter matrix,
the step of performing multiple co-linearity test on each candidate variable based on each first candidate model parameter and each second candidate model parameter to obtain multiple co-linearity test results includes:
performing hash coding on each first model parameter matrix to obtain each first hash coding matrix;
performing hash coding on each second model parameter matrix to obtain each second hash coding matrix;
and performing multiple co-linear tests on the candidate variables based on the first hash coding matrixes and the second hash coding matrixes to obtain multiple co-linear test results.
4. The model building optimization method of claim 3, wherein the step of performing a multiple co-linearity test on each candidate variable based on each first hash-coding matrix and each second hash-coding matrix to obtain the multiple co-linearity test result comprises:
calculating the matrix similarity of a first Hash coding matrix corresponding to each candidate variable and a second Hash coding matrix corresponding to each candidate variable;
and comparing the similarity of each matrix with a preset similarity threshold value, and performing multiple co-linearity test on each candidate variable to obtain multiple co-linearity test results.
5. The model build optimization method of claim 3, wherein the first hash-coding matrix comprises a binary hash-coding matrix,
the step of performing hash coding on each first model parameter matrix to obtain each first hash coding matrix includes:
obtaining each bit value in each first model parameter matrix;
and respectively carrying out binary hash coding on each first model parameter matrix based on the positive and negative signs of each bit value to obtain each binary hash coding matrix.
6. The model build optimization method of claim 3, wherein the first hash-coding matrix comprises a three-valued hash-coding matrix,
the step of performing hash coding on each first model parameter matrix to obtain each first hash coding matrix includes:
obtaining each bit value in each first model parameter matrix;
and respectively carrying out three-value Hash coding on each first model parameter matrix based on the size of the bit numerical value to obtain each three-value Hash coding matrix.
7. The model building optimization method of claim 1, wherein the step of optimizing the model to be trained based on the multiple collinearity detection results to obtain a target modeling model comprises:
judging whether multiple collinear variables exist in the candidate variable pool or not based on the multiple collinear detection result;
if so, removing the multiple co-linear variables from the candidate variable pool, and returning to the step of adding each candidate variable in the candidate variable pool to the model to be trained respectively for iterative training;
and if the model does not exist, taking the model to be trained with the second candidate model parameters as the target modeling model.
8. A model building optimization apparatus, characterized in that the model building optimization apparatus comprises:
the first iterative training module is used for acquiring a candidate variable pool and a model to be trained, and adding each candidate variable in the candidate variable pool into the model to be trained respectively for iterative training to acquire a first candidate model parameter corresponding to each candidate variable;
the second iterative training module is used for adding all the candidate variables into the model to be trained together for iterative training to obtain second candidate model parameters corresponding to all the candidate variables;
a co-linearity checking module, configured to perform multiple co-linearity checking on each candidate variable based on each first candidate model parameter and each second candidate model parameter, so as to obtain multiple co-linearity checking results;
and the optimization module is used for optimizing the model to be trained based on the multiple collinearity detection result to obtain a target modeling model.
9. A model building optimization apparatus, characterized in that the model building optimization apparatus comprises: a memory, a processor, and a program stored on the memory for implementing the model building optimization method,
the memory is used for storing a program for realizing the model construction optimization method;
the processor is configured to execute a program implementing the model building optimization method to implement the steps of the model building optimization method according to any one of claims 1 to 7.
10. A readable storage medium having stored thereon a program for implementing a model building optimization method, the program being executed by a processor to implement the steps of the model building optimization method according to any one of claims 1 to 7.
CN202011624051.3A 2020-12-30 2020-12-30 Model construction optimization method, device, equipment and readable storage medium Pending CN112712181A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011624051.3A CN112712181A (en) 2020-12-30 2020-12-30 Model construction optimization method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011624051.3A CN112712181A (en) 2020-12-30 2020-12-30 Model construction optimization method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112712181A true CN112712181A (en) 2021-04-27

Family

ID=75547581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011624051.3A Pending CN112712181A (en) 2020-12-30 2020-12-30 Model construction optimization method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112712181A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468237A (en) * 2021-06-11 2021-10-01 北京达佳互联信息技术有限公司 Business data processing model generation method, system construction method and device
CN115684570A (en) * 2022-08-02 2023-02-03 首都医科大学附属北京朝阳医院 Infectious disease detection apparatus, device, system, medium, and program product
CN113468237B (en) * 2021-06-11 2024-05-17 北京达佳互联信息技术有限公司 Business data processing model generation method, system construction method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468237A (en) * 2021-06-11 2021-10-01 北京达佳互联信息技术有限公司 Business data processing model generation method, system construction method and device
CN113468237B (en) * 2021-06-11 2024-05-17 北京达佳互联信息技术有限公司 Business data processing model generation method, system construction method and device
CN115684570A (en) * 2022-08-02 2023-02-03 首都医科大学附属北京朝阳医院 Infectious disease detection apparatus, device, system, medium, and program product
CN115684570B (en) * 2022-08-02 2024-04-12 首都医科大学附属北京朝阳医院 Infectious disease detection device, apparatus, system, medium, and program product

Similar Documents

Publication Publication Date Title
JP2022103040A (en) Image defect detection method, device, electronic apparatus, storage medium, and product
CN110728328B (en) Training method and device for classification model
CN112527676A (en) Model automation test method, device and storage medium
CN110969600A (en) Product defect detection method and device, electronic equipment and storage medium
CN115618269A (en) Big data analysis method and system based on industrial sensor production
CN115098292B (en) Method and device for identifying root cause of application program crash and electronic equipment
CN111768247A (en) Order-placing rate prediction method, device and readable storage medium
CN112966754B (en) Sample screening method, sample screening device and terminal equipment
CN112712181A (en) Model construction optimization method, device, equipment and readable storage medium
CN111327946A (en) Video quality evaluation and feature dictionary training method, device and medium
CN114169460A (en) Sample screening method, sample screening device, computer equipment and storage medium
CN116166967B (en) Data processing method, equipment and storage medium based on meta learning and residual error network
CN113761845A (en) Text generation method and device, storage medium and electronic equipment
CN115934484B (en) Diffusion model data enhancement-based anomaly detection method, storage medium and apparatus
CN114741697B (en) Malicious code classification method and device, electronic equipment and medium
CN112528500B (en) Evaluation method and evaluation equipment for scene graph construction model
CN116243883A (en) Test excitation generation method, test method and related equipment
Puchala et al. Numerical accuracy of integral images computation algorithms
US11177018B2 (en) Stable genes in comparative transcriptomics
CN116612474B (en) Object detection method, device, computer equipment and computer readable storage medium
CN109766255B (en) Equipment state analysis method and device, storage medium and electronic equipment
CN113656279B (en) Code odor detection method based on residual network and metric attention mechanism
CN114881864B (en) Training method and device for seal restoration network model
CN113139187B (en) Method and device for generating and detecting pre-training language model
US20220076148A1 (en) Information processing device and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination