WIP: Select training folds so they are equally represented in the predicted data
Closes #68
Merge request reports
Activity
added EM::B (Important) label
added 1 commit
- e087bbaa - add argument. Ref #60 (closed)
By Benjamin Paul Jaeger on 2020-11-07T00:42:05 (imported from GitLab)
added 2 commits
By Benjamin Paul Jaeger on 2020-11-07T00:43:43 (imported from GitLab)
added 1 commit
- 2d0db095 - change import keras again (for now)
By Benjamin Paul Jaeger on 2020-11-07T00:47:52 (imported from GitLab)
Hi @fsauerbu , saw this when looking at the fold info that we retrieve and when plotting the network output. I only implemented this for the
MixedCV
for now to check what you think. Will add it to the other CVs later. I added some comments to the code directly. Would be great if you let me know what your preferred way is to implement this. But no rush at all, it's not urgent.By Benjamin Paul Jaeger on 2020-11-07T01:03:22 (imported from GitLab)
Edited by Frank Sauerburgeradded 1 commit
- 16939e8e - Update documentation
By Benjamin Paul Jaeger on 2020-11-07T00:59:41 (imported from GitLab)
380 # if we select the slices for training we are done 381 if not for_predicting: return all_slices_for_folds[fold_i] 382 383 # all_slices_for_folds looks e.g. like: 384 # [[0, 1, 2], [0, 1, 4], [0, 3, 4], [2, 3, 4], [1, 2, 3]] 385 # need to select array with uniq entries: 386 # [0, 1, 2, 4, 3] 387 uniq_el = lambda ar: set(x for l in ar for x in l) 388 exclusive_slices = [] 389 for i, slices in enumerate(all_slices_for_folds): 390 for sl in slices: 391 if sl not in exclusive_slices and sl in uniq_el(all_slices_for_folds[i:]): 392 exclusive_slices.append(sl) 393 return exclusive_slices[fold_i] 394 395 def select_training(self, df, fold_i, for_predicting = False): This is not dependent on the type of CV anymore and could be moved to the abstract parent class. I wonder if there will ever be cases where something similar needs to be done for the val or test set. Then one could abstract the select_training function and define
select_training/validation/test_slices
function for the individual CVs.By Benjamin Paul Jaeger on 2020-11-07T01:01:44 (imported from GitLab)
unassigned @frank