SHAP-based new classical circumferential viscous moment interpretable machine learning method and system
Patent Information
- Application Number
- CN202510899881.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-01
AI Technical Summary
[0002]新经典环向粘滞力矩是托卡马克等离子体物理领域的一个重要概念,其研究对于理解等离子体输运现象、控制等离子体转动以及优化托卡马克装置的设计和运行参数具有重要意义,因此,需要进行快速准确的新经典环向粘滞力矩计算,目前主要有两种方法用于计算新经典环向粘滞力矩:一种是基于物理规律的传统数值模拟程序,另一种是利用数据驱动方式的机器学习模拟程序,考虑到物理建模所需的较高计算成本,机器学习逐渐被应用于国内外托卡马克物理模拟程序的发展中,尽管机器学习在预测新经典环向粘滞力矩方面已取得一定成果,但仍未解决“黑箱”属性导致模型可解释性差的弊端;即机器学习代理模型只知道输入和输出,无法评估每个特征对预测结果的重要性或了解不同特征之间的相互作用关系
本发明能对具有黑盒属性的新经典环向粘滞力矩机器学习模型进行洞悉,挖掘其特征重要性,在保证新经典环向粘滞力矩的快速准确计算的同时兼顾了不同物理特征之间的相互作用关系,保证了预测结果的可解释性,从而实现预测准确度、速度和可解释性之间的平衡,并为三维托卡马克物理实验提供新思路。
Smart Images

