Some models are over fitting and some are under fitting, please help me where I am doing wrong
I am getting 100%
accuracy for the below models. can you please advise me where I am doing wrong? If it is due to overfitting then why other models like below do not over-fit the model.
Attached same code for random forest
from sklearn.ensemble import RandomForestClassifier
rf = RandomForestClassifier(random_state = 1)
kfold = StratifiedKFold(n_splits=10, shuffle=True, random_state=seed)
cv_score = cross_val_score(rf, X_train, y_train.values.ravel(), cv=kfold)
cv_score = cross_val_score(rf, X_train, y_train.values.ravel(), cv=kfold)
rf_score = cv_score.mean()
print('Random Forest K-fold Scores:')
print(cv_score)
print()
print('Random Forest Average Score:')
print(rf_score)
Topic ann data-science-model neural-network machine-learning
Category Data Science