verde.base.BaseBlockCrossValidator#
- class verde.base.BaseBlockCrossValidator(block_size=None, block_shape=None, n_splits=10)[source]#
Base class for spatially blocked cross-validators.
- Parameters:
- block_size
float
,tuple
= (s_north
,s_east
),or
None
The block size in the South-North and West-East directions, respectively. A single value means that the size is equal in both directions.
- block_shape
tuple
= (n_north
,n_east
)or
None
The number of blocks in the South-North and West-East directions, respectively.
- n_splits
int
Number of splitting iterations.
- block_size
Methods
Get metadata routing of this object.
get_n_splits
([X, y, groups])Returns the number of splitting iterations in the cross-validator
split
(X[, y, groups])Generate indices to split data into training and test set.
Method documentation#
- BaseBlockCrossValidator.get_metadata_routing()#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routing
MetadataRequest
A
MetadataRequest
encapsulating routing information.
- routing
- BaseBlockCrossValidator.get_n_splits(X=None, y=None, groups=None)[source]#
Returns the number of splitting iterations in the cross-validator
- BaseBlockCrossValidator.split(X, y=None, groups=None)[source]#
Generate indices to split data into training and test set.
- Parameters:
- Xarray_like,
shape
(n_samples
, 2) Columns should be the easting and northing coordinates of data points, respectively.
- yarray_like,
shape
(n_samples,) The target variable for supervised learning problems. Always ignored.
- groupsarray_like,
with
shape
(n_samples,),optional
Group labels for the samples used while splitting the dataset into train/test set. Always ignored.
- Xarray_like,
- Yields: