.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "checks_gallery/tabular/train_test_validation/plot_datasets_size_comparison.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_checks_gallery_tabular_train_test_validation_plot_datasets_size_comparison.py: .. _plot_tabular_datasets_size_comparison: Datasets Size Comparison ************************ .. GENERATED FROM PYTHON SOURCE LINES 10-18 .. code-block:: default import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from deepchecks.tabular import Dataset from deepchecks.tabular.checks import DatasetsSizeComparison .. GENERATED FROM PYTHON SOURCE LINES 19-34 .. code-block:: default df = pd.DataFrame(np.random.randn(1000, 3), columns=['x1', 'x2', 'x3']) df['label'] = df['x2'] + 0.1 * df['x1'] train, test = train_test_split(df, test_size=0.4) train = Dataset(train, features=['x1', 'x2', 'x3'], label='label') test = Dataset(test, features=['x1', 'x2', 'x3'], label='label') check_instance = ( DatasetsSizeComparison() .add_condition_train_dataset_greater_or_equal_test() .add_condition_test_size_greater_or_equal(100) .add_condition_test_train_size_ratio_greater_than(0.2) ) .. GENERATED FROM PYTHON SOURCE LINES 35-37 .. code-block:: default check_instance.run(train, test) .. raw:: html
Datasets Size Comparison


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.043 seconds) .. _sphx_glr_download_checks_gallery_tabular_train_test_validation_plot_datasets_size_comparison.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_datasets_size_comparison.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_datasets_size_comparison.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_