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.
Constructors
new PredefinedSplit()
new PredefinedSplit(
opts?):PredefinedSplit
Parameters
| Parameter | Type | Description | 
|---|---|---|
| opts? | object | - | 
| opts.test_fold? | ArrayLike | The entry test_fold\[i\]represents the index of the test set that sampleibelongs to. It is possible to exclude sampleifrom any test set (i.e. include sampleiin every training set) by settingtest_fold\[i\]equal to -1. | 
Returns PredefinedSplit
Defined in generated/model_selection/PredefinedSplit.ts:25
Properties
| Property | Type | Default value | Defined in | 
|---|---|---|---|
| _isDisposed | boolean | false | generated/model_selection/PredefinedSplit.ts:23 | 
| _isInitialized | boolean | false | generated/model_selection/PredefinedSplit.ts:22 | 
| _py | PythonBridge | undefined | generated/model_selection/PredefinedSplit.ts:21 | 
| id | string | undefined | generated/model_selection/PredefinedSplit.ts:18 | 
| opts | any | undefined | generated/model_selection/PredefinedSplit.ts:19 | 
Accessors
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge):void
Parameters
| Parameter | Type | 
|---|---|
| pythonBridge | PythonBridge | 
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
| Parameter | Type | Description | 
|---|---|---|
| opts | object | - | 
| opts.routing? | any | A MetadataRequestencapsulating 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
| Parameter | Type | Description | 
|---|---|---|
| opts | object | - | 
| opts.groups? | any | Always ignored, exists for compatibility. | 
| opts.X? | any | Always ignored, exists for compatibility. | 
| opts.y? | any | Always 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
| Parameter | Type | 
|---|---|
| py | PythonBridge | 
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
| Parameter | Type | Description | 
|---|---|---|
| opts | object | - | 
| opts.groups? | any | Always ignored, exists for compatibility. | 
| opts.X? | any | Always ignored, exists for compatibility. | 
| opts.y? | any | Always ignored, exists for compatibility. | 
Returns Promise<ArrayLike>