Skip to content

Commit

Permalink
Use arguments, not variables in outer scope
Browse files Browse the repository at this point in the history
  • Loading branch information
odanoburu authored May 29, 2024
1 parent 13200a2 commit 60c6a91
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

0 comments on commit 60c6a91

Please sign in to comment.