The most basic and likely most typical approach for splitting such a dataset is to randomly sample a portion of it. For example, 80 percent of the dataset's rows may be randomly selected for training, while the remaining 20% could be used for testing.
Splitting a dataset can also help you figure out if your model is suffering from underfitting or overfitting, two extremely prevalent difficulties. Underfitting occurs when a model is unable to contain the relationships between variables.