Skip to content

Commit

Permalink
Fixed memory problem when logging multiple importance charts (#80)
Browse files Browse the repository at this point in the history
* Fixed memory problem when logging multiple importance charts

* version update
  • Loading branch information
Kamil A. Kaczmarek authored Apr 12, 2020
1 parent 262057b commit f027343
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version
version = '0.18'
# The full version, including alpha/beta/rc tags
release = '0.18.2'
release = '0.18.3'

# -- General configuration ---------------------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions neptunecontrib/monitoring/xgboost_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,13 @@ def _log_model(booster, name, npt):


def _log_importance(booster, max_num_features, npt, **kwargs):
try:
import matplotlib.pyplot as plt
except ImportError:
raise ImportError('Please install matplotlib to log importance')
importance = xgb.plot_importance(booster, max_num_features=max_num_features, **kwargs)
npt.log_image('feature_importance', importance.figure)
plt.close('all')


def _log_trees(booster, tree_list, img_name, npt, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def main():

setup(
name='neptune-contrib',
version='0.18.2',
version='0.18.3',
description='Neptune.ai contributions library',
author='neptune.ai',
support='[email protected]',
Expand Down

0 comments on commit f027343

Please sign in to comment.