Student score prediction system and method based on interpretable model and related equipment
Optimizing the GBDT model through iterative updates and hybrid loss functions, combined with SHAP value calculation, solves the problems of poor interpretability and low computational efficiency of the GBDT model in student performance prediction, achieving efficient and accurate feature contribution analysis and model training, supporting education decision making.
Patent Information
- Application Number
- CN202410593645.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-09-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The 'black box' nature of the existing GBDT model in student performance prediction makes the decision-making process difficult to explain, and it faces computational efficiency and resource consumption challenges when calculating SHAP values on complex models, making it difficult to provide efficient results without sacrificing model performance. Feature contribution analysis.
An interpretable model method based on iterative updates is adopted to optimize feature selection and model training through hybrid loss functions and SHAP value calculations, reduce the impact of outliers and noise on the model, and improve the model's interpretability and prediction accuracy.
It can improve the interpretability of the model while maintaining the accuracy of model prediction, provide clear feature contribution analysis, improve the robustness and training efficiency of the model, and support scientific decision-making in educational intervention and policy formulation.
Smart Images

Figure CN118690891A
Abstract
Description
Technical Field
[0001] The present invention relates to the application of data analysis and machine learning technology in the field of education, and specifically to a student performance prediction method based on an interpretable model and related equipment. Background Art
[0003] GBDT, as a powerful machine learning algorithm, is widely used in various fields, including education, due to its excellent prediction performance and ability to handle complex nonlinear relationships. However, despite GBDT's excellent performance in prediction accuracy, its "black box" characteristics make the model's decision-making process difficult to explain, which is particularly important in the field of education where prediction results need to be explained and educational decisions need to be made. How to improve the interpretability of the model while maintaining the model's prediction accuracy so that educators and policymakers can understand the reasons behind the model's predictions.
[0004] Among the many factors that may affect student performance, how to effectively identify and select the most critical features to optimize the model's training efficiency and predictive performance. SHAP value, based on the Shapley value of game theory, provides a way for the model to explain the contribution of each feature to the prediction result. Through the SHAP value, it can be revealed which factors have a significant impact on student performance, providing a basis for educational intervention and policy making. However, directly calculating the SHAP value on complex models such as GBDT faces challenges in computational efficiency and resource consumption. For complex models with a large number of features, how to efficiently calculate the SHAP value in order to provide accurate feature contribution analysis without sacrificing model performance. Summary of the invention
[0005] Purpose of the invention: In order to overcome the deficiencies in the prior art, the present invention provides a.
[0006] Technical solution: To achieve the above purpose, the technical solution adopted by the present invention is:
[0007] A student performance prediction method based on an interpretable model includes the following steps:
[0008] Develop a questionnaire, collect student information as a data set, and normalize the data set;
[0009] Build a student performance prediction model based on the normalized data set;
[0010] Iteratively update the student performance prediction model to obtain the final overall prediction model;
[0011] Based on the student information to be predicted, the final overall prediction model is used to give student evaluations and factors that need to be paid attention to in order to improve their grades.
[0012] Preferred: The final overall prediction model is expressed as:
[0013]
[0014] Among them, M(x; Θ) is the overall prediction model, F(x; Θ F ) is the initial prediction model, is the prediction of the decision tree based on the optimal number of features selected in the tth iteration, arg min(ΔP(k′)+λΔT(k′)+uΔC(k′)) is the number of features obtained, η t is the learning rate of the tth round, Θ includes all the parameters of the model, Θ F are the parameters of the initial model decision tree, is the parameter of the t-th round decision tree, P is the accuracy of the model on the training set and the validation set, T is the training time of the model, C is the complexity of the model, k′ is the number of features considered for selection, ΔP(k′) is the change in model performance when k′ features are selected, ΔT(k′) is the change in model training time, ΔC(k′) is the change in model complexity, λ is the weight parameter for the change in training time, and u is the weight parameter for the change in complexity.
[0015] Preferably: constructing a student performance prediction model includes calculating an initial prediction value, the formula is:
[0016]
[0017] Among them, F0(x) is the predicted value of the initial model, y i is the score, and N is the total number of samples.
[0018] Preferred: Calculate the residual between the predicted value of the previous round of the student score prediction model and the true target value, build the first round of decision trees, use the SHAP model to calculate the contribution of each feature of the constructed student score prediction model, and remove the feature values with larger absolute values as candidate features for calculating the split point in subsequent iterations;
[0019] SHAP j =∑[f(x)-f(s)] / C(P,Q);
[0020] Among them, SHAP j represents the SHAP value of feature j, f(x) is the model's prediction for sample x, f(s) is the model's prediction without feature j, C(P,Q) is the number of combinations, P represents the total number of all features, and Q represents the size of the feature subset.
[0021] Preferably, the hybrid loss function used is:
[0022]
[0023] Among them, Mix-L represents the mixed loss function, α represents the weight parameter used to balance the losses of different parts, N represents the total number of samples, and y i represents the true score value of the i-th sample, represents the predicted score value of the prediction model for the i-th sample, w represents the residual clipping threshold, and the update of the model parameters is guided by minimizing this loss function;
[0024] By calculating the negative gradient of the mixed loss function: And as a label, train the next decision tree, h4(x i ) represents the predicted value.
[0025] Preferred: Method for iteratively updating the student performance prediction model:
[0026]
[0027] in, It represents the predicted score value of the student score prediction model after the t+1th iteration. It represents the predicted score value at the tth iteration, η0 represents the basic learning rate, t represents the depth adjustment factor, and d represents the depth of the node tree.
[0028] Preferred: The collected student information includes attendance rate, homework status, class participation, extracurricular activities, learning investment, learning resources and tutoring, sleep status, semester evaluation, study time, and interest in subjects.
[0029] Preferred: Methods for normalizing the dataset:
[0030] Attendance rate: the ratio of attendance days to total days is used as a numerical feature; homework situation: the median of homework grades; class participation: based on the frequency of students' class participation; extracurricular activities: whether there are extracurricular activities; learning investment: the estimated value of learning funds invested; learning resources and tutoring: whether there are learning resources and tutoring; sleep status: the average sleep duration is used as a numerical feature; semester evaluation: the average grade or GPA of the previous semester; study time: the average study time is used as a numerical feature; interest value in the subject.
[0031] A student score prediction system based on an interpretable model adopts a student score prediction method based on an interpretable model, including an input module, a normalization processing module, and a final overall prediction model module, wherein:
[0032] The input module is used to input student information;
[0033] The normalization processing module is used to perform normalization processing on the input student information;
[0034] The final overall prediction model module is used to provide student evaluation and factors that need to be paid attention to in improving the performance of the student information to be predicted through the final overall prediction model.
[0035] An electronic device comprises: at least one processor, at least one memory and a communication interface; the processor, memory and communication interface communicate with each other; the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the student performance prediction method based on an interpretable model.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention fully considers the data set collection method and the features required to be included, and can effectively reduce the impact of outliers and noise on model training. This hybrid loss function enables the model to more accurately capture the true relationship in the data, thereby improving the accuracy of student performance prediction. The model of the present invention is more robust to outliers and noise in the data, and can maintain stable prediction performance under various data conditions. The present invention can more effectively guide the training process of the model. Compared with a single loss function, the hybrid loss function provides more comprehensive error feedback, which helps the model converge to the optimal solution faster, thereby optimizing training efficiency. The present invention also includes using SHAP values to explain the contribution of features at different stages of model training, which not only helps to understand the prediction logic of the model, but also reduces the overhead required for subsequent model iterations, and provides a scientific basis for subsequent feature selection and model optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 An overall flow chart of a method for predicting student scores based on an explainable model provided in an embodiment of the present invention.
[0039] Figure 2 A flowchart of model iteration of a method for predicting student performance based on an interpretable model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these examples are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0041] A student performance prediction method based on an interpretable model, such as Figure 1-2 As shown, the following steps are included:
[0042] S1: Collect logistics data sets and normalize them.
[0043] Normalization processing includes that part of the data set is collected from the school's historical database, but the students' personal privacy such as name, ID number, etc. is not extracted. Only the elements that need to be paid attention to are collected, including attendance rate, homework situation, class participation, extracurricular activities, learning investment, learning resources and tutoring, sleep status, semester evaluation, study time, interest in subjects, etc. The other part comes from the designed questionnaire, in which each factor needs to be normalized after collection and sorting to serve as a feature value for model training. Attendance rate: the proportion of attendance days to total days is used as a numerical feature; homework situation: the median of homework grades; class participation: based on the frequency of students' class participation (high, medium, low); extracurricular activities: whether there are extracurricular activities; learning investment: the estimated value of learning funds; learning resources and tutoring: whether there are learning resources and tutoring; sleep status: the average sleep duration is used as a numerical feature; semester evaluation: the average grade or GPA of the previous semester; study time: the average study time is used as a numerical feature; interest in subjects: high, medium, low. Some eigenvalues, such as the interest value of a subject, can be represented by natural integers. Some binary eigenvalues have one category mapped to 0 and the other mapped to 1.
[0044] It is further supplemented that, since the present invention provides multiple parameters to be verified, it is necessary to perform cross-validation steps multiple times, so the collected data set needs to be divided into a training set and a test set at a ratio of 8:2. For example, the SAHP value of the prediction model y1 obtained in the first round of iteration is selected to calculate and a suitable number of feature values are selected as candidate features for subsequent segmentation. The number needs to be finally selected by the cross-validation method, and the goal is to select k features with greater contribution. The formula is:
[0045] k=arg min(ΔP(k′)+λΔT(k′)+uΔC(k′));
[0046] Where k is the number of features, ΔP(k′) is the change in model performance when k′ features are selected, ΔT(k′) is the change in model training time, ΔC(k′) is the change in model complexity, λ is the weight parameter for the change in training time, and u is the weight parameter for the change in complexity.
[0047] The specific steps are to further divide the training set for cross-validation, using 10-fold cross-validation. For each fold of the training set, cross-validation is performed: 1) Divide this fold into a training subset and a validation subset. The training subset is used for model training, and the validation subset is used for model evaluation. 2) Train the GBDT model on the training subset until the early stopping condition is met or the predetermined number of iterations is reached. 3) Use the trained model to calculate the SHAP value on the corresponding training subset to evaluate the contribution of each feature. 4) According to the result of the SHAP value, select the k features with the highest contribution. Use the selected k features to retrain the model on the training subset, and evaluate the model performance on the validation subset, and record the evaluation results. In all cross-validation iterations, count the number of times each feature is selected as an important feature. Select the features that are considered important in most cross-validation iterations as the final feature set. These features have shown high contributions in the training of different subsets. Use the selected feature set to train the GBDT model on the entire training set. Evaluate the performance of the final model on an independent test set to obtain an estimate of the model's generalization ability on unseen data. Analyze the performance of the final model, including indicators such as accuracy, recall, and F1 score. Use SHAP values to analyze the feature contribution of the final model to further understand the basis for model decision making. Since this step is a common step for cross-validation, the subsequent cross-validation steps of the present invention are no longer mentioned.
[0048] S2: Build a prediction model based on the normalized dataset.
[0049] Constructing a student performance prediction model involves calculating the initial prediction value, using the formula:
[0050]
[0051] Where F0(x) is the predicted value of the initial model, y i is the score, and N is the total number of samples.
[0052] The SHAP model is used to calculate the contribution of each feature for the constructed prediction model y1, and the feature values with larger absolute values are removed as candidate features required to calculate the split points in subsequent iterations.
[0053] Calculate the residual between the predicted value of the previous model and the true target value, build the first round of decision trees, and use the SHAP model to calculate the contribution of each feature for the constructed prediction model y1. Remove the feature values with larger absolute values as candidate features for calculating the split points in subsequent iterations. SHAP value calculation can be achieved through Python programming, and the SHAP value can be described by the formula:
[0054] SHAP j =∑[f(x)-f(s)] / C(P,Q);
[0055] Among them, SHAP j represents the SHAP value of feature j, f(x) is the model's prediction for sample x, f(s) is the model's prediction without feature j, C(P,Q) is the number of combinations, P represents the total number of all features, and Q represents the size of the feature subset.
[0056] As a preferred solution of the student performance prediction method based on an interpretable model described in the present invention, the important feature values of the model y1 after the first round of iteration are selected, and the number of selected features needs to be finally selected by the cross-validation method, and the goal is to select k features with greater contribution, and the formula is:
[0057] k=arg min(ΔP(k′)+λΔT(k′)+uΔC(k′));
[0058] Among them, P is the accuracy of the model on the training set and the validation set, T is the training time of the model, C is the complexity of the model, k′ is the number of features considered for selection, ΔP(k′) is the change in model performance when k′ features are selected, ΔT(k′) is the change in model training time, ΔC(k′) is the change in model complexity, and λ and u are weight parameters.
[0059] The iteration of the prediction model is to first calculate the residual between the prediction value of the previous model and the true target value, and then build a new decision tree based on these residuals to fit these residuals. The prediction results of the new tree (i.e. the prediction of the residuals) will be processed and added to the prediction of the current model to form a new round of model prediction, which can be described as:
[0060]
[0061] in, It represents the predicted score value of the student score prediction model after the t+1th iteration. It represents the predicted score value at the tth iteration. η0 is a basic learning rate, which defaults to 0.1 and can be adjusted to a smaller value based on experience. t is the depth adjustment factor, and d is the depth of the node tree. The selection of η0 and t needs to be verified by the ten-fold cross-validation method to avoid underfitting.
[0062] The residual is not obtained by simple subtraction, but by calculating the gradient of the loss function relative to the model prediction, that is, The improved hybrid loss function is used as the standard here, and the formula is as follows:
[0063]
[0064] Mix-L represents the mixed loss function, α represents the weight parameter used to balance the losses of different parts, with a value between 0 and 1, w is the threshold for residual clipping, and y i is the true value of the i-th sample, It represents the predicted score of the prediction model for the i-th sample, and N is the total number of samples. This formula can effectively reduce the impact of extreme values on the loss function, which is conducive to reducing the occurrence of large errors. All error penalties are consistent, which improves the robustness of the model to noise. The update of model parameters is guided by minimizing this loss function. By adjusting the α parameter, a better balance can be found between the bias and variance of the model, further improving the generalization ability of the model on unseen data.
[0065] By calculating the negative gradient of the mixed loss function: And use it as a label to train the next decision tree.
[0066] After the above iterations, we can get the final prediction model, and the overall model can be expressed as:
[0067]
[0068] Among them, F(x; Θ F ) is the initial prediction model, is the prediction of the decision tree based on the optimal number of features selected at the tth iteration, arg min(ΔP(k′)+λΔT(k′)+uΔC(k′)) gives the number of features, η t is the learning rate of the tth round, Θ includes all the parameters of the model, Θ F are the parameters of the initial model decision tree, is the parameter of the t-th round decision tree, P is the accuracy of the model on the training set and the validation set, T is the training time of the model, C is the complexity of the model, k′ is the number of features considered for selection, ΔP(k′) is the change in model performance when k′ features are selected, ΔT(k′) is the change in model training time, ΔC(k′) is the change in model complexity, λ is the weight parameter for the change in training time, and u is the weight parameter for the change in complexity.
[0069] S3: Analyze student performance and provide follow-up education suggestions based on the iterative student performance prediction model
[0070] A module for analyzing student performance based on a student performance prediction model. When a student's performance is in an ideal range, the SHAP value is calculated to obtain features with a positive and large contribution. The results of the SHAP value are used to explain the prediction logic of the model and identify the factors that have the greatest impact on student performance. Although it cannot be arbitrarily determined that these factors lead to excellent performance, it does indicate to a certain extent that the factors have a promoting effect in achieving better results. By revealing the key factors that affect student performance, the present invention provides data support for educational intervention measures and policy formulation. Educators can design targeted strategies to improve students' academic performance based on the results of the model analysis, such as strengthening the teaching of specific knowledge points or providing personalized learning suggestions.
[0071] Deploy the trained model to the production environment for real-time or batch prediction of student scores. Regularly monitor the performance of the model and update the model based on new data or feedback to ensure the accuracy and reliability of the model.
[0072] A student score prediction system based on an interpretable model adopts the student score prediction method based on an interpretable model, including an input module, a normalization processing module, and a final overall prediction model module, wherein:
[0073] The input module is used to input student information.
[0074] The normalization processing module is used to perform normalization processing on the input student information.
[0075] The final overall prediction model module is used to provide student evaluation and factors that need to be paid attention to in improving the performance of the student information to be predicted through the final overall prediction model.
[0076] An electronic device comprises: at least one processor, at least one memory and a communication interface; the processor, memory and communication interface communicate with each other; the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the student performance prediction method based on an interpretable model.
[0077] This system uses the final overall prediction model to analyze student performance. When the student's performance is in the ideal range, the SHAP value is calculated to obtain features with positive and large contribution. Although it cannot be arbitrarily determined that these factors lead to excellent performance, it does indicate to a certain extent that these factors have a promoting effect in achieving better results. By revealing the key factors that affect student performance, the present invention provides data support for educational intervention measures and policy formulation. Educators can design targeted strategies to improve students' academic performance based on the results of the model analysis, such as strengthening the teaching of specific knowledge points or providing personalized learning suggestions.
[0078] experiment
[0079] In this embodiment, in order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments. This embodiment experiments the existing traditional method and the method of this embodiment respectively.
[0080] Table 1 Experimental effect comparison chart
[0081] Evaluation indicators Traditional methods Our invention method Prediction Accuracy (MAE) 1.2 hours 0.45 hours Prediction Accuracy (RMSE) 1.5 hours 0.6 hours Model interpretability (SHAP value) 0.2 0.85 Data utilization efficiency (training time) 1.5 hours 1 hour
[0082] In summary, in terms of prediction accuracy, the mean absolute error (MAE) of our method is only 0.45 hours, which is significantly lower than the 1.2 hours of the traditional method, and the root mean square error (RMSE) is also reduced from 1.5 hours to 0.6 hours, further proving the significant effect of our method in improving prediction accuracy. In addition, in terms of model interpretability, the SHAP value of our method reaches 0.85, which is much higher than the 0.2 of the traditional method, indicating that it has obvious advantages in providing clear and interpretable prediction results. Finally, in terms of data utilization efficiency, the training time of our method is only 1 hour, which is more efficient than the 1.5 hours of the traditional method.
[0083] 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. A student performance prediction method based on an interpretable model, characterized in that: The following steps are involved: Develop a questionnaire, collect student information as a data set, and normalize the data set; Build a student performance prediction model based on the normalized data set; Iteratively update the student performance prediction model to obtain the final overall prediction model; Based on the student information to be predicted, the final overall prediction model is used to give student evaluations and factors that need to be paid attention to in order to improve their grades.
2. The student performance prediction method based on an interpretable model according to claim 1, characterized in that: The final overall prediction model is expressed as: Among them, M(x; Θ) is the overall prediction model, F(x; Θ F ) is the initial prediction model, is the prediction of the decision tree based on the optimal number of features selected at the tth iteration, argmin(ΔP(k′)+λΔT(k′)+uΔC(k′)) is the number of features obtained, η t is the learning rate of the tth round, Θ includes all the parameters of the model, Θ F are the parameters of the initial model decision tree, is the parameter of the t-th round decision tree, P is the accuracy of the model on the training set and the validation set, T is the training time of the model, C is the complexity of the model, k′ is the number of features considered for selection, ΔP(k′) is the change in model performance when k′ features are selected, ΔT(k′) is the change in model training time, ΔC(k′) is the change in model complexity, λ is the weight parameter for the change in training time, and u is the weight parameter for the change in complexity.
3. The student performance prediction method based on an interpretable model according to claim 2, characterized in that: Constructing a student performance prediction model involves calculating the initial prediction value, using the formula: Among them, F0(x) is the predicted value of the initial model, y i is the score, and N is the total number of samples.
4. The student performance prediction method based on an interpretable model according to claim 3, characterized in that: Calculate the residual between the predicted value of the previous round of the student score prediction model and the true target value, build the first round of decision trees, use the SHAP model to calculate the contribution of each feature of the constructed student score prediction model, and remove the feature values with larger absolute values as candidate features for calculating the split point in subsequent iterations; SHAP j =[f(x)-f(s)] / C(P,Q); Among them, SHAP j represents the SHAP value of feature j, f(x) is the model's prediction for sample x, f(s) is the model's prediction without feature j, C(P,Q) is the number of combinations, P represents the total number of all features, and Q represents the size of the feature subset.
5. The student performance prediction method based on an interpretable model according to claim 4, characterized in that: The hybrid loss function used is: Among them, Mix-L represents the mixed loss function, α represents the weight parameter used to balance the losses of different parts, N represents the total number of samples, and y i represents the true score value of the i-th sample, represents the predicted score value of the prediction model for the i-th sample, w represents the residual clipping threshold, and the update of the model parameters is guided by minimizing this loss function; By calculating the negative gradient of the mixed loss function: And as a label, train the next decision tree, h t (x i ) represents the predicted value.
6. The student performance prediction method based on an interpretable model according to claim 5, characterized in that: Method for iteratively updating the student performance prediction model: in, It represents the predicted score value of the student score prediction model after the t+1th iteration. It represents the predicted score value at the tth iteration, η0 represents the basic learning rate, t represents the depth adjustment factor, and d represents the depth of the node tree.
7. The student performance prediction method based on an interpretable model according to claim 6, characterized in that: The student information collected includes attendance rate, homework status, class participation, extracurricular activities, learning investment, learning resources and tutoring, sleep status, semester evaluation, study time, and interest in subjects.
8. The student performance prediction method based on an interpretable model according to claim 7, characterized in that: Methods for normalizing a dataset: Attendance rate: the ratio of attendance days to total days is taken as a numerical feature; Homework: median homework score; Class participation: based on the frequency of students' class participation; Extracurricular activities: whether there are extracurricular activities; Learning investment: estimated value of learning funds invested; Learning resources and tutoring: whether there are learning resources and tutoring; Sleep status: the average sleep duration is used as a numerical feature; semester evaluation: the average grade or GPA of the previous semester; study time: the average study time is used as a numerical feature; Interest value in the subject.
9. A student performance prediction system based on an interpretable model, characterized in that: The student performance prediction method based on an interpretable model as described in any one of claims 1 to 8 comprises an input module, a normalization processing module, and a final overall prediction model module, wherein: The input module is used to input student information; The normalization processing module is used to perform normalization processing on the input student information; The final overall prediction model module is used to provide student evaluation and factors that need to be paid attention to in improving the performance of the student information to be predicted through the final overall prediction model.
10. An electronic device, characterized in that: include: At least one processor, at least one memory and a communication interface; the processor, memory and communication interface communicate with each other; The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the student performance prediction method based on an interpretable model as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Shopping mall building air conditioner cooling load prediction method based on GBDT, storage medium and equipment
CN112001439A
Student score prediction method based on data enhancement
CN116467636A
Crime number prediction method and system based on interpretable machine learning
CN117033923A
Android malicious software escape attack enhancement detection method based on anti-purification strategy
CN117494127A
Logistics timeliness prediction method and system based on interpretable model
CN117973610A
Cited By
AI-based teaching quality evaluation system
CN119539615A
