TrainTestSamplesMix#

class TrainTestSamplesMix[source]#

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

Parameters
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.

__init__(n_samples: int = 10000000, n_to_show: int = 10, random_state: int = 42, **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.

Examples#