本文整理汇总了Python中dataset.Dataset.readFromFile方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.readFromFile方法的具体用法?Python Dataset.readFromFile怎么用?Python Dataset.readFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.readFromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Timer
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import readFromFile [as 别名]
timers = {}
timers['apriori'] = Timer(lambda: aprioriPatterns(ds,k,min_sup))
timers['fp-growth'] = Timer(lambda: fpGrowthPatterns(ds,k,min_sup))
#timers['eclat'] = Timer(lambda: eclatPatterns(ds,k,min_sup))
for key in timers.keys():
timer = timers[key]
print >> out_file, "{0},{1},{2},{3},{4},{5},{6}".format(\
i.retInc(),key,len(ds),k,min_sup,runs,timer.timeit(runs))
for _ in range(trials):
# run tiny tests
for tiny_file in tiny_files:
ds = Dataset()
with open(filepath + tiny_file,'rU') as f:
ds.readFromFile(f)
for size in tiny_sizes:
for prct in support_percents:
min_sup = int(prct * float(len(ds)))
timePatterns(ds,size,min_sup,tiny_runs)
out_file.flush()
# run tests
if runs < 1:
continue
for filename in files:
ds = Dataset()
with open(filepath + filename,'rU') as f:
ds.readFromFile(f)