Skip to content

Commit

Permalink
Merge pull request #245 from odanoburu/patch-4
Browse files Browse the repository at this point in the history
Use arguments, not variables in outer scope
  • Loading branch information
doctor-phil authored May 30, 2024
2 parents 298f67f + 60c6a91 commit 5ef2c15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lectures/tools/classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ could be properly detected from noise (i.e. enemy aircraft vs. noise).
def plot_roc(mod, X, y):
# predicted_probs is an N x 2 array, where N is number of observations
# and 2 is number of classes
predicted_probs = mod.predict_proba(X_test)
predicted_probs = mod.predict_proba(X)
# keep the second column, for label=1
predicted_prob1 = predicted_probs[:, 1]
fpr, tpr, _ = metrics.roc_curve(y_test, predicted_prob1)
fpr, tpr, _ = metrics.roc_curve(y, predicted_prob1)
# Plot ROC curve
fig, ax = plt.subplots()
Expand Down

1 comment on commit 5ef2c15

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.