/usr/share/pyshared/pebl/test/benchmark.py is in python-pebl 1.0.2-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import os, os.path
from pebl import data, network
from pebl.learner import greedy
def benchmark_datafiles(dir=None):
benchdata_dir = dir or os.path.join(os.path.dirname(__file__), "benchdata")
for filename in (f for f in os.listdir(benchdata_dir) if f.startswith('benchdata.')):
yield os.path.join(benchdata_dir, filename)
def run_benchmarks(datafile):
print datafile
dat = data.fromfile(datafile)
l = greedy.GreedyLearner(dat)
l.run()
def run_all_benchmarks(dir=None):
for datafile in benchmark_datafiles(dir):
run_benchmarks(datafile)
if __name__== '__main__':
run_all_benchmarks()
|