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

Function cv_split

experiments/python/pyience.py:538–548  ·  view source on GitHub ↗
(X, y, n_folds=5, fractions=None, stratified=True)

Source from the content-addressed store, hash-verified

536
537
538def cv_split(X, y, n_folds=5, fractions=None, stratified=True):
539 if len(X) != len(y):
540 raise IndexError("len(X) {} != len(y) {}".format(len(X), len(y)))
541
542 all_idxs = cv_partition_idxs(y, n_folds=n_folds, fractions=fractions,
543 stratified=stratified)
544
545 X_split = [X[idxs] for idxs in all_idxs]
546 y_split = [y[idxs] for idxs in all_idxs]
547
548 return X_split, y_split
549
550
551# ================================================================ Main

Callers

nothing calls this directly

Calls 2

cv_partition_idxsFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected