MCPcopy Create free account
hub / github.com/dblalock/bolt / _split_into_groups

Function _split_into_groups

experiments/python/pyience.py:502–510  ·  view source on GitHub ↗
(iterable, ngroups=-1, fractions=None, shuffle=True)

Source from the content-addressed store, hash-verified

500
501
502def _split_into_groups(iterable, ngroups=-1, fractions=None, shuffle=True):
503 if shuffle:
504 iterable = np.copy(iterable)
505 np.shuffle(iterable)
506
507 start_idxs, end_idxs = _group_start_end_idxs(len(iterable), ngroups,
508 fractions)
509
510 return [iterable[start:end] for start, end in zip(start_idxs, end_idxs)]
511
512
513def cv_partition_idxs(labels, n_folds=5, fractions=None, stratified=True):

Callers 1

cv_partition_idxsFunction · 0.85

Calls 1

_group_start_end_idxsFunction · 0.85

Tested by

no test coverage detected