model_helpers.py 文件源码

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

项目:leaf-classification 作者: MWransky 项目源码 文件源码
def write_results_to_file(species, ids, probs):
    print(probs.shape)
    # Make a path for our results to be saved to
    if not os.path.exists('results'):
        os.makedirs('results')
    print('Writing results to file')
    with open('results/results.csv', 'w') as f1:
        writer = csv.writer(f1, delimiter=' ', escapechar=' ', quoting=csv.QUOTE_NONE)
        header = 'id,' + ','.join(species)
        writer.writerow([header])
        for i in range(ids.shape[0]):
            row = probs[i]
            row = convert_list_of_ints_to_string(row)
            row = '{}'.format(str(int(ids[i]))) + row
            writer.writerow([row])
    print('Successfully wrote results to file')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号