Skip to content

Instantly share code, notes, and snippets.

@liezl200
Created June 2, 2016 21:46
Show Gist options
  • Save liezl200/5466c4c5576a1a836b2cc97e245bc330 to your computer and use it in GitHub Desktop.
Save liezl200/5466c4c5576a1a836b2cc97e245bc330 to your computer and use it in GitHub Desktop.
predProb = clf.predict_proba(X)
preds = []
for i in range(len(predProb)):
top5 = predProb[i].argsort()[-5:][::-1]
preds.append(top5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment