--create_random_sample
Switch
--create_random_sample percentage [random_seed]
Description
Creates a new table with a random subset of rows from the table specified by -t. New table has _rand appended to the table name.
You must specify the percentage of rows to keep. Optionally you can give a random seed, which is 42 by default.
Argument and Default Value
A percentage as a decimal (e.g. .10 for 10%), followed by an optional integer random seed. Default seed: 42.
Details
Aliased as --create_rand_sample. Runs a random sample query against the table given by -t and materializes the result as a new table named <table>_rand. Unlike --group_freq_thresh, sampling here is row-based, not grouped by -g.
Other Switches
Required Switches:
Example Commands
Example 1: create the table msgs_rand that contains a random 10% of the rows in msgs:
dlatkInterface.py -d dla_tutorial -t msgs --create_random_sample .10
Example 2: create the table blog_outcomes_rand that contains a random 50% of the rows in blog_outcomes with the random seed 567:
dlatkInterface.py -d dla_tutorial -t blog_outcomes --create_random_sample .50 567