Example #1
0
 def test_tc(self):
     d = data.fromfile(testfile("testdata5.txt"))
     d.discretize()
     tasks = [greedy.GreedyLearner(d) for x in range(5)]
     tc = ipy1.IPython1Controller("127.0.0.1:10113")
     results = tc.run(tasks)
     results = result.merge(results)
     assert isinstance(results, result.LearnerResult)
Example #2
0
def run(configfile=None):
    try:
        configfile = configfile or sys.argv[2]
    except:
        usage("Please specify a config file.")

    config.read(configfile)

    numtasks = config.get('learner.numtasks')
    tasks = learner.fromconfig().split(numtasks)

    controller = taskcontroller.fromconfig()
    results = controller.run(tasks)
    
    merged_result = result.merge(results)
    if config.get('result.format') == 'html':
        merged_result.tohtml()
    else:
        merged_result.tofile()
Example #3
0
from pebl2.taskcontroller import xgrid
from pebl2.test import testfile

help = """Test the Xgrid TaskController.

USAGE: test_xgrid.py configfile

You need to provide the configfile for use with XGridController.

###############################################################################
    WARNING for pebl devs: 
        Do NOT put your configfile under svn. 
        It contains sensitve information.
###############################################################################
"""

if len(sys.argv) < 2:
    print help
    sys.exit(1)

config.read(sys.argv[1])
d = data.fromfile(testfile("testdata5.txt"))
d.discretize()

tc = xgrid.XgridController()
results = tc.run([greedy.GreedyLearner(d, max_time=10) for i in xrange(10)])
results = result.merge(results)

print results
print [r.host for r in results.runs]
Example #4
0
 def test_tc(self):
     results = self.tc.run(self.tasks)
     results = result.merge(results)
     assert isinstance(results, result.LearnerResult)
Example #5
0
 def setUp(self):
     super(TestPosterior, self).setUp()
     self.merged = result.merge(self.result1, self.result2)
     self.posterior = self.merged.posterior
Example #6
0
 def test_merged_scores(self):
     mr = result.merge([self.result1, self.result2])
     assert [n.score for n in mr.networks] == [-13, -12, -11, -10.5, -8.5, -6, -5.5]
Example #7
0
 def test_merged_size1(self):
     mr = result.merge(self.result1, self.result2)
     len(mr.networks) == (5+3-1) # 1 duplicate network