本文整理汇总了Python中pool.Pool.store方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.store方法的具体用法?Python Pool.store怎么用?Python Pool.store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pool.Pool
的用法示例。
在下文中一共展示了Pool.store方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fullPool
# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import store [as 别名]
def fullPool(spec):
"""Creates a pool and fills it with the world drawn from the provided specification, before returning it."""
pool = Pool()
data = sampleWorld(spec)
for pair in data:
pool.store(pair[0], pair[1])
return pool
示例2: Pool
# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import store [as 别名]
loo.solve(p.callback)
precision = loo.getBest()
del p
print 'Optimal standard deviation = %s'%str(math.sqrt(1.0/precision[0,0]))
# Create and fill the pool...
print 'Filling the pool...'
pool = Pool()
p = ProgBar()
for i in xrange(data.getVectors().shape[0]):
p.callback(i, data.getVectors().shape[0])
pool.store(numpy.reshape(data.getVectors()[i], (1,)), data.getClasses()[i])
del p
# Create the classifier...
classifier = ClassifyKDE(precision)
# Calculate the dimensions for the visualisations...
low = data.getVectors().min()
high = data.getVectors().max()
low -= 0.2*(high-low)
high += 0.2*(high-low)