本文整理匯總了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)