# Xgboost take k best predictions

I have a mission of classification with a lot of classes. I am comparing some ML algorithms for this case and I would like to try xgboost. I am writing in python and I am trying to get the best 3 predictions using this algorithm but I couldn't find any method in xgboost API the fits what I want

Any recommendations ?

After processing your data , use xgb.fit(X,y) and then xgb.predict_proba(X_test), you will get probabilities of each class for each data point. Next you need to apply probability calibration to get somewhat usable probabilities. Then pick your 3 highest probas, and your data point will most likely have a label of one of those classes.