-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed missing feature names for XGBoost #93
Conversation
Hey @akhvorov, thank you so much for your PR! The fix is really great 👍 May I please ask you to add a unit test to make sure that the issue is gone? Otherwise I can add one myself in the follow-up PR. |
tests/assemblers/test_xgboost.py
Outdated
utils.train_model_regression(estimator) | ||
|
||
filename = "tmp.file" | ||
if os.path.exists(filename): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test!
May I please ask you to use tmp_dir
utility function to avoid polluting user's workspace. Example can be found here:
m2cgen/tests/e2e/executors/base.py
Line 12 in 00abbff
with utils.tmp_dir() as tmp_dirpath: |
Note that this context manager will clean up the temporary directory automatically so you don't have to do it manually here.
I'd also suggest to use UUID for a filename in place of hardcoded
tmp.file
to avoid potential conflicts, since this particular test should not be affected by artifacts which can potentially be produced by other tests.
Great job otherwise 👍
UPD: You can actually use any filename, since the entire tmp directory will be removed once this test is finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 thanks for making the changes!
Thanks for the contribution 👍 |
Thank you for advices and help! |
Now it's not fail if XGBoost model were saved by save without feature names