If you feed your machine learning model the entire dataset, you'll get fake high accuracy. That's because the model memorizes the answers rather than learning patterns—this is called overfitting. The simple fix is the train-test split.
Split your data into a training set (usually 80%) and a test set (20%). The model learns from the training set, but never sees the test set until evaluation. Its true performance is measured by how well it predicts the test set outcomes. This ensures the model is generalizing, not just cheating.
For example, think of a student who memorizes past exam answers instead of understanding the subject. On a new test, they fail. The train-test split forces your model to prove it actually understands the problem.
Master this concept before building any real ML model. It's the foundation of honest accuracy.