Press "Enter" to skip to content

Building Random Number Ranges

David Fowler shows how to generate a random number for each record in a result set:



One major use case for this is sampling data sets for model training and testing:  if you pull from a range of 1-10, you could perhaps train against 1-5, cross-validate against 6-7, and test against 8-10.  Doing this instead of TOP X% reduces the likelihood of sampling bias.