Based on the information I gave above, we see the crc32
function finds the checksum value in memory (of the unique identifier). If we know the unique ID has never changed, then We ensure that crc32(np.int64(identifier)) & 0xffffffff
will
always always return exactly the same numeric value, across all pythonPython versions and platforms.
This simply applies our test_set_checktest_set_check
function to each sample's unique identifiers. Using the apply
methd on a Pandas Series object (here it is one column of a Pandas DataFrame).
- In practice, do you commonly split datasets by idID in this manner?
Not really... Scikit_learn's train_test_split ifScikit-Learn's train_test_split
is often good enough. I think there are many other ways to remove bias and errors from your models before worrying too much about the impact of random splits.
There is also bias in overfitting e.g. in sequential imaging data (think frames of videos) such that the background is consistent, even though the objects you might want to detect are not. Your model will learn what to expect based on the background, which is not robust! HEreHere you might look into using a geographical split (i.e. notnot random at all).