Squeeze casting process parameter design method based on improved KNN algorithm based on similarity principle
Through the improved KNN algorithm, the process parameters are designed using extrusion casting process data, and the problem of long-term, high cost and poor adaptability in the existing technology is solved, and the process parameter design is achieved quickly and accurately, which is suitable for a variety of methods. casting.
Patent Information
- Application Number
- CN202111369827.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-11-18
AI Technical Summary
The existing extrusion casting process parameter design method relies on experimental research, which consumes time and is high in cost, has poor adaptability and flexibility, and is difficult to meet the needs of rapid development and rating applications. Theoretical calculation ignores the coupling effect between process parameters, resulting in There are large errors in theory and practice.
Using an improved KNN algorithm based on similar principles, a method suitable for extrusion casting process parameters is designed through extrusion casting process data representation, relevant attribute selection, weight allocation, relative change trend measurement and weighted clustering, and the existing data is directly used. Design new process parameters and skip the cumbersome experimental research process.
It realizes the fast and efficient design of extruded casting process parameters, reduces costs, improves design accuracy, is universal, is suitable for different castings, and saves time and experimental costs.
Smart Images

Figure CN114186357B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a field, and in particular to an extrusion casting process parameter design method of an improved KNN algorithm based on a similarity principle. Background Art
[0002] The process parameters of extrusion casting directly affect the mechanical properties and microstructure of castings. Reasonable process parameters are the premise and key to produce extrusion castings with the above advantages. The existing extrusion casting process parameter design methods mainly include three methods: obtaining process parameters based on experimental research, obtaining process parameters based on experimental data modeling optimization, and theoretical calculation. The method of obtaining process parameters based on experimental research and the method of obtaining process parameters based on experimental data modeling optimization require experiments, rely on experimental data, and can only be used for a single material and casting each time. The material composition and casting geometry are diverse, so their adaptability and flexibility are poor (even for numerical simulation, replacement of castings requires remodeling, mold design, iteration, and time-consuming); and the cost is high, and it takes a long time to obtain process parameters. For the third method, there are currently only some process parameter design formulas, which are mostly for a certain type of casting with uniform characteristics. There are great limitations, ignoring the coupling effect between process parameters, and rarely taking into account the interaction between process parameters, resulting in large errors between theory and practice. It can be seen that the existing process parameter design methods have their own shortcomings and are difficult to meet the needs of rapid development and rating application of extrusion casting process parameters.
[0003] With the advent of the big data era, data has become a means of production. There is an urgent need to strengthen the application of existing extrusion casting process data and build a data-driven process parameter design method based on existing process parameter data to improve the design efficiency of extrusion casting process parameters and reduce costs. This patent follows this background and combines the definition of similarity principle and KNN algorithm based on the principle of extrusion casting to propose an extrusion casting process parameter design method based on existing process data. Summary of the invention
[0004] The purpose of the present invention is to provide an improved KNN algorithm based on similarity principle to design process parameters of extrusion casting, and solve the technical problems mentioned in the background technology. According to the extrusion casting process parameter design method of the present invention, the influencing factors and weights of the extrusion casting process parameters are comprehensively considered to realize the process parameter design of the pouring temperature.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] The squeeze casting process parameter design method based on the improved KNN algorithm of similarity principle comprises the following steps:
[0007] Step 1: Squeeze casting process data representation: For an existing squeeze casting process parameter data set case, it is represented as case = {S i |i=1,2,…,m}, m is the number of data samples, each sample data contains attribute variables of squeeze casting process parameters, material composition data and shape feature data, and the sample attributes are divided into the influencing factors of process parameters X according to their properties. k , where k = 1, 2, ..., t, t represents the number of process influencing factors and the process parameter Y j , where j = 1, 2, ..., n), n represents the number of process parameters, and the data sample S i The corresponding attribute data are x ik and ij The process parameters of extrusion casting include extrusion pressure, pouring temperature and mold preheating temperature.
[0008] Step 2: Obtain the relevant influencing attributes of the designed process parameters, and calculate the specific process parameters Y of the designed target extrusion casting. j , called the target process parameter, and the corresponding value is y oj , the influencing factors of process parameters X k Not all process parameters are Y j The relevant influencing factors of X are obtained by using SVM-RFE algorithm. k Select the relevant attributes that directly affect the process parameters and set them as X c ={X1,X2,…,X s};
[0009] Step 3: Select the target process parameter Y in the squeeze casting process parameter data set case j and its related attributes X c The corresponding data is expressed as case * , based on the entropy weight method and the data set case * Calculate the relevant attribute X selected in step 1 c ={X1,X2,…,X s}, distinguishing X c ={X1,X2,…,X s} for Y j The influence degree of the relevant attributes is obtained by denoting the weight of W = {w1,w2,…,w s};
[0010] Step 4: Perform the relevant attribute X c The relative change trend of the extrusion casting process parameter data is measured and the process data is screened. The corresponding extrusion casting process parameter data is regarded as an N-dimensional variable set. The difference between different process parameter data can be regarded as the result of the movement, change and development of the N-dimensional variable. According to the relevant attributes X selected in step 2c ={X1,X2,…,X s}, calculate and measure the relative change trend of the relevant attributes of the existing process parameter data and the target process parameter to be designed, and select the process parameter data with the closest relative change trend of the relevant attributes to the target process parameter to be designed, set as S * ={S1 * , S2 * , ..., S p *}, p is the number of process parameter data obtained by clustering;
[0011] Step 5: Apply the KNN algorithm to the clustering result S obtained in step 4 * ={S1 * , S2 * , ..., S p *}Weighted clustering, then weighted summation of the clustering results, the summation result is the required process parameter Y j .
[0012] Furthermore, in step 2, the selection process of the relevant attributes of the SVM-RFE algorithm is to import the RFE and SVE function modules from the sklearn.feature_selection and sklearn.svm modules respectively based on the PyCharm platform. The specific process of the SVM-RFE algorithm is to select the influencing factors of the process parameters X k and process parameters Y j As the input data of the model, where k = 1, 2, ..., t, use the feature variables to train the model, calculate the importance ranking standard of each feature variable, remove the least important K features, retain the remaining features, and determine whether the number of remaining features meets the simplicity requirement. If so, select the feature variable from X. k Select process parameter Y j The relevant attributes of X c ={X1,X2,…,X s}, if no double counting is reached.
[0013] Furthermore, the weight allocation process of the relevant attributes based on the entropy weight method in step 3 is:
[0014] Step 3.1, case * Press the formula to form a new matrix O * :
[0015]
[0016] Step 3.2: Use the extreme difference method to convert O *Standardization obtains a new matrix π, and then π is normalized. The extreme difference method and normalization method are as follows:
[0017]
[0018]
[0019] in, O * The element in the i-th row and s-th column; O * Similarly, b is is the i-th row and s-th column element in π, π i ' s is π is The normalized value.
[0020] Step 3.3: Then X c The information entropy of the sth relevant attribute in is defined as:
[0021]
[0022] Step 3.4: Process parameter Y j There are s related attributes, then set the influencing factor X c Process parameter Y j The influence weight is:
[0023]
[0024] E c Influencing factor X c Information entropy.
[0025] Furthermore, in step 4, the process of measuring the relative change trend of the relevant attributes and screening the squeeze casting process data is as follows:
[0026] Step 4.1: Record the relevant attributes X of the target process parameters of the designed target casting c The data is O = {o1, o2, ..., o s}, referred to as target data, according to the difference rate, from case * A group of relatively close data is selected as the comparison benchmark. The principle of selection is to make the benchmark C * The smaller the difference between the values of the corresponding attributes in O, the better;
[0027] Step 4.2: For each Add a row with the associated variable X c Labels of the same dimension Used to record the corresponding data on related attributes {x i1 ,x i2,…,x is} Relative to the benchmark trend, then case * The relevant attribute data {x i1 ,x i2 ,…,x is} and benchmark C * ={c1,c2,…,c s}Each attribute data is compared one by one and marked. If x i1 ≥c1, then is +, otherwise -, and the same comparison is used to measure the relevant attributes of the target data O = {o1, o2, ..., o s}Relative benchmark C * ={c1,c2,…,c s The relative change trend of} is recorded as
[0028] Step 4.3: T i With T O Compare the corresponding elements in one by one to determine T i With T O The relevant attributes in O = {o1, o2, ..., o s} whether the changing trend is the same, if and If both are + or -, then Rewrite to 1, otherwise Rewrite to 0;
[0029] Step 4.4: Label T for the comparison results of the relative change trends of the relevant attributes of all process data for each group of data i Sum and get ST i , which is calculated as follows:
[0030] ST i =∑T i
[0031] ST i The value of is an integer in [0, s], and the maximum value is s.
[0032] Step 4.5: Based on the calculated ST i , divide ST by integer value i Level, the larger the value, the higher the level, the same value ST i Divide into the same level, sort by level in descending order, and select the first K1 levels of ST i The value is the process data in case* corresponding to its subscript i, K1 is a positive integer, 2≤K1≤s, denoted by S * ={S1 *, S2 * , ..., S p *}, p is the number of process data samples obtained.
[0033] Furthermore, in step 5, the clustering and weighted regression processing of the KNN algorithm is as follows:
[0034] Step 5.1: Preprocess the data and use the data normalization method to eliminate the influence of different dimensions between different related attributes, that is, the s related attributes selected in step 2. The specific process is:
[0035]
[0036] Among them, x is For X c The i-th row and s-th column in .
[0037] Step 5.2: Calculate the distance between samples. According to the relevant attribute weights obtained in step 3, the attribute space X is measured by calculating the weighted Euclidean distance. c Internal S * The data samples in X are related to the target casting O c The distance d between each attribute lO , (l=1,2,…,p), and take K process data samples S that are closest to the target casting O according to the size of the distance *′ , the nearest neighbor has the shortest distance, and the distance calculation is as follows:
[0038]
[0039] Among them, x lc For S * The cth attribute value of the lth sample in c is the cth attribute value in the target data O.
[0040] Step 5.3: Put S *′ According to the distance between S and the target sample *′ Each cluster sample is weighted to obtain the weight W of the cluster sample k ={w1 k ,w2 k ,…,w s k}, the sample weight calculation is as follows:
[0041]
[0042] Among them, d i′O For S *′ The distance from the i′th sample to the target data O, YesS *′The weight of the i′th sample;
[0043] Step 5.4: According to the sample weights obtained in step 5.3, the desired process parameters are weighted and summed. The sum result is the designed target process parameter y oj The process parameters are calculated as follows:
[0044]
[0045] The process parameter design method first measures the relative change trend of the relevant variables of the process parameters based on the similarity principle. On this basis, sample data with similar relative change trends of the relevant variables of the target case are extracted. Based on these sample data, KNN clustering is performed and weighted regression is performed on the corresponding parameters in the clustered samples as the process parameter design values of the target case. This design method is based on existing research data and fully refers to and utilizes existing relevant research results. It does not require tedious experimental research and has a high design accuracy of process parameters. Compared with the existing process parameter design methods, it saves a lot of time and experimental costs. This method is universal and is not only suitable for the design of extrusion casting process parameters, but also for parameter design in other similar fields.
[0046] The present invention has the following beneficial effects due to the adoption of the above technical solution:
[0047] The present invention directly uses the existing squeeze casting process parameter data to design the process parameters of new castings, without the need for experiments, with low cost and high efficiency. It not only jumps out of the tedious experimental research process, but also enhances the use of existing data, providing a new data-driven design method for squeeze casting process parameter design; it is not bound to a specific single casting, but can adapt to different castings at the same time, has universality, and can promote the application and development of squeeze casting. It is not only suitable for the design of squeeze casting process parameters, but also has a reference role in the design of process parameters in other similar fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is the overall flow chart of the present invention.
[0049] Figure 2 It is the flow chart of the SVM-RFE algorithm of the present invention.
[0050] Figure 3 It is a schematic diagram of the relative change trend of the characteristic variables of the present invention.
[0051] Figure 4 It is the flow chart of the improved KNN algorithm of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are only for the purpose of enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0053] like Figure 1-4 As shown, a squeeze casting process parameter design method based on an improved KNN algorithm based on similarity principle, the method comprises the following steps:
[0054] Step 1: Representation of squeeze casting process data: For an existing squeeze casting process parameter data set case, it is represented as case = {S i i=1,2,…,m}, m is the number of data samples, each sample data mainly includes attribute variables such as extrusion casting process parameters (extrusion pressure, pouring temperature, mold preheating temperature, etc.), material composition data (such as aluminum) and shape feature data (such as shape complexity). According to the properties, the sample attributes are divided into the influencing factors of process parameters X k (k=1, 2, ..., t), t represents the number of process influencing factors and process parameter Y j (j=1, 2, ..., n), n represents the number of process parameters, data sample S i The corresponding attribute data are x ik and ij .
[0055] Table 4 Squeeze casting process data sample
[0056]
[0057] Step 2: Obtain the relevant influencing attributes of the designed process parameters. j (called target process parameter), the corresponding value is y oj , the influencing factors of process parameters X k Not all process parameters are Y j Therefore, the SVM-RFE algorithm is used to extract the relevant influencing factors from X k Select the relevant attributes (such as material composition) that directly affect the process parameters and set them as X c ={X1,X2,…,X s};
[0058] This example takes the pouring temperature design of the extrusion casting process as a parameter design example. The selection of pouring temperature is mainly affected by the metal liquidus of the extrusion casting material and the casting structure, while the metal liquidus is mainly affected by the material composition. The SVM-RFE algorithm is used to extract the relevant attributes of the pouring temperature in the process data. The model parameter selection of the SVM-RFE algorithm: the kernel function of the SVM selects the linear function, the penalty function C=1, and the number of features is selected as 6.
[0059] The basic process of the algorithm is as follows Figure 2 As shown, the relevant attribute extraction results are shown in Table 5;
[0060] Table 5 Casting temperature related attributes extracted based on SVM-RFE algorithm
[0061]
[0062] Step 3: Select the target process parameter Y in the squeeze casting process parameter data set case j and its related attributes X c The corresponding data is expressed as case * , as shown in Table 2, based on the entropy weight method and the data set case * Calculate the relevant attribute X selected in step 1 c ={X1,X2,…,X s}, distinguishing X c Y j The influence degree of each relevant attribute is obtained by denoting the weight of each relevant attribute as W = {w1,w2,…,w s}; The weight distribution results of the pouring temperature related attributes in Table 5 are shown in Table 6;
[0063] Table 6 Results of weight distribution of pouring temperature related attributes
[0064]
[0065] Specific steps:
[0066] Step 3.1: Case * Press the formula to form a new matrix O * :
[0067]
[0068] Step 3.2: Use the extreme difference method to convert O * Standardize and then perform O * Normalization processing, extreme difference method and normalization method are as follows:
[0069]
[0070]
[0071] in, O * The element in the i-th row and s-th column; O * Similarly, b is is the i-th row and s-th column element in π, π i ' s is π is The normalized value.
[0072] Step 3.3: Then X c The information entropy of the sth relevant attribute in is defined as:
[0073]
[0074] Step 3.4: Process parameter Y j If there are s related attributes, then set the related attribute X c Process parameter Y j The influence weight is:
[0075]
[0076] Step 4: Correlate Attribute X c Measurement of relative change trend and process data screening: According to the relevant attributes X selected in step 2 c ={X1,X2,…,X s}, drawing on the idea of similarity principle, the corresponding extrusion casting process parameter data is regarded as an N-dimensional variable set. The difference between different process parameter data can be regarded as the result of the movement, change and development of N-dimensional variables. The relative change trend of the relevant attributes of the existing process parameter data and the process parameters of the target case to be obtained is measured, and the process parameter data with a higher relative change trend degree of the target case is selected, which is set as S * ={S1 * , S2 * , ..., S p *}, p is the number of process parameter data obtained by clustering in this step, and the relative change trend measurement diagram of related attributes is as follows Figure 3 As shown;
[0077] In step 4, the relative trend of relevant attributes is measured and the squeeze casting process data is screened:
[0078] Note the relevant properties X of the target process parameters of the designed target casting c The data is O = {o1, o2, ..., o s}(hereinafter referred to as target data), according to the difference rate, from case* A group of relatively close data is selected as the comparison benchmark. The principle of selection is to make the benchmark C * The values of the main corresponding attributes in O should not be too different.
[0079] For each Add a row with the associated variable X c Labels of the same dimension Used to record the corresponding data on related attributes {x i1 ,x i2 ,…,x is} relative to the benchmark trend. Then case * The relevant attribute data {x i1 ,x i2 ,…,x is} and benchmark C * ={c1,c2,…,c s}Each attribute data is compared one by one and marked. If x i1 ≥c1, then is "+", otherwise it is "-", the results are shown in Table 3. Similarly, the target data related attributes O = {o1, o2, ..., o s}Relative benchmark C * ={c1,c2,…,c s The relative change trend of} is recorded as
[0080] Table 2 Squeeze casting process data case * Representation
[0081]
[0082] T i With T O Compare the corresponding elements in one by one to determine T i With T O The relevant attributes in O = {o1, o2, ..., o s} have the same changing trend. and If both are "+" or "-", Rewrite to 1, otherwise Rewritten to 0.
[0083] According to each group of data, the label T of the comparison result of the relative change trend of the relevant attributes of all process data in Table 3 i Sum and get ST i , which is calculated as follows:
[0084] STi =∑T i
[0085] ST i The value of is an integer in [0, s], and the maximum value is s.
[0086] According to the calculated ST i , divide ST by integer value i Level, the larger the value, the higher the level, the same value ST i Classify into the same level. In descending order of level, select the ST of the first K1 levels. i The process data in case* corresponding to its subscript i (these data and the target process data have the same or basically the same change trend relative to the benchmark process data), denoted as S * ={S1 * , S2 * , ..., S p *}, p is the number of process data samples obtained.
[0087] Table 3 Squeeze casting process data case * Add Tag T i After the expression
[0088]
[0089] Step 5: Apply the KNN algorithm to the clustering result S obtained in step 4 * ={S1 * , S2 * , ..., S p *}Weighted clustering, then weighted summation of the clustering results, the summation result is the required process parameter Y j .
[0090] In step 5, the clustering and weighted regression processing of the KNN algorithm is as follows:
[0091] Step 5.1: Preprocess the data and use data normalization method to eliminate the influence of different dimensions between different related attributes: (s related attributes selected in step 2)
[0092]
[0093] Among them, x is For X c The i-th row and s-th column in .
[0094] Step 5.2: Calculate the distance between samples. According to the relevant attribute weights obtained in step 3, the attribute space X is measured by calculating the weighted Euclidean distance. cInternal S * The data samples in X are related to the target casting O c The distance d between each attribute lO , (l=1,2,…,p), and select K process data samples S that are closest to the target casting O (i.e., the smallest distance) according to the size of the distance *′ The distance calculation is as follows:
[0095]
[0096] Among them, x lc For S * The cth attribute value of the lth sample in c is the cth attribute value in the target data O.
[0097] Step 5.3: S *′ , according to the distance between S and the target sample *′ Each cluster sample is weighted to obtain the weight W of the cluster sample k ={w1 k ,w2 k ,…,w s k}. The sample weight calculation is as follows:
[0098]
[0099] YesS *′ The weight of the i′th sample.
[0100] Step 5.4: According to the sample weights obtained in step 4.3, the desired process parameters are weighted and summed. The sum result is the process parameter Y of the designed target. j The process parameters are calculated as follows:
[0101]
[0102] According to the processing steps of step 4 and step 5, 80% of the samples are randomly selected as training sets and 20% as test sets using the data in Table 5 and Table 6 obtained in step 2 and step 3. The experiment is repeated five times and the average value is taken as the experimental result. The relative average error and mean square error are used as the algorithm performance evaluation indicators for the experimental results. As shown in the following formula:
[0103]
[0104]
[0105] n is the number of test samples, is the predicted value of the i-th test sample, Yi is the true value of the i-th test sample.
[0106] Through experimental verification, the average error of the pouring temperature designed by this method is only 1.96%, the mean square error is 314.7, and the maximum error of the pouring temperature is controlled within 30°C. The error is very small, which meets the use requirements of the squeeze casting process.
[0107] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. The squeeze casting process parameter design method based on the improved KNN algorithm based on the similarity principle is characterized by: The method comprises the following steps: Step 1: Squeeze casting process data representation: For an existing squeeze casting process parameter data set case, it is represented as case = {S i |i=1,2,…,m}, m is the number of data samples, each sample data contains attribute variables of squeeze casting process parameters, material composition data and shape feature data, and the sample attributes are divided into the influencing factors of process parameters X according to their properties. k , where k = 1, 2, ..., t, t represents the number of process influencing factors and the process parameter Y j , where j = 1, 2, ..., n, n represents the number of process parameters, and the product data sample S i The corresponding attribute data are x ik and ij ,The process parameters of squeeze casting include extrusion pressure, pouring temperature and mold preheating temperature; Step 2: Obtain the relevant influencing attributes of the designed process parameters, and calculate the specific process parameters Y of the designed target extrusion casting. j , called the target process parameter, and the corresponding value is y oj , the influencing factors of process parameters X k Not all process parameters are Y j The relevant influencing factors of X are obtained by using SVM-RFE algorithm. k Select the relevant attributes that directly affect the process parameters and set them as X c ={X1,X2,...,X s }; Step 3: Select the target process parameter Y in the squeeze casting process parameter data set case j and its related attributes X c The corresponding data is expressed as case * , based on the entropy weight method and the case data set * Calculate the relevant attribute X selected in step 1 c ={X1,X2,...,X s }, distinguishing X c ={X1,X2,...,X s } for Y j The influence degree of the relevant attributes is obtained by denoting the weight of W = {w1,w2,...,w s }; Step 4: Perform the relevant attribute X c The relative change trend of the extrusion casting process parameter data is measured and the process data is screened. The corresponding extrusion casting process parameter data is regarded as an N-dimensional variable set. The difference between different process parameter data can be regarded as the result of the movement, change and development of the N-dimensional variable. According to the relevant attributes X selected in step 2 c ={X1,X2,...,X s }, calculate and measure the relative change trend of the relevant attributes of the existing process parameter data and the target process parameter to be designed, and select the process parameter data with the closest relative change trend of the relevant attributes to the target process parameter to be designed, set as S * ={S1 * , S2 * , ..., S p * }, p is the number of process parameter data obtained by clustering; Step 5: Apply the KNN algorithm to the clustering result S obtained in step 4 * ={S1 * , S2 * , ..., S p * }Weighted clustering, then weighted summation of the clustering results, the summation result is the required process parameter Y j ; The clustering and weighted regression processing process of the KNN algorithm is: Step 5.1: Preprocess the data and use the data normalization method to eliminate the influence of different dimensions between different related attributes, that is, the s related attributes selected in step 2. The specific process is: Among them, x is For X c The i-th row and s-th column in ; Step 5.2: Calculate the distance between samples. According to the relevant attribute weights obtained in step 3, the attribute space X is measured by calculating the weighted Euclidean distance. c Internal S * The data samples in X are related to the target casting O c The distance d between each attribute lO , (l=1,2,…,p), and take K process data samples S that are closest to the target casting O according to the size of the distance *′ , the nearest neighbor has the shortest distance, and the distance calculation is as follows: Among them, x lc For S * The cth attribute value of the lth sample in c is the cth attribute value in the target data O; Step 5.3: Put S *′ According to the distance between S and the target sample *′ Each cluster sample is weighted to obtain the weight of the cluster sample The sample weight calculation is as follows: in, YesS *′ The weight of the i′th sample; Step 5.4: According to the sample weights obtained in step 5.3, the desired process parameters are weighted and summed. The sum result is the designed target process parameter y oj The process parameters are calculated as follows:
2. The squeeze casting process parameter design method based on the improved KNN algorithm based on similarity principle according to claim 1 is characterized in that: In step 2, the selection process of the relevant attributes based on the SVM-RFE algorithm is to import the RFE and SVE function modules from the sklearn.feature_selection and sklearn.svm modules respectively based on the PyCharm platform. The specific process of the SVM-RFE algorithm is to select the influencing factors of the process parameters X k and process parameters Y j As the input data of the model, where k = 1, 2, ..., t, use the feature variables to train the model, calculate the importance ranking standard of each feature variable, remove the least important K features, retain the remaining features, and determine whether the number of remaining features meets the simplicity requirement. If so, select the feature variable from X. k Select the relevant attribute X of process parameter Yj c ={X1,X2,...,X s }, if no double counting is reached.
3. The squeeze casting process parameter design method based on the improved KNN algorithm based on similarity principle according to claim 1, characterized in that: The weight allocation process of relevant attributes based on the entropy weight method in step 3 is: Step 3.1, form a new matrix O by case* according to the formula * : Step 3.2: Use the extreme difference method to convert O * Standardization obtains a new matrix π, and then π is normalized. The extreme difference method and normalization method are as follows: in, O * The element in the i-th row and s-th column; O * Similarly, b is is the i-th row and s-th column element in π, π' is is π is Normalized value; Step 3.3: Then X c The information entropy of the sth relevant attribute in is defined as: Step 3.4: Process parameter Y j There are s related attributes, then set the influencing factor X c Process parameter Y j The influence weight is: E c Influencing factor X c Information entropy.
4. The squeeze casting process parameter design method based on the improved KNN algorithm based on similarity principle according to claim 1, characterized in that: In step 4, the process of measuring the relative change trend of relevant attributes and screening the squeeze casting process data is as follows: Step 4.1: Record the relevant attributes X of the target process parameters of the designed target casting c The data is O = {o1, o2, ..., o s }, referred to as target data, according to the difference rate, a group of relatively close data is selected from case* as the comparison benchmark. The principle of selection is to make the benchmark C * The smaller the difference between the values of the corresponding attributes in O, the better; Step 4.2: For each Add a row with the associated variable X c Labels of the same dimension Used to record the corresponding data on related attributes {x i1 ,x i2 ,...,x is } Relative to the benchmark trend, then case * The relevant attribute data {x i1 ,x i2 ,...,x is } and benchmark C * ={c1,c2,...,c s }Each attribute data is compared one by one and marked. If x i1 ≥c1, then is +, otherwise -, and the same comparison is used to measure the relevant attributes of the target data O = {o1, o2, ..., o s }Relative benchmark C * ={c1,c2,...,c s The relative change trend of} is recorded as Step 4.3: T i With T O Compare the corresponding elements in one by one to determine T i With T O The relevant attributes in O = {o1, o2, ..., o s } whether the changing trend is the same, if and If both are + or -, then Rewrite to 1, otherwise Rewrite to 0; Step 4.4: Label T for the comparison results of the relative change trends of the relevant attributes of all process data for each group of data i Sum and get ST i , which is calculated as follows: ST i =ΣT i ST i The value of is an integer in [0, s], the maximum value is s, and i is a positive integer; Step 4.5: Based on the calculated ST i , divide ST by integer value i Level, the larger the value, the higher the level, the same value ST i Divide into the same level, sort by level in descending order, and select the first K1 levels of ST i The value is the process data in case* corresponding to its subscript i, K1 is a positive integer, 2≤K1≤s, denoted by S * ={S1 * , S2 * , ..., S p * }, p is the number of process data samples obtained.
