Skip to content

Commit

Permalink
fixed threhsold charts (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubczakon authored Aug 22, 2019
1 parent 434ecab commit 4838a7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# The short X.Y version
version = '0.12'
# The full version, including alpha/beta/rc tags
release = '0.12.2'
release = '0.12.3'

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

Expand Down
5 changes: 4 additions & 1 deletion neptunecontrib/monitoring/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,10 @@ def _class_metrics_by_threshold(y_true, y_pred_pos, thres_nr=100):


def _get_best_thres(scores_by_thres, name):
best_res = scores_by_thres[scores_by_thres[name] == scores_by_thres[name].max()][['threshold', name]]
if name in ['false_positive_rate', 'false_negative_rate', 'false_discovery_rate']:
best_res = scores_by_thres[scores_by_thres[name] == scores_by_thres[name].min()][['threshold', name]]
else:
best_res = scores_by_thres[scores_by_thres[name] == scores_by_thres[name].max()][['threshold', name]]
position = len(best_res) // 2
result = best_res.iloc[position].to_dict()
return result['threshold'], result[name]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main():

setup(
name='neptune-contrib',
version='0.12.2',
version='0.12.3',
description='Neptune Python library contributions',
author='neptune.ml',
author_email='[email protected]',
Expand Down

0 comments on commit 4838a7e

Please sign in to comment.