本文整理汇总了Python中joblib.Parallel.mean方法的典型用法代码示例。如果您正苦于以下问题:Python Parallel.mean方法的具体用法?Python Parallel.mean怎么用?Python Parallel.mean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类joblib.Parallel
的用法示例。
在下文中一共展示了Parallel.mean方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: count_hit
# 需要导入模块: from joblib import Parallel [as 别名]
# 或者: from joblib.Parallel import mean [as 别名]
ch_r += count_hit(ypf, ytf)
lytf += len(ytf)
lypf += len(ypf)
if lytf == 0:
print('Warning: No steps annotation for', ex.id)
ch_r, lytf = 0, 1
if lypf == 0:
ch_p, lypf = 0, 1
return [ch_r/lytf, ch_p/lypf]
del_PR = delayed(PR)
PRS = Parallel(n_jobs=-2)(del_PR(ex) for ex in range(N))
PRS = np.array([prs for prs in PRS if prs is not None])
t_batch = time()-t_start
score = list(PRS.mean(axis=0))
score += list(PRS.std(axis=0))
res['results'] += [score]
res['patterns'] += [patterns]
results += [res]
t_batch = time() - t_start
print('-'*79)
print('Batch : {:03}/{:03}'.format(simu, n_batch))
print('Time batch : {:.2f}s'.format(t_batch))
print('Train: {}, Test: {}'.format(c_train[0], c_test[0]))
print('Score: {0:.2f}({2:.2f}), {1:.2f} ({3:.2f})'
''.format(*(np.mean(res['results'], axis=0))))
print('-'*79+'\n\n')
np.save('save_simu/cross_class_IEEE.npy', results)