Feature importance of a polynomial function
7 次查看(过去 30 天)
显示 更早的评论
Hi everyones
I used machien learning models to develop the following equation as the optimum one for my problem.
Y= a*(x1^b)(x2^c)(x3^d)+e*(x1^f)(x2^g)(x3^h)
I want to calculate the importance of X1, X2, X3 in Y calcualtion based on the above-mentioned equation. in the form of percentage. For example, the importance of X1, X2, and X3 are 37.5%, 45.3%, and 17.2% (the sum of all importances is equal to one).
How can I calcualte the importance of each feture?
Thnaks in advanced.
回答(1 个)
C B
2022-12-7
To calculate the importance of each feature in the equation you provided, you can use the coefficients of the equation to determine the contribution of each feature to the predicted output. Since the equation includes exponentiated terms for each feature, you can use the absolute value of the coefficients for each exponentiated term as a measure of the importance of that feature.
For example, in the equation Y = a*(x1^b)(x2^c)(x3^d)+e*(x1^f)(x2^g)(x3^h), the importance of x1 can be calculated as follows:
importance_x1 = abs(a*b) + abs(e*f);
Similarly, the importance of x2 and x3 can be calculated using the coefficients c and d for the first term, and the coefficients g and h for the second term:
importance_x2 = abs(a*c) + abs(e*g);
importance_x3 = abs(a*d) + abs(e*h);
Once you have calculated the importance of each feature, you can normalize the values by dividing them by the sum of all importances to obtain a percentage. For example:
importance_x1_percent = (abs(a*b) + abs(e*f)) / (abs(a*b) + abs(a*c) + abs(a*d) + abs(e*f) + abs(e*g) + abs(e*h));
importance_x2_percent = (abs(a*c) + abs(e*g)) / (abs(a*b) + abs(a*c) + abs(a*d) + abs(e*f) + abs(e*g) + abs(e*h));
importance_x3_percent = (abs(a*d) + abs(e*h)) / (abs(a*b) + abs(a*c) + abs(a*d) + abs(e*f) + abs(e*g) + abs(e*h));
Note that this is just an example, and you may need to modify the code depending on your specific equation and requirements. You may also want to consider other factors, such as the range of values for each feature and the impact of scaling on the importance of each feature. For more information and detailed instructions, please consult a specialist in machine learning and feature importance.
2 个评论
Torsten
2022-12-7
I doubt this can be correct because the independent variables (x1,x2,x3) can be scaled very differently.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!