pyMAISE.preprocessing.train_test_split
- pyMAISE.preprocessing.train_test_split(data, test_size=0.3, shuffle=True)[source]
Split data into training and testing data sets.
- Parameters:
data (xarray.DataArray or list of 2 xarray.DataArray[s]) – Data to be split. Assumes the first dimension is the sample dimension.
test_size (float between 0 and 1) – Percentage of the data used for testing.
shuffle (bool, default=False) – Shuffle samples during split.
- Returns:
split_data – If an
xarray.DataArraywas given fordatathen split_data consists of(data_train, data_test). If a list of 2xarray.DataArrayobjects,[x, y], then split_data consists of(x_train, x_test, y_train, y_test).- Return type:
tuple of xarray.DataArray