sdv.tabular.copulas.GaussianCopula.sample¶

GaussianCopula.sample(num_rows=None, max_retries=100, max_rows_multiplier=10, conditions=None, float_rtol=0.01, graceful_reject_sampling=False)

Sample rows from this table.

Parameters
• num_rows (int) – Number of rows to sample. If not given the model will generate as many rows as there were in the data passed to the fit method.

• max_retries (int) – Number of times to retry sampling discarded rows. Defaults to 100.

• max_rows_multiplier (int) – Multiplier to use when computing the maximum number of rows that can be sampled during the reject-sampling loop. The maximum number of rows that are sampled at each iteration will be equal to this number multiplied by the requested num_rows. Defaults to 10.

• conditions (pd.DataFrame, dict or pd.Series) – If this is a dictionary/Series which maps column names to the column value, then this method generates num_rows samples, all of which are conditioned on the given variables. If this is a DataFrame, then it generates an output DataFrame such that each row in the output is sampled conditional on the corresponding row in the input.

• float_rtol (float) – Maximum tolerance when considering a float match. This is the maximum relative distance at which a float value will be considered a match when performing reject-sampling based conditioning. Defaults to 0.01.

• graceful_reject_sampling (bool) – If False raises a ValueError if not enough valid rows could be sampled within max_retries trials. If True prints a warning and returns as many rows as it was able to sample within max_retries. Defaults to False.

Returns

Sampled data.

Return type

pandas.DataFrame

Raises
• ConstraintsNotMetError – If the conditions are not valid for the given constraints.

• ValueError – If any of the following happens: * any of the conditions’ columns are not valid. * graceful_reject_sampling is False and not enough valid rows could be sampled within max_retries trials. * no rows could be generated.
{"ft_lang_label":"__label__en","ft_lang_prob":0.84105664,"math_prob":0.98509955,"size":1771,"snap":"2022-05-2022-21","text_gpt3_token_len":389,"char_repetition_ratio":0.116015844,"word_repetition_ratio":0.04964539,"special_character_ratio":0.20609824,"punctuation_ratio":0.09904154,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9884897,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-18T01:20:01Z\",\"WARC-Record-ID\":\"<urn:uuid:8c92c2af-a777-47ae-929e-7c3b07a39ba5>\",\"Content-Length\":\"17597\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:438275c0-3e88-4263-9ff2-f36a594205c5>\",\"WARC-Concurrent-To\":\"<urn:uuid:e290bf2f-afce-4525-8348-cdbfa4b7b892>\",\"WARC-IP-Address\":\"185.199.109.153\",\"WARC-Target-URI\":\"https://sdv.dev/SDV/api_reference/tabular/api/sdv.tabular.copulas.GaussianCopula.sample.html\",\"WARC-Payload-Digest\":\"sha1:EMNX7O3FUJXI65PEWS7MWQCNZUQ2WS5S\",\"WARC-Block-Digest\":\"sha1:E5IDHJEM3EY2CWCQGTJYMJWDV33VASJM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320300658.84_warc_CC-MAIN-20220118002226-20220118032226-00170.warc.gz\"}"}