Figure CN120409742A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of controlled nuclear fusion model interpretation, and in particular to a SHAP-based neoclassical annular viscous moment interpretable machine learning method and system. Background Art
[0002] Neoclassical toroidal viscous torque is an important concept in the field of tokamak plasma physics. Its research is of great significance for understanding plasma transport phenomena, controlling plasma rotation, and optimizing the design and operating parameters of tokamak devices. Therefore, fast and accurate calculation of neoclassical toroidal viscous torque is needed. Currently, there are two main methods for calculating neoclassical toroidal viscous torque: one is the traditional numerical simulation program based on physical laws, and the other is the machine learning simulation program using data-driven methods. Considering the high computational cost required for physical modeling, machine learning has gradually been applied to the development of tokamak physics simulation programs at home and abroad. Although machine learning has achieved certain results in predicting neoclassical toroidal viscous torque, it has not yet solved the problem of poor model interpretability caused by the "black box" property; that is, the machine learning agent model only knows the input and output, and cannot evaluate the importance of each feature to the prediction result or understand the interaction between different features.
[0003] Therefore, it is crucial to construct an efficient and interpretable neoclassical toroidal viscosity torque model to achieve a balance between prediction accuracy, speed and interpretability, and provide new ideas for three-dimensional tokamak physics experiments. Summary of the Invention
[0004] The purpose of the present invention is to provide a new classical annular viscous moment interpretable machine learning method and system based on SHAP to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions: A new classical annular viscous moment interpretable machine learning method based on SHAP includes the following steps: Step 1: Acquire test data through a nuclear fusion discharge test, wherein the test data includes magnetic field intensity, electron density, electron temperature, ion temperature, rotation frequency, and safety factor; calculate radial gradient values of the test data through radial distribution to obtain radial gradients of electron density, electron temperature, and ion temperature; summarize the test data and radial gradient values into input physical quantities; input the input physical quantities into a neoclassical toroidal viscous torque physical model to obtain output physical quantities, wherein the output physical quantities include electron neoclassical toroidal viscous torque and ion neoclassical toroidal viscous torque; organize the input physical quantities into an input physical quantity data set and associate the corresponding output physical quantities; Step 2: Preprocess the input physical quantity dataset and input the input physical quantity dataset as the training set into the neoclassical annular viscous torque machine learning model. Use the output physical quantity as the label of the input physical quantity and calibrate it to the actual value. Evaluate the neoclassical annular viscous torque machine learning model through the mean square error, mean absolute error, and determination coefficient between the model output value and the actual value. Set the mean square error, mean absolute error, and determination coefficient thresholds. Once the threshold conditions are met, the neoclassical annular viscous torque machine learning model is determined to be obtained. Step 3: Use the PFI method and the SHAP method to determine the importance ranking of each feature in the input physical quantity data set in the neoclassical annular viscous torque machine learning model. The two rankings are judged by the Spearman rank correlation coefficient. The Spearman rank correlation coefficients that meet the conditions are determined to have the same ranking. For the Spearman rank correlation coefficients that do not meet the conditions, the features with different rankings are judged by the importance value. The model with an importance value greater than the limit is retrained until a model with the same feature ranking is obtained. Step 4: Combine the importance feature rankings determined by the PFI method and the SHAP method to form an overall ranking, and draw the beeswax diagram and interaction diagram of the top features in the overall ranking.
[0006] Furthermore, test data is obtained through a nuclear fusion discharge test, the test data including magnetic field intensity, electron density, electron temperature, ion temperature, rotation frequency, and safety factor. The radial gradient value of the test data is calculated through radial distribution to obtain the radial gradient of electron density, the radial gradient of electron temperature, and the radial gradient of ion temperature. The test data and the radial gradient values are summarized into input physical quantities. The output physical quantities include the neoclassical toroidal viscous torque of electrons and the neoclassical toroidal viscous torque of ions. The output physical quantities are calculated by inputting the input physical quantities into the neoclassical toroidal viscous torque physical model. The input physical quantities are organized into a data set, and the output physical quantities are organized into labels corresponding to each sample of the input physical quantities: ; in, is the i-th group of input samples, i is the sample group retrieval sequence, , B is the magnetic field strength, Ne is the electron density, dNe is the radial gradient of electron density, Te is the electron temperature, dTe is the radial gradient of electron temperature, Ti is the ion temperature, dTi is the radial gradient of ion temperature, is the rotation frequency, q is the safety factor; ; in, is the output physical quantity corresponding to the i-th sample of the input physical quantity data set, i is the sample group retrieval sequence, , DL is the neoclassical toroidal viscosity torque of electrons, and LL is the neoclassical toroidal viscosity torque of ions.
[0007] Furthermore, preprocess the input physical quantity dataset to form feature vectors, fill in the missing values and normalize them, and use them as the training set. Train the neoclassical toroidal viscosity torque machine learning model through the CatBoost algorithm, use the output physical quantity as the label of the input physical quantity, and calibrate it as the actual value. At the same time, evaluate the model performance through the root mean square error, mean absolute error, and coefficient of determination. The basis formulas are as follows: ; ; ; Among them, is the root mean square error, is the mean absolute error, is the coefficient of determination, is the actual value, is the predicted value of the model, is the average value of the actual values, n is the number of samples, i is the result retrieval variable corresponding to the sample, ; Set the thresholds of the root mean square error, mean absolute error, and coefficient of determination respectively. When the root mean square error, mean absolute error, and coefficient of determination all meet the threshold conditions, calibrate and obtain the neoclassical toroidal viscosity torque machine learning model.
[0008] Furthermore, interpret the neoclassical toroidal viscosity torque machine learning model through the TreeEXM method. The TreeEXM method includes the PFI method and the SHAP method. The logic of the PFI method is: Randomly permute one type of feature value in the original input physical quantity data. The random permutation is to randomly shuffle the internal data of this type on the sample sequence and form a replacement dataset. Input the replacement dataset into the neoclassical toroidal viscosity torque machine learning model to generate a new output physical quantity dataset, and calculate the new coefficient of determination in the current model according to the new output physical quantity dataset. The basis formula is as follows: ; Among them, is the first type of actual value of the th sample, is the second type of actual value of the th sample, is the first type of model output value of the th sample, is the The model output of a sample is the output value of the second type of model, which is the average of all the actual values of the first type, which is the average of all the actual values of the second type, where i is the sample retrieval variable, and the first type and the second type are any orderings of the neoclassical toroidal viscosity torque of electrons and the neoclassical toroidal viscosity torque of ions; Calculate the coefficient of determination of each feature in turn and compare the new coefficient of determination with the coefficient of determination. The formula is as follows: ; where is the importance value of the k-th feature, is the new coefficient of determination of the k-th feature, and k is the retrieval variable of the feature, , The SHAP method is as follows: Calculate the Shapley value of each feature in each sample in the neoclassical toroidal viscosity torque machine learning model. The formula is as follows: ; where is the Shapley value of feature i on instance sample x, T is the set of all trees in the model, is the weight of the t-th tree, is the predicted value of the t-th tree for instance sample x when including feature i, is the predicted value of the t-th tree for instance sample x when not including feature i.
[0009] Furthermore, sort the features in the input physical quantity dataset from largest to smallest according to the importance value to form a coefficient of determination ranking. Take the average Shapley value of each feature in the input physical quantity dataset in all samples as the standard and sort from largest to smallest according to the absolute value to form a Shapley value ranking. Judge whether the coefficient of determination ranking and the Shapley value ranking are the same. The logic for judging whether the rankings are the same is as follows: Assign ranks to the internal features of the two rankings respectively. The type with the smallest importance has rank 1, the next has rank 2, and the next has rank 3, and so on. Judge through the Spearman rank correlation coefficient. The formula is as follows: ; where is the Spearman rank correlation coefficient, is the difference in ranks of the i-th feature in the two rankings, n is the number of input parameters, and i is the feature retrieval variable, ; When When , the two rankings are considered to be the same. When it is determined that there are some features with different rankings in the two sortings, the importance values of the features with different rankings are Make a judgment, if , then ignore the different positions of the feature and recognize that the feature is in different positions in the two rankings. If the two rankings are the same, the importance value of the feature with different positions is , if it is determined that there are problems with the new classical annular viscous torque machine learning model, the model parameters are adjusted, the model is retrained, and sorting is performed again according to the PFI method and the SHAP method until two rankings with the same ranking are obtained.
[0010] Furthermore, the determination coefficient ranking and Shapley value ranking that meet the conditions are merged to form a global feature importance ranking. For some features with different rankings in the determination coefficient ranking and the Shapley value ranking, the average of their rankings in the two rankings is selected and arranged into the global feature importance ranking. The top x ranked features are selected for further analysis. A bee swarm diagram is drawn according to the Shapley values of the top x ranked features to analyze the influence trend of the input physical quantity on the output physical quantity, and an interaction diagram is drawn to analyze the coordinated change relationship between the input physical quantities.
[0011] The present invention also includes a SHAP-based neoclassical annular viscous moment interpretable machine learning system for executing the above-mentioned SHAP-based neoclassical annular viscous moment interpretable machine learning method, comprising: Data acquisition module: used to obtain test data through nuclear fusion discharge test, obtain radial gradient value through radial distribution calculation, summarize the test data and radial gradient value into input physical quantity, and input the input physical quantity into the output physical quantity calculated by neoclassical annular viscous torque physical model; Machine learning model generation module: inputs the input physical quantity into the CatBoost algorithm to obtain the new classical annular viscous torque machine learning model; Sorting module: sorts the features of the input physical quantities using the PFI method and the SHAP method, and determines the sorting results; Model interpretation module: used to draw bee swarm diagrams and interaction diagrams for the top-ranked features.
[0012] Compared with the prior art, the present invention has the following beneficial effects: The present invention can gain insights into the neoclassical toroidal viscous torque machine learning model with black-box properties, explore the importance of its features, and while ensuring the fast and accurate calculation of the neoclassical toroidal viscous torque, take into account the interaction between different physical features, ensuring the interpretability of the prediction results, thereby achieving a balance between prediction accuracy, speed and interpretability, and providing new ideas for three-dimensional tokamak physics experiments. Brief Description of the Drawings
[0013] Figure 1 It is a schematic diagram of the overall method flow of the present invention; Figure 2 It is a schematic diagram of the model training process of the present invention; Figure 3 It is a diagram showing the model prediction performance in an embodiment of the present invention; Figure 4 It is a diagram showing the global feature importance ranking of the electron neoclassical toroidal viscosity torque in an embodiment of the present invention; Figure 5 It is a diagram showing the global feature importance ranking of the ion neoclassical toroidal viscosity torque in an embodiment of the present invention; Figure 6 It is a global feature swarm plot of the electron neoclassical toroidal viscosity torque based on SHAP for the neoclassical toroidal viscosity torque in an embodiment of the present invention; Figure 7 It is a global feature swarm plot of the ion neoclassical toroidal viscosity torque based on SHAP for the neoclassical toroidal viscosity torque in an embodiment of the present invention; Figure 8 It is a schematic diagram of the system structure of the present invention. Detailed Description of the Embodiments
[0014] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with specific embodiments.
[0015] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the present invention should have the ordinary meanings understood by those with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar terms used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to represent relative position relationships, and when the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0016] Embodiment 1: Please refer to Figures 1-7 , the present invention provides a technical solution: An interpretable machine learning method for neoclassical toroidal viscosity torque based on SHAP, the specific steps include: Step 1: Acquire test data through a nuclear fusion discharge test, wherein the test data includes magnetic field intensity, electron density, electron temperature, ion temperature, rotation frequency, and safety factor; calculate radial gradient values of the test data through radial distribution to obtain radial gradients of electron density, electron temperature, and ion temperature; summarize the test data and radial gradient values into input physical quantities; input the input physical quantities into a neoclassical toroidal viscous torque physical model to obtain output physical quantities, wherein the output physical quantities include electron neoclassical toroidal viscous torque and ion neoclassical toroidal viscous torque; organize the input physical quantities into an input physical quantity data set and associate the corresponding output physical quantities; The step 1 includes the following: Test data is obtained through a nuclear fusion discharge test, wherein the test data includes magnetic field intensity, electron density, electron temperature, ion temperature, rotation frequency, and safety factor. The radial gradient value of the test data is calculated through radial distribution to obtain the radial gradient of electron density, the radial gradient of electron temperature, and the radial gradient of ion temperature. The test data and the radial gradient value are summarized into input physical quantities. The output physical quantities include the neoclassical toroidal viscous torque of electrons and the neoclassical toroidal viscous torque of ions. The output physical quantities are calculated by inputting the input physical quantities into the neoclassical toroidal viscous torque physical model. The input physical quantities are organized into a data set, and the output physical quantities are organized into labels corresponding to each sample of the input physical quantities: ; in, is the i-th group of input samples, i is the sample group retrieval sequence, , B is the magnetic field strength, Ne is the electron density, dNe is the radial gradient of electron density, Te is the electron temperature, dTe is the radial gradient of electron temperature, Ti is the ion temperature, dTi is the radial gradient of ion temperature, is the rotation frequency, q is the safety factor; ; in, is the output physical quantity corresponding to the i-th sample of the input physical quantity data set, i is the sample group retrieval sequence, , DL is the electron neoclassical toroidal viscous moment, and LL is the ion neoclassical toroidal viscous moment.
[0017] Step 2: Preprocess the input physical quantity dataset and input the input physical quantity dataset as the training set into the neoclassical annular viscous torque machine learning model. Use the output physical quantity as the label of the input physical quantity and calibrate it to the actual value. Evaluate the neoclassical annular viscous torque machine learning model through the mean square error, mean absolute error, and determination coefficient between the model output value and the actual value. Set the mean square error, mean absolute error, and determination coefficient thresholds. Once the threshold conditions are met, the neoclassical annular viscous torque machine learning model is determined to be obtained. Step 2 includes the following contents: Preprocess the input physical quantity dataset, remove outliers, fill in missing values, and normalize the input physical quantity dataset, remove outliers, fill in missing values, and perform logarithmic transformation on the output physical quantity to form a feature vector, fill in missing values and perform normalization. Use the input physical quantity dataset as the training set, train a new classical toroidal viscous torque machine learning model through the CatBoost algorithm, use the output physical quantity as the label of the input physical quantity, and calibrate it as the actual value. At the same time, evaluate the model performance through the root mean square error, mean absolute error, and coefficient of determination. The basis formulas are as follows: ; ; ; where is the root mean square error, is the mean absolute error, is the coefficient of determination, is the actual value, is the predicted value of the model, is the average value of the actual values, n is the number of samples, i is the result retrieval variable corresponding to the sample, ; Set the thresholds of the root mean square error, mean absolute error, and coefficient of determination respectively. When the root mean square error, mean absolute error, and coefficient of determination all meet the threshold conditions, calibrate to obtain a new classical toroidal viscous torque machine learning model.
[0018] Step 3: Use the PFI method and the SHAP method respectively to determine the importance ranking of each feature in the input physical quantity dataset in the new classical toroidal viscous torque machine learning model. Judge the two rankings through the Spearman rank correlation coefficient. For the Spearman rank correlation coefficient that meets the conditions, recognize the same ranking. For the Spearman rank correlation coefficient that does not meet the conditions, judge the features with different positions through the importance value. Retrain the model with an importance value greater than the limit until a model with the same feature ranking is obtained; Step 3 includes the following contents: Step 301: Interpret the new classical toroidal viscous torque machine learning model through the TreeEXM method. The TreeEXM method includes the PFI method and the SHAP method. The logic of the PFI method is: Randomly permute a type eigenvalue in the original input physical quantity data. The random permutation is to randomly shuffle the internal data of this type in the sample sequence and form a replacement data set. Input the replacement data set into the new classical toroidal viscous torque machine learning model to generate a new output physical quantity data set, and calculate the new coefficient of determination in this model based on the new output physical quantity data set , and the formula is as follows: ; Among them, is the actual value of the first type of the th sample, is the actual value of the second type of the th sample, is the model output value of the first type of the th sample, is the model output value of the second type of the th sample, is the average value of all actual values of the first type, is the average value of all actual values of the second type, and i is the sample retrieval variable, , and the first type and the second type are any sorting of the electron new classical toroidal viscous torque and the ion new classical toroidal viscous torque; Calculate the coefficient of determination of each feature in turn , and compare the new coefficient of determination with the coefficient of determination. The formula is as follows: ; Among them, is the importance value of the kth feature, is the new coefficient of determination of the kth feature, and k is the retrieval variable of the feature, , Step 302: The SHAP method is as follows: Calculate the Shapley value of each feature in each sample in the new classical toroidal viscous torque machine learning model. The formula is as follows: ; Among them, is the Shapley value of feature i on the instance sample x, T is the set of all trees in the model, is the weight of the tth tree, is the predicted value of the tth tree for the instance sample x when including feature i, is the predicted value of the tth tree for the instance sample x when not including feature i.
[0019] Step 303: Sort the features in the input physical quantity dataset by importance value from large to small to form a determination coefficient ranking. Use the average Shapley value of each feature in all samples in the input physical quantity dataset as a standard and sort them by absolute value from large to small to form a Shapley value ranking. Determine whether the determination coefficient ranking and the Shapley value ranking are the same. The logic for determining whether the rankings are the same is as follows: The two sorted internal features are assigned ranks respectively. The least important type has a rank of 1, the next is 2, the next is 3, and so on. The Spearman rank correlation coefficient is used for judgment. The formula is as follows: ; in is the Spearman rank correlation coefficient, is the difference in rank between the two sorts of the i-th feature, n is the number of input parameters, i is the feature retrieval variable, ; when When , the two rankings are considered to be the same. When it is determined that there are some features with different rankings in the two sortings, the importance values of the features with different rankings are Make a judgment, if , then ignore the different positions of the feature and recognize that the feature is in different positions in the two rankings. If the two rankings are the same, the importance value of the feature with different positions is , if it is determined that there are problems with the new classical annular viscous torque machine learning model, the model parameters are adjusted, the model is retrained, and sorting is performed again according to the PFI method and the SHAP method until two rankings with the same ranking are obtained.
[0020] Step 4: Combine the importance feature rankings determined by the PFI method and the SHAP method to form an overall ranking, and draw the beeswax diagram and interaction diagram of the top features in the overall ranking.
[0021] The step 4 includes the following contents: The determination coefficient ranking and Shapley value ranking that meet the conditions are merged to form a global feature importance ranking. For some features with different rankings in the determination coefficient ranking and Shapley value ranking, the average of their rankings in the two rankings is selected and arranged into the global feature importance ranking. The top x features are selected for further analysis. The bee swarm diagram is drawn according to the Shapley values of the top x features to analyze the influence trend of the input physical quantity on the output physical quantity, draw the interaction diagram, and analyze the coordinated change relationship between the input physical quantities.
[0022] Each point in the swarm plot represents a sample. The position of its abscissa is determined by the Shapley value, and the color is determined by the magnitude of the input parameter value. The larger the input parameter value, the darker the color, and vice versa. The accumulation of points will form a density. Based on the point accumulation density and color distribution, analyze the influence trend of the input parameters of the neoclassical toroidal viscosity torque on the output and preliminarily judge their interaction effects; Use the SHAP method to analyze the co-variation relationship between the input parameters of the neoclassical toroidal viscosity torque by drawing an interaction plot of the input parameters. Specifically, taking one input parameter as a benchmark, select another input parameter for coloring; each point in the interaction plot represents a sample. The abscissa of the point is determined by the value of the benchmark input parameter, the ordinate of the point is determined by the Shapley value of the benchmark input parameter, and the color of the point is determined by the value of the selected input parameter for coloring. The larger the value of the colored input parameter, the darker the color of the point. Based on the color distribution and aggregation degree of the points, analyze the co-variation relationship between the two input parameters.
[0023] Please refer to Figure 8 , the present invention also includes a SHAP-based interpretable machine learning system for neoclassical toroidal viscosity torque, which is used to execute the above-mentioned SHAP-based interpretable machine learning method for neoclassical toroidal viscosity torque, including: Data acquisition module: used to obtain test data through nuclear fusion discharge experiments, obtain radial gradient values through radial distribution calculations, summarize the test data and radial gradient values into input physical quantities, and input the input physical quantities into the neoclassical toroidal viscosity torque physical model to calculate the output physical quantities; Machine learning model generation module: input the input physical quantities into the CatBoost algorithm to obtain the neoclassical toroidal viscosity torque machine learning model; Sorting module: sort the features in the input physical quantities through the PFI method and the SHAP method, and judge the sorting results; Model interpretation module: used to draw a swarm plot and an interaction plot for the features with higher rankings.
[0024] Example 2, please refer to Figures 3-7 : Take the features in the input physical quantities as input features and splice them into an input vector ; take the output physical quantity as the output feature and splice it into an output vector , make an input-output pair containing 568,750 groups of samples ( ), perform data processing on the input vector , including outlier removal, missing value filling, and data normalization. The method of data normalization is as follows: ; where is the original data, is the data after normalization, represents the th input feature, , represents finding the maximum value among all samples, represents finding the minimum value among all samples.
[0025] Perform data processing on the output vector , including outlier removal, missing value filling, and logarithmic transformation. The logarithmic transformation method is as follows: ; where is the original data, is the data after data preprocessing, represents the th output feature, ; As a preferred embodiment, train the Catboost model according to the new classical toroidal viscosity torque dataset. The Catboost model is an efficient gradient boosting decision tree framework. Set the number of iterations to 2000, the learning rate to 0.36, the maximum depth of the tree to 6, and use the multi-output root mean square error loss function as the optimization objective function. Its formula is as follows: ; where represents the predicted value of the model for the i-th sample in the d-th dimension, represents the true value of the i-th sample in the d-th dimension, dim is the number of dimensions of the output vector, and N is the number of samples, .
[0026] Then optimize the initial machine learning model on the test set, optimize the model parameters of the constructed basic model, and finally evaluate the final prediction model using three evaluation indicators: root mean square error, mean absolute error, and coefficient of determination on the validation set. If the three indicators do not meet the performance requirements simultaneously, return to the training step to adjust the hyperparameters of the model and retrain and test until the performance requirements are met; randomly select some samples to visually display the differences between the predicted values and actual values of the electron new classical toroidal viscosity torque and ion new classical toroidal viscosity torque; For this example, the root mean square error of the evaluation index of the model is , the mean absolute error is , the coefficient of determination is 0.97, all of which meet the performance requirements. Randomly select some samples to visually display the differences between the predicted values and actual values of the electron new classical toroidal viscosity torque and ion new classical toroidal viscosity torque, Figure 3It shows the comparison of the differences between the predicted and actual values of the neoclassical toroidal viscosity torque of electrons and ions for sample numbers from 224640 to 224705 and from 440700 to 440765. It can be found that the model can accurately predict the neoclassical toroidal viscosity torque of electrons and ions.
[0027] As a preferred embodiment, as Figure 4 shown in the global feature importance ranking diagram of the neoclassical toroidal torque of electrons, this diagram shows the global feature importance ranking of the input features in the input physical quantities for the neoclassical toroidal torque of electrons. Among them, the explanatory power of the safety factor for the neoclassical toroidal viscosity torque of electrons is greater than 0.3, indicating that the neoclassical toroidal viscosity torque of electrons is relatively sensitive to the safety factor. The explanatory power of the electron temperature for the neoclassical toroidal viscosity torque of electrons is greater than 0.3, and the explanatory power of the radial gradient of the electron temperature for the neoclassical toroidal viscosity torque of electrons is greater than 0.2, indicating that the neoclassical toroidal viscosity torque of electrons is highly sensitive to the electron temperature.
[0028] As a preferred embodiment, as Figure 5 shown in the global feature importance ranking diagram of the neoclassical toroidal torque of ions, this diagram shows the global feature importance ranking of the contributions of the features in the NRI to the neoclassical toroidal torque of ions. Among them, the explanatory power of q for the neoclassical toroidal viscosity torque of ions is greater than 0.5, indicating that the neoclassical toroidal viscosity torque of ions is highly sensitive to q. The explanatory power of the electron density Ne for the neoclassical toroidal viscosity torque of ions is greater than 0.3, indicating that the neoclassical toroidal viscosity torque of ions is relatively sensitive to Ne.
[0029] As a preferred embodiment, as Figure 6 shown in the global feature swarm diagram of the neoclassical toroidal viscosity torque based on SHAP, this diagram shows the influence trend of the features in the input physical quantities on the neoclassical toroidal torque of ions. Figure 6 It shows the global feature swarm diagram of the neoclassical toroidal viscosity torque of electrons. For the aggregated parts with large Ti and q feature values, most of the corresponding Shapley values are positive, indicating that Ti and q have a positive correlation with the influence on the neoclassical toroidal viscosity torque of electrons; for the aggregated parts with large dNe, dTe, Ne, most of the corresponding Shapley values are negative, showing a negative correlation with the influence on the neoclassical toroidal viscosity torque of electrons. Figure 7 It shows the global feature swarm diagram of the neoclassical toroidal viscosity torque of ions. For the aggregated parts with large q, Ne, dNe feature values, most of the corresponding Shapley values are negative, having the same negative influence on the neoclassical toroidal viscosity torque of ions; dTi, , Te have a positive correlation with the influence on the neoclassical toroidal viscosity torque of ions.
[0030] As a preferred embodiment, for the neoclassical toroidal viscosity of electrons, where the eigenvalue of Te is smaller and the eigenvalue of q is larger, most of the corresponding Shapley values are negative, indicating that the smaller Te and the larger q significantly inhibit the neoclassical toroidal viscosity of electrons; for the neoclassical toroidal viscosity of ions, on the contrary, the larger Te and the smaller q significantly promote the neoclassical toroidal viscosity of ions.
[0031] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to obtain a formula closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0032] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software methods depends on the specific application and design constraints of the technical solution.
[0033] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units. They can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0034] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application, and all should be covered by the protection scope of this application.
Claims
1. A new classical toroidal viscous torque interpretable machine learning method based on SHAP, characterized in that, The specific steps include: Step 1: Acquire test data through nuclear fusion discharge tests and calculate radial gradient values. Aggregate the test data and radial gradient values into input physical quantities and input them into the neoclassical hoop viscosity torque physical model to obtain output physical quantities. Organize the input physical quantities into an input physical quantity data set and correlate the corresponding output physical quantities. Step 2: Input the input physical quantity dataset as the training set into the new classical annular viscous torque machine learning model, use the output physical quantity as the label of the input physical quantity and calibrate it to the actual value. After training is completed, the new classical annular viscous torque machine learning model is obtained; Step 3: Use the PFI method and the SHAP method to determine the importance ranking of each feature in the input physical quantity data set in the neoclassical annular viscous torque machine learning model. The two rankings are judged by the Spearman rank correlation coefficient. The Spearman rank correlation coefficients that meet the conditions are considered to have the same ranking. Otherwise, the features with different rankings are judged by the importance value. The models with importance values greater than the limit are retrained until a model with the same feature ranking is obtained. Step 4: Combine the importance feature rankings determined by the PFI method and the SHAP method to form an overall ranking, and draw the beeswax diagram and interaction diagram of the top features in the overall ranking.
2. The SHAP-based new classical hoop viscosity moment interpretable machine learning method according to claim 1, characterized in that: Test data is obtained through nuclear fusion discharge tests, the test data including magnetic field intensity, electron density, electron temperature, ion temperature, rotational frequency, and safety factor. The radial gradient values of the test data are calculated through radial distribution to obtain the radial gradient of electron density, the radial gradient of electron temperature, and the radial gradient of ion temperature. The test data and the radial gradient values are summarized into input physical quantities. The output physical quantities are calculated by inputting the input physical quantities into a neoclassical toroidal viscous torque physical model. The output physical quantities include the electron neoclassical toroidal viscous torque and the ion neoclassical toroidal viscous torque. The input physical quantities are organized into a data set, and the output physical quantities are organized into labels corresponding to each sample of the input physical quantities: ; Among them, is the i-th group of input quantity samples, where i is the sample group retrieval sequence, , B is the magnetic field strength, Ne is the electron density, dNe is the radial gradient of the electron density, Te is the electron temperature, dTe is the radial gradient of the electron temperature, Ti is the ion temperature, and dTi is the radial gradient of the ion temperature, is the rotation frequency, and q is the safety factor; ; Among them, is the output physical quantity corresponding to the i-th group of samples of the input physical quantity dataset, and i is the sample group retrieval sequence, , DL is the electron neoclassical toroidal viscosity torque, and LL is the ion neoclassical toroidal viscosity torque.
3. The SHAP-based new classical toroidal viscous torque interpretable machine learning method according to claim 2, characterized in that: The input physical quantity data set is preprocessed to form a feature vector, and missing values are filled and normalized. The vector is used as a training set to train the new classical annular viscous torque machine learning model using the CatBoost algorithm. The output physical quantity is used as the label of the input physical quantity and calibrated to the actual value. The model performance is evaluated by the root mean square error, mean absolute error, and coefficient of determination. The formula is as follows: ; ; ; Among them, is the root mean square error, is the mean absolute error, is the coefficient of determination, is the actual value, is the predicted value of the model, is the average value of the actual values, n is the number of samples, and i is the result retrieval variable corresponding to the sample, ; The thresholds of the root mean square error, mean absolute error and determination coefficient are set respectively. When the root mean square error, mean absolute error and determination coefficient all meet the threshold conditions, the new classical annular viscous torque machine learning model is calibrated.
4. The SHAP-based interpretable machine learning method for the new classical toroidal viscous torque according to claim 3, characterized in that: The new classical annular viscous moment machine learning model is explained by the TreeEXM method, which includes the PFI method and the SHAP method. The logic of the PFI method is: Randomly permute a type eigenvalue in the original input physical quantity data. The random permutation is to randomly shuffle the internal data of this type on the sample sequence and form a replacement data set. Input the replacement data set into the new classical toroidal viscous torque machine learning model to generate a new output physical quantity data set, and calculate the new coefficient of determination in this model based on the new output physical quantity data set , and the formula is as follows: ; Among them, is the actual value of the first type of the th sample, is the actual value of the second type of the th sample, is the model output value of the first type of the th sample, is the model output value of the second type of the th sample, is the average value of all the actual values of the first type, is the average value of all the actual values of the second type, and i is the sample retrieval variable, , where the first type and the second type are any orderings of the electron neoclassical toroidal viscosity torque and the ion neoclassical toroidal viscosity torque; Calculate the coefficient of determination of each feature in sequence , compare the new coefficient of determination with the coefficient of determination, and the basis formula is as follows: ; Among them, is the importance value of the k-th feature, is the new coefficient of determination of the k-th feature, where k is the retrieval variable of the feature, , The SHAP method is as follows: Calculate the Shapley value of each feature in each sample in the new classical toroidal viscous torque machine learning model. The formula is as follows: ; Among them, is the Shapley value of feature i on the instance sample x, T is the set of all trees in the model, is the weight of the t-th tree, is the predicted value of the t-th tree for the instance sample x when including feature i, is the predicted value of the t-th tree for the instance sample x when not including feature i.
5. The SHAP-based interpretable machine learning method for the new classical toroidal viscous torque according to claim 4, wherein: Sort the features in the input physical quantity dataset from largest to smallest according to the importance value to form a coefficient of determination ranking. Take the average Shapley value of each type of feature in the input physical quantity dataset in all samples as the standard, and sort them from largest to smallest according to the absolute value to form a Shapley value ranking. Judge whether the coefficient of determination ranking and the Shapley value ranking are the same. The logic for judging whether the rankings are the same is as follows: Assign ranks to the internal features of the two rankings respectively. The type with the smallest importance has a rank of 1, the next is rank 2, then rank 3, and so on. Judge through the Spearman rank correlation coefficient. The formula is as follows: ; where is the Spearman rank correlation coefficient, is the difference in ranks of the i-th feature in the two rankings, n is the number of input parameters, and i is the feature retrieval variable, ; When it is determined that the two sorts are the same. When it is determined that there are some differences in the positions of features between the two sorts. For the importance values of the features with different positions, make a judgment. If , then ignore the problem of different positions and recognize the different positions of this feature in the two sorts, and determine that the two sorts are the same. If there are importance values for the features with different positions, and it is determined that there is a problem with the new classical toroidal viscosity moment machine learning model, then adjust the model parameters, retrain the model, and sort again according to the PFI method and the SHAP method until two sorts with the same order are obtained.
6. The SHAP-based interpretable machine learning method for the new classical toroidal viscous torque according to claim 5, characterized in that: Merge the coefficient of determination ranking and the Shapley value ranking that meet the conditions to form a global feature importance ranking. For some features with different positions in the coefficient of determination ranking and the Shapley value ranking, select the average value of their positions in the two rankings and arrange them in the global feature importance ranking. Select the top x features for further analysis. Draw a swarm plot based on the Shapley values of the top x features to analyze the influence trend of the input physical quantity on the output physical quantity, and draw an interaction plot to analyze the co-variation relationship between the input physical quantities.
7. A new classical toroidal viscous torque interpretable machine learning system based on SHAP, which is used to execute the new classical toroidal viscous torque interpretable machine learning method according to any one of claims 1-6, characterized in that: Data acquisition module: used to obtain test data through nuclear fusion discharge tests, obtain radial gradient values through radial distribution calculations, summarize the test data and radial gradient values into input physical quantities, and input the input physical quantities into the new classical toroidal viscous torque physical model to calculate the output physical quantities; Machine learning model generation module: input the input physical quantities into the CatBoost algorithm to obtain a new classical toroidal viscous torque machine learning model; Sorting module: sort the features in the input physical quantities through the PFI method and the SHAP method, and judge the sorting results; Model interpretation module: used to draw a swarm plot and an interaction plot for the features with higher rankings.
Citation Information
Patent Citations
Software defect prediction model, interpretation method and quantitative evaluation method
CN117056209A
Machine learning method for Tokamak new classical circumferential viscous torque
CN117371299A
Airborne hydraulic system flow prediction method based on data driving
CN117892192A
Multi-interpretation fusion algorithm for intrusion detection feature analysis
CN118885966A
Novel small-disturbance adversarial attack scheme based on interpretable multi-dimensional time sequence
CN119323246A