utils.helpers

Submodule of khiops.utils.helpers

General helper functions

Functions

train_test_split_dataset

Splits a multi-table dataset spec into train and test

khiops.utils.helpers.train_test_split_dataset(ds_spec, y=None, test_size=0.25, **kwargs)

Splits a multi-table dataset spec into train and test

Parameters:
ds_specdict

A dict multi-table dataset specification (see Multi-Table Learning Primer). Only Pandas, NumPy, SciPy tables are accepted in the spec.

yarray-like of size (n_samples,) , optional

The target values. n_samples is the number of rows of the main table in ds_spec.

test_sizefloat, default 0.25

The proportion of the dataset (between 0.0 and 1.0) to be included in the test split.

Other optional parameters for sklearn.model_selection.train_test_split

Raises:
TypeError

If ds_spec is not dict-like.

ValueError

If the tables in ds_spec are file-paths.

Examples

See the following functions of the samples_sklearn.py documentation script: