Random permutation cross-validator
Yields indices to split data into training and test sets.
Note: contrary to other cross-validation strategies, random splits do not guarantee that all folds will be different, although this is still very likely for sizeable datasets.
Read more in the User Guide.
For visualisation of cross-validation behaviour and comparison between common scikit-learn split methods refer to Visualizing cross-validation behavior in scikit-learn
new ShuffleSplit(opts?: object): ShuffleSplit;
Name | Type | Description |
---|---|---|
opts? |
object |
- |
opts.n_splits? |
number |
Number of re-shuffling & splitting iterations. Default Value 10 |
opts.random_state? |
number |
Controls the randomness of the training and testing indices produced. Pass an int for reproducible output across multiple function calls. See Glossary. |
opts.test_size? |
number |
If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the absolute number of test samples. If undefined , the value is set to the complement of the train size. If train\_size is also undefined , it will be set to 0.1. |
opts.train_size? |
number |
If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the train split. If int, represents the absolute number of train samples. If undefined , the value is automatically set to the complement of the test size. |
Defined in: generated/model_selection/ShuffleSplit.ts:29
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/model_selection/ShuffleSplit.ts:111
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
get_metadata_routing(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.routing? |
any |
A MetadataRequest encapsulating routing information. |
Promise
<any
>
Defined in: generated/model_selection/ShuffleSplit.ts:130
Returns the number of splitting iterations in the cross-validator
get_n_splits(opts: object): Promise<number>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
any |
Always ignored, exists for compatibility. |
opts.groups? |
any |
Always ignored, exists for compatibility. |
opts.y? |
any |
Always ignored, exists for compatibility. |
Promise
<number
>
Defined in: generated/model_selection/ShuffleSplit.ts:165
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/model_selection/ShuffleSplit.ts:69
Generate indices to split data into training and test set.
split(opts: object): Promise<ArrayLike>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike [] |
Training data, where n\_samples is the number of samples and n\_features is the number of features. |
opts.groups? |
ArrayLike |
Group labels for the samples used while splitting the dataset into train/test set. |
opts.y? |
ArrayLike |
The target variable for supervised learning problems. |
Promise
<ArrayLike
>
Defined in: generated/model_selection/ShuffleSplit.ts:208
boolean
=false
Defined in: generated/model_selection/ShuffleSplit.ts:27
boolean
=false
Defined in: generated/model_selection/ShuffleSplit.ts:26
PythonBridge
Defined in: generated/model_selection/ShuffleSplit.ts:25
string
Defined in: generated/model_selection/ShuffleSplit.ts:22
any
Defined in: generated/model_selection/ShuffleSplit.ts:23
py(): PythonBridge;
PythonBridge
Defined in: generated/model_selection/ShuffleSplit.ts:56
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/model_selection/ShuffleSplit.ts:60