Skip to content

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddiazvico committed Feb 6, 2020
1 parent 4d7ba4e commit 5c1d350
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ script:
- python setup.py test
- mkdir docs
- export PYTHONPATH=`pwd`
- sphinx-quickstart -q -p scikit-datasets -a "David Diaz Vico" -v 0.1 -r 0.1.37 -l en --ext-autodoc --ext-viewcode --ext-githubpages --extensions sphinxcontrib.napoleon --no-makefile --no-batchfile docs
- sphinx-quickstart -q -p scikit-datasets -a "David Diaz Vico" -v 0.1 -r 0.1.38 -l en --ext-autodoc --ext-viewcode --ext-githubpages --extensions sphinxcontrib.napoleon --no-makefile --no-batchfile docs
- sphinx-apidoc -o docs/_static/ skdatasets -F -a -l
- travis-sphinx -v build -s docs -n
after_success:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

setup(name='scikit-datasets',
packages=find_packages(),
version='0.1.37',
version='0.1.38',
description='Scikit-learn-compatible datasets',
# long_description=open('README.md', 'r').read(),
author='David Diaz Vico',
author_email='david.diaz.vico@outlook.com',
url='https://github.com/daviddiazvico/scikit-datasets',
download_url='https://github.com/daviddiazvico/scikit-datasets/archive/v0.1.37.tar.gz',
download_url='https://github.com/daviddiazvico/scikit-datasets/archive/v0.1.38.tar.gz',
keywords=['scikit-learn'],
classifiers=['Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
Expand Down
19 changes: 13 additions & 6 deletions skdatasets/utils/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ def run():
if hasattr(data, 'data_test') and (data.data_test is not None):
# Test partition
e.fit(X, y=y)
with NamedTemporaryFile() as tmpfile:
joblib.dump(e, tmpfile.name)
experiment.add_artifact(tmpfile.name, name='estimator.joblib')
try:
with NamedTemporaryFile() as tmpfile:
joblib.dump(e, tmpfile.name)
experiment.add_artifact(tmpfile.name,
name='estimator.joblib')
except Exception as exception:
warn(f'Artifact save failed: {exception}')
experiment.log_scalar('score_mean', e.score(data.data_test,
y=data.target_test))
experiment.log_scalar('score_std', 0.0)
Expand Down Expand Up @@ -124,9 +128,12 @@ def run():
cv=data.outer_cv,
return_train_score=True,
return_estimator=True)
with NamedTemporaryFile() as tmpfile:
joblib.dump(e, tmpfile.name)
experiment.add_artifact(tmpfile.name, name='scores.joblib')
try:
with NamedTemporaryFile() as tmpfile:
joblib.dump(e, tmpfile.name)
experiment.add_artifact(tmpfile.name, name='scores.joblib')
except Exception as exception:
warn(f'Artifact save failed: {exception}')
experiment.log_scalar('score_mean',
np.nanmean(scores['test_score']))
experiment.log_scalar('score_std', np.nanstd(scores['test_score']))
Expand Down

0 comments on commit 5c1d350

Please sign in to comment.