Skip to content

Commit

Permalink
metrics.py: COSMIT, replaced cryptic np.r_ with np.hstack
Browse files Browse the repository at this point in the history
  • Loading branch information
conradlee authored and amueller committed Nov 14, 2012
1 parent e31376a commit 5c61755
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sklearn/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,11 @@ def precision_recall_curve(y_true, probas_pred):

# Probas_pred typically has many tied values. Here we extract
# the indices associated with the distinct values. We also
# concatenate values onto the ends of the curve.
# concatenate values for the beginning and end of the curve.
distinct_value_indices = np.where(np.diff(probas_pred))[0] + 1
threshold_idxs = np.r_[0,
distinct_value_indices,
len(probas_pred)]
threshold_idxs = np.hstack([0,
distinct_value_indices,
len(probas_pred)])

# Initialize true and false positive counts, precision and recall
total_positive = float(y_true.sum())
Expand Down

0 comments on commit 5c61755

Please sign in to comment.