inbreast.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:deep-mil-for-whole-mammogram-classification 作者: wentaozhu 项目源码 文件源码
def cvsplit(fold, totalfold, mydict):
  '''get the split of train and test
  fold is the returned fold th data, from 0 to totalfold-1
  total fold is for the cross validation
  mydict is the return dict from readlabel'''
  skf = StratifiedKFold(n_splits=totalfold)  # default shuffle is false, okay!
  #readdicom(mydict)
  y = mydict.values()
  x = mydict.keys()
  count = 0
  for train, test in skf.split(x,y):
    print(len(train), len(test))
    if count == fold:
      #print test
      return train, test
    count += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号