TrainTestSamplesMix#

class TrainTestSamplesMix[source]#

Detect samples in the test data that appear also in training data.

Parameters
ignore_case: bool, default True

ignore text case during samples comparison.

remove_punctuation: bool, default True

ignore punctuation characters during samples comparison.

normalize_unicode: bool, default True

normilize unicode characters before samples comparison.

remove_stopwords: bool, default True

remove stopwrods before samples comparison.

ignore_whitespace: bool, default False

ignore whitespace characters during samples comparison.

n_samplesint , default: 10_000_000

number of samples to use for this check.

n_to_showint , default: 10

number of samples that appear in test and training data to show.

random_stateint, default: 42

random seed for all check internals.

max_text_length_for_displayint, default 30

truncate text samples to given length before display.

__init__(ignore_case: bool = True, remove_punctuation: bool = True, normalize_unicode: bool = True, remove_stopwords: bool = True, ignore_whitespace: bool = False, n_samples: int = 10000000, n_to_show: int = 10, random_state: int = 42, max_text_length_for_display: int = 30, **kwargs)[source]#
__new__(*args, **kwargs)#

Methods

TrainTestSamplesMix.add_condition(name, ...)

Add new condition function to the check.

TrainTestSamplesMix.add_condition_duplicates_ratio_less_or_equal([...])

Add condition - require ratio of test data samples that appear in train data to be less or equal to the threshold.

TrainTestSamplesMix.clean_conditions()

Remove all conditions from this check instance.

TrainTestSamplesMix.conditions_decision(result)

Run conditions on given result.

TrainTestSamplesMix.config([...])

Return check configuration (conditions' configuration not yet supported).

TrainTestSamplesMix.from_config(conf[, ...])

Return check object from a CheckConfig object.

TrainTestSamplesMix.from_json(conf[, ...])

Deserialize check instance from JSON string.

TrainTestSamplesMix.metadata([with_doc_link])

Return check metadata.

TrainTestSamplesMix.name()

Name of class in split camel case.

TrainTestSamplesMix.params([show_defaults])

Return parameters to show when printing the check.

TrainTestSamplesMix.remove_condition(index)

Remove given condition by index.

TrainTestSamplesMix.run(train_dataset, ...)

Run check.

TrainTestSamplesMix.run_logic(context)

Run check.

TrainTestSamplesMix.to_json([indent, ...])

Serialize check instance to JSON string.