Closed minghao51 closed 1 year ago
It took me some time to identify the reason for the issue. I discovered that the problem is caused by the naming convention used for parse_expr
in sympy.
To illustrate this, let me provide an example where the first naming convention would raise an exception. However, the following two naming conventions are correct and should be used instead.
from sympy import parse_expr
try:
print(parse_expr('QQ*QD'))
except:
pass
try:
print(parse_expr('Q1*Q2'))
except:
pass
try:
print(parse_expr('X1*X2'))
except:
pass
At the moment, I am unsure how to avoid this problem. Therefore, I hope you to refrain from using the problematic naming convention. Thank you for your understanding.
I was wondering about what naming convention I should follow.
So, I guess it should be:
Would it make sense to have a check for it? or parse the feature_names into compatible ones?
I was wondering about what naming convention I should follow.
So, I guess it should be:
- no double alphabets
- no underscore/space etc
Would it make sense to have a check for it? or parse the feature_names into compatible ones?
That's great advice. I would definitely consider implementing a check in the future.
Description
Once I have more than a certain number of features, the parsing of latex will typically fail during the
get_feature_importance
,While `get_feature_importance(r, simple_version=True) will still work).
There are several types of error though (listing screenshots of what I got).
Seems like issues with parsing the lambda operations into math symbol, sometimes it missed a feature name, sometimes it runs into issues with other lambda description
Any feature naming convention should i follow to avoid these?
Code
To reproduce it with example codes (modifying the tutorial code with more features)