I am doing this challenge on Kaggle and I am trying to use AdaBoost from scikit-learn.

My code is like this:

from sklearn.ensemble import AdaBoostClassifier


Here, train_input, and test_input are of the form:

   Pclass  Sex  Age_band  Family_Size  Fare_cat
0       3    0         2            0         0
1       3    1         2            1         0
2       2    0         3            0         1
3       3    0         1            0         1
4       3    1         1            2         1


while train_labels and test_labels are of the form:

0    0
1    1
2    1
3    1


For some reason, with this model the accuracy is 1:

labels=test_labels.iloc[:, 1].values
print('The accuracy is',metrics.accuracy_score(prediction, labels))


However, when I submit the predictions, the accuracy is only around 0.77.

Any idea why the accuracy on my test data is 1? Am I not using AdaBoostClassifier correctly and it's overfitting?