watex.utils.mlutils.test_set_check_id#
- watex.utils.mlutils.test_set_check_id(identifier, test_ratio, hash)[source]#
Get the test set id and set the corresponding unique identifier.
Compute the a hash of each instance identifier, keep only the last byte of the hash and put the instance in the testset if this value is lower or equal to 51(~20% of 256) has.digest()` contains object in size between 0 to 255 bytes.
- Parameters:
identifier – integer unique value
ratio – ratio to put in test set. Default is 20%.
hash –
Secure hashes and message digests algorithm. Can be SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet RFC 1321).
Please refer to <https://docs.python.org/3/library/hashlib.html> for futher details.