in k-fold-cross-validation/build_folds.py [0:0]
def build_folds(data_spec=None, kfolds=None):
"""
Create Datasources, ML Model and Evaluation for each fold. Returns
a list of newly created evaluation IDs for all folds.
Args:
data_spec: the named tuple object that wraps dataset related
parameters.
kfolds: the integer number representing the number of folds.
Returns:
a list of newly created evaluation IDs.
"""
folds = [Fold(data_spec=data_spec, this_fold=i,
kfolds=kfolds) for i in range(kfolds)]
for f in folds:
f.build() # each fold creates entities
logger.info(f) # prints details of folds
return [f.ev_id for f in folds] # return list of eval IDs