Mathematical Modeling --- Question C of the 2022 National Competition (2) (full python, complete papers and codes are desirable!)

Then last time we continued with the third question

Question 3: Analyze the chemical composition of the unknown glass cultural relics in the Annex Form 3, identify their type, and analyze the sensitivity of the classification results.

Our analysis:

Based on the classification model of problem 2, calculate the square Euclidean distance between each sample point to be tested and the cluster center, compare it with the ideal distance range between the variable and the cluster center obtained in 2, and complete the classification. By adding a small disturbance to the model, observe The statistical law of the sample data changes, and a sensitivity analysis is given.

Results and Analysis:

The new model has 6 misjudged cases of the data of question 2, and the calculation accuracy rate is 92.5%. The accuracy rate of the judgment cases of the original question 2 is 98.6%, that is, given a disturbance of 10%, the accuracy rate of the model changes by 6.19% and The results of the mean square and significance analysis also confirm the rationality and accuracy of the classification results, and the situation of the original sample points is roughly consistent with the actual classification results, so we believe that the stability of the model is within the controllable range.

Question 4 For different types of glass cultural relic samples, analyze the relationship between their chemical components, and compare the differences in the relationship between the chemical components of different categories.

Our analysis:

We need to give the correlation between the chemical components of the two glass types, and the comparison between the two glass types. We use the gray correlation analysis method. For each subsystem or the factors between the two systems, Gives a measure of the magnitude of the association between variables or subsequences.

Under the premise of two types of high-potassium glass and lead-barium glass, we selected the reference sequence for comparison according to the meaning of the question, and determined the degree of correlation between each subsequence and the reference sequence. The higher the degree of correlation, the greater the correlation. In this question, we select each chemical composition sequence as a reference sequence, calculate the correlation relationship between all sequences cyclically, and use Python to give the final visualization result. Through the results we compare the differences between the two types.

Problem solving process:

1. To determine the object of comparison, we cycle each chemical composition variable as the main reference object of D0, and the number of samples of each type is n, that is, D0 ={ D0k|k=1,2...n } The evaluation standard is 13 chemical composition, that is, there are 13 evaluation objects, Di ={ Dik|k=1,2...n }, i = 1,2...13.
2. Dimensionless and standardized processing of the data to make the data more accurate and reliable, and then we calculate the gray correlation coefficient between subsequences according to the formula:
Among them , ξi is the correlation coefficient between the reference object with the sample as the observation and the evaluation object, and ρ is the resolution coefficient. In this question, we use the mean value to calculate the correlation coefficient. The resolution coefficient is generally 0.5, and min s min tx0t-xs(t) is We take the maximum and minimum values ​​of the difference matrix.
3. Based on the correlation between the chemical components calculated in (2), we use Python 's matplotlib and numpy libraries to preview the results visually, and give the thermodynamic results of high-potassium glass and lead-barium glass respectively, making the results more accurate. Intuitive, conducive to the next analysis.

Results and Analysis:

postscript:

Due to the limited space, I only give part of the analysis and result graphs, the complete Python code and complete papers and data can be commented on the "code" or received by private message! Hope to communicate and learn with you!

The last thing I want to say is that this is a regretful but meaningful experience, and I will update and communicate with you in the follow-up competition. I wish all students like me a better result!

Guess you like

Origin blog.csdn.net/qq_62517226/article/details/128705402