Skip to content

Commit

Permalink
fixed naming and docstrings (#52)
Browse files Browse the repository at this point in the history
* bumped versions

* fixed varname
  • Loading branch information
jakubczakon authored Sep 13, 2019
1 parent cf07a4a commit f82e921
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# The short X.Y version
version = '0.13'
# The full version, including alpha/beta/rc tags
release = '0.13.1'
release = '0.13.2'

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

Expand Down
12 changes: 6 additions & 6 deletions neptunecontrib/monitoring/fairness.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from neptunecontrib.monitoring.utils import send_figure


def log_fairness_classification_metrics(y_true, y_pred_class, sensitive,
def log_fairness_classification_metrics(y_true, y_pred_class, sensitive_attributes,
favorable_label, unfavorable_label,
privileged_groups, unprivileged_groups,
experiment=None, prefix=''):
Expand All @@ -47,7 +47,7 @@ def log_fairness_classification_metrics(y_true, y_pred_class, sensitive,
Args:
y_true (array-like, shape (n_samples)): Ground truth (correct) target values.
y_pred_class (array-like, shape (n_samples)): Class predictions with values 0 or 1.
sensitive (pandas.DataFrame, shape (n_samples, k)): datafame containing only sensitive columns.
sensitive_attributes (pandas.DataFrame, shape (n_samples, k)): datafame containing only sensitive columns.
favorable_label (str or int): label that is favorable, brings positive value to a person being classified.
unfavorable_label (str or int): label that is unfavorable, brings positive value to a person being classified.
privileged_groups (dict): dictionary with column names and list of values for those columns that
Expand All @@ -66,7 +66,7 @@ def log_fairness_classification_metrics(y_true, y_pred_class, sensitive,
neptune.init()
with neptune.create_experiment():
log_fairness_classification_metrics(y_test, y_test_pred_class, test['race'],
log_fairness_classification_metrics(y_test, y_test_pred_class, test[['race']],
favorable_label='granted_parole',
unfavorable_label='not_granted_parole',
privileged_groups={'race':['Caucasian']},
Expand All @@ -80,15 +80,15 @@ def log_fairness_classification_metrics(y_true, y_pred_class, sensitive,

bias_info = {'favorable_label': favorable_label,
'unfavorable_label': unfavorable_label,
'protected_columns': sensitive.columns.tolist()}
'protected_columns': sensitive_attributes.columns.tolist()}

privileged_info = _fmt_priveleged_info(privileged_groups, unprivileged_groups)

data = pd.DataFrame()
data['ground_truth'] = y_true.values
data['prediction'] = y_pred_class.values
for col in sensitive.columns:
data[col] = sensitive[col].values
for col in sensitive_attributes.columns:
data[col] = sensitive_attributes[col].values

ground_truth_test = _make_dataset(data, 'ground_truth', **bias_info, **privileged_info)
prediction_test = _make_dataset(data, 'prediction', **bias_info, **privileged_info)
Expand Down
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.13.1',
version='0.13.2',
description='Neptune Python library contributions',
author='neptune.ml',
author_email='[email protected]',
Expand Down

0 comments on commit f82e921

Please sign in to comment.