8.1.1.9.2.6. blueoil.utils.random

8.1.1.9.2.6.1. Module Contents

8.1.1.9.2.6.1.1. Functions

_indexing(array, indices)

shuffle(*arrays, seed=None)

Shuffle arrays

train_test_split(*arrays, test_size=0.25, seed=None)

Split arrays into random train and test.

blueoil.utils.random._indexing(array, indices)
blueoil.utils.random.shuffle(*arrays, seed=None)

Shuffle arrays

Parameters
  • arrays – Sequence of arrays. For each array should be instance of np.ndarray or list.

  • seed (int, optional) – The seed of random generator.

Returns

List of shuffled arrays. len(shuffled) == len(arrays)

Return type

list

blueoil.utils.random.train_test_split(*arrays, test_size=0.25, seed=None)

Split arrays into random train and test.

Parameters
  • arrays – Sequence of arrays. For each array should be instance of np.ndarray or list.

  • test_size (float, optional) – Represent the proportion of the arrays to include in the test split. should be between 0.0 and 1.0.

  • seed (int) – The seed of random generator.

Returns

List of train-test splittd array. len(splitted) == len(arrays) * 2

Return type

list