本文整理匯總了Python中pool.Pool.methods方法的典型用法代碼示例。如果您正苦於以下問題:Python Pool.methods方法的具體用法?Python Pool.methods怎麽用?Python Pool.methods使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pool.Pool
的用法示例。
在下文中一共展示了Pool.methods方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: len
# 需要導入模塊: from pool import Pool [as 別名]
# 或者: from pool.Pool import methods [as 別名]
# Parameters...
limit = 64
out_dir = 'iris_results'
prec_cache = 'precision_iris.pickle'
width = 800
height = 200
# Fetch the task...
if len(sys.argv)<2: task = 'p_wrong_hard'
else:
task = sys.argv[1]
assert(task in Pool.methods())
# Load the dataset...
data = Iris1D()
print 'Loaded %i examples'%data.getVectors().shape[0]
# Make the output directory, killing any previous versions...
try: shutil.rmtree(out_dir)
except: pass
os.makedirs(out_dir)
示例2: drainAllPools
# 需要導入模塊: from pool import Pool [as 別名]
# 或者: from pool.Pool import methods [as 別名]
# Iterate the methods and run each through the classDiscover function, printing out stats...
def drainAllPools(train, test, methods, runs, base):
for method in methods:
print 'method = %s'%method
p = ProgBar()
aq, ak, at = drainPools(train, test, method, runs, p.callback)
del p
print 'Average # querys by # classes found:'
for i, aqc in enumerate(aq):
if i>1: print ' %i classes found: average of %.2f querys'%(i, aqc)
print
fn = '%s%s_p%i_r%i.csv'%(base,method,sum(map(lambda x: x[2], train)),runs)
f = open(fn,'w')
f.write('querys, classes, inlier\n')
for i in xrange(len(ak)): f.write('%i, %f, %f\n'%(i, ak[i], at[i]))
f.close()
# Run through the test sequence...
try: shutil.rmtree(out_dir)
except: pass
os.makedirs(out_dir)
drainAllPools(train, sampleWorld(test), Pool.methods(), runs, out_dir+'/')