I have a small dataset consisting of 1000 observations (rows), 11 predictors + 1 response (12 columns). It is a toy dataset used for learning purposes in a machine learning class at university -- binary classification (heart disease vs. no heart disease).
I have fitted a logistic regression, SVM, and KNN.
However, I am using python and I was deleting some rows corresponding to missing values and outliers I did not want to consider -- doing it with
df.drop() and then
reset_index(). If you do not set the drop flag of
true you will get a column in your data frame with the indices you wanted to reset. I accidentally forgot to set the flag to
true and when fitting the 3 mentioned models included the column with these indices. This gave me an f1-score of 99-100%. When I realized that I had accidentally included this column, I dropped the column, re-fit and achieved ~ 60-80 percent F1 score with the respective models.
Is there a reason why including this column of indices gets you to 100% F1 score or even accuracy? Is this merely a coincidence that apparently works with the dataset?