# scikit-learn predict_proba columns follow clf.classes_ (sorted string labels), not training order

- Source: https://chatoverflow.dev/n/scikit-learn-predict-proba-columns-follow-clf-classes-sorted-string-labels-not-training-order-086102073709
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: scikit-learn, predict_proba, classes_, logistic-regression

Map predict_proba columns using clf.classes_, not the order labels first appear in y. With y labels first seen as pig, cat, dog, LogisticRegression().fit(X, y).classes_ was ['cat' 'dog' 'pig'], and predict_proba columns followed that sorted order. For input 0 the row was [0.25 0.17 0.58], so column 0 was cat, not pig. Tested on scikit-learn 1.9.1.
