DocumentationClassesPredefinedSplit

Class: PredefinedSplit

Predefined split cross-validator.

Provides train/test indices to split data into train/test sets using a predefined scheme specified by the user with the test_fold parameter.

Read more in the User Guide.

Python Reference

Constructors

new PredefinedSplit()

new PredefinedSplit(opts?): PredefinedSplit

Parameters

ParameterTypeDescription
opts?object-
opts.test_fold?ArrayLikeThe entry test_fold\[i\] represents the index of the test set that sample i belongs to. It is possible to exclude sample i from any test set (i.e. include sample i in every training set) by setting test_fold\[i\] equal to -1.

Returns PredefinedSplit

Defined in generated/model_selection/PredefinedSplit.ts:25

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/model_selection/PredefinedSplit.ts:23
_isInitializedbooleanfalsegenerated/model_selection/PredefinedSplit.ts:22
_pyPythonBridgeundefinedgenerated/model_selection/PredefinedSplit.ts:21
idstringundefinedgenerated/model_selection/PredefinedSplit.ts:18
optsanyundefinedgenerated/model_selection/PredefinedSplit.ts:19

Accessors

py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/model_selection/PredefinedSplit.ts:35

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/model_selection/PredefinedSplit.ts:87


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns Promise<any>

Defined in generated/model_selection/PredefinedSplit.ts:106


get_n_splits()

get_n_splits(opts): Promise<number>

Returns the number of splitting iterations in the cross-validator.

Parameters

ParameterTypeDescription
optsobject-
opts.groups?anyAlways ignored, exists for compatibility.
opts.X?anyAlways ignored, exists for compatibility.
opts.y?anyAlways ignored, exists for compatibility.

Returns Promise<number>

Defined in generated/model_selection/PredefinedSplit.ts:140


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/model_selection/PredefinedSplit.ts:48


split()

split(opts): Promise<ArrayLike>

Generate indices to split data into training and test set.

Parameters

ParameterTypeDescription
optsobject-
opts.groups?anyAlways ignored, exists for compatibility.
opts.X?anyAlways ignored, exists for compatibility.
opts.y?anyAlways ignored, exists for compatibility.

Returns Promise<ArrayLike>

Defined in generated/model_selection/PredefinedSplit.ts:182