def test_config2(self):
     try:
         config.read(testfile('config2.txt'))
     except: 
         assert True
     else: 
         assert False
 def setUp(self):
     a,b,c,d,e = 0,1,2,3,4
     
     self.data = data.fromfile(testfile('testdata9.txt'))
     self.net = network.fromdata(self.data)
     self.net.edges.add_many([(a,c), (b,c), (c,d), (c,e)])
     self.neteval1 = self.neteval_type(self.data, self.net, max_iterations="10*n**2")
Beispiel #3
0
 def test_config2(self):
     try:
         config.read(testfile('config2.txt'))
     except:
         assert True
     else:
         assert False
 def setUp(self):
     self.data = data.fromfile(testfile('testdata10.txt'))
     self.neteval = evaluator.NetworkEvaluator(
         self.data, 
         network.fromdata(self.data), 
         prior.UniformPrior(self.data.variables.size))
     self.neteval.network.edges.add_many([(1,0),(2,0),(3,0)])
Beispiel #5
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)
Beispiel #6
0
def test_arity_checking2():
    try:
        # arity specified is MORE than number of unique values. this is ok.
        dataset = data.fromfile(testfile('testdata7.txt'))
    except:
        assert False

    assert [v.arity for v in dataset.variables] == [3, 4, 3, 6]
Beispiel #7
0
def test_arity_checking():
    try:
        # arity specified is less than number of unique values!!
        dataset = data.fromfile(testfile('testdata6.txt'))
    except data.IncorrectArityError:
        assert True
    else:
        assert False
Beispiel #8
0
def test_arity_checking():
    try:
        # arity specified is less than number of unique values!!
        dataset = data.fromfile(testfile('testdata6.txt'))
    except data.IncorrectArityError:
        assert True
    else:
        assert False
Beispiel #9
0
def test_arity_checking2():
    try:
        # arity specified is MORE than number of unique values. this is ok.
        dataset = data.fromfile(testfile('testdata7.txt'))
    except:
        assert False
    
    assert [v.arity for v in dataset.variables] == [3,4,3,6]
Beispiel #10
0
 def setUp(self):
     dat = data.fromfile(testfile("testdata5.txt"))
     dat.discretize()
     g = greedy.GreedyLearner(dat, max_iterations=100)
     g.run()
     self.result = g.result
     self.tempdir = tempfile.mkdtemp()
     self.result.tohtml(self.tempdir)
Beispiel #11
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata4.txt')) # no tab before variable names
     self.expected_observations = N.array([[0, 0], [1, 1], [1,2]])
     self.expected_missing = N.array([[0, 0], [0, 0], [0, 0]], dtype=bool)
     self.expected_interventions = N.array([[1, 1], [0, 1], [0, 0]], dtype=bool)
     self.expected_varnames = ['shh', 'ptchp']
     self.expected_samplenames = ['sample1', 'sample2', 'sample3']
     self.expected_arities = [2,3]
     self.expected_dtype = N.dtype(int)
Beispiel #12
0
    def setUp(self):
        a, b, c, d, e = 0, 1, 2, 3, 4

        self.data = data.fromfile(testfile('testdata9.txt'))
        self.net = network.fromdata(self.data)
        self.net.edges.add_many([(a, c), (b, c), (c, d), (c, e)])
        self.neteval1 = self.neteval_type(self.data,
                                          self.net,
                                          max_iterations="10*n**2")
Beispiel #13
0
    def test_example1(self):
        outdir = os.path.join(self.tmpdir, "example1-result")

        dataset = data.fromfile(testfile("pebl-tutorial-data1.txt"))
        dataset.discretize()
        learner = greedy.GreedyLearner(dataset)
        ex1result = learner.run()
        ex1result.tohtml(outdir)

        assert os.path.exists(os.path.join(outdir, 'index.html'))
Beispiel #14
0
    def test_example1(self):
        outdir = os.path.join(self.tmpdir, "example1-result")

        dataset = data.fromfile(testfile("pebl-tutorial-data1.txt"))
        dataset.discretize()
        learner = greedy.GreedyLearner(dataset)
        ex1result = learner.run()
        ex1result.tohtml(outdir)

        assert os.path.exists(os.path.join(outdir, 'index.html'))
Beispiel #15
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata3.txt'))
     self.expected_observations = N.array([[0, 0], [1, 1], [1, 2]])
     self.expected_missing = N.array([[0, 0], [0, 0], [0, 0]], dtype=bool)
     self.expected_interventions = N.array([[1, 1], [0, 1], [0, 0]],
                                           dtype=bool)
     self.expected_varnames = ['shh', 'ptchp']
     self.expected_samplenames = ['sample1', 'sample2', 'sample3']
     self.expected_arities = [2, 3]
     self.expected_dtype = N.dtype(int)
Beispiel #16
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata2.txt'))
     self.expected_observations = N.array([[ 0.  ,  0.  ,  1.25,  0.  ],
                                           [ 1.  ,  1.  ,  1.1 ,  1.  ],
                                           [ 1.  ,  2.  ,  0.45,  1.  ]])
     self.expected_dtype = N.dtype(float) # because one continuous variable
     self.expected_varnames = ['shh', 'ptchp', 'smo', 'outcome']
     self.expected_interventions = N.array([[ True,  True, False, False],
                                            [False,  True, False, False],
                                            [False, False, False, False]], dtype=bool)
     self.expected_missing = N.array([[False, False, False, False],
                                      [False, False, False, False],
                                      [False, False, False, False]], dtype=bool)
     self.expected_arities = [2, 3, -1, 2]         
Beispiel #17
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata1.txt'))
     self.expected_observations = N.array([[   2.5,    0. ,    1.7],
                                           [   1.1,    1.7,    2.3],
                                           [   4.2,  999.3,   12. ]])
     self.expected_dtype = N.dtype(float)
     self.expected_varnames = ['var1', 'var2', 'var3']
     self.expected_missing = N.array([[False,  True, False],
                                      [False, False, False],
                                      [False, False, False]], dtype=bool)
     self.expected_interventions = N.array([[ True,  True, False],
                                            [False,  True, False],
                                            [False, False, False]], dtype=bool)
     self.expected_arities = [-1,-1,-1]
Beispiel #18
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata1.txt'))
     self.expected_observations = N.array([[2.5, 0., 1.7], [1.1, 1.7, 2.3],
                                           [4.2, 999.3, 12.]])
     self.expected_dtype = N.dtype(float)
     self.expected_varnames = ['var1', 'var2', 'var3']
     self.expected_missing = N.array(
         [[False, True, False], [False, False, False],
          [False, False, False]],
         dtype=bool)
     self.expected_interventions = N.array(
         [[True, True, False], [False, True, False], [False, False, False]],
         dtype=bool)
     self.expected_arities = [-1, -1, -1]
    def setup(self):
        self.tempdir = tempfile.mkdtemp()
        self.outdir = os.path.join(self.tempdir, 'result')

        htmlreport_config = textwrap.dedent("""
        [data]
        filename = %s

        [result]
        format = html
        outdir = %s
        """ % (testfile("testdata12.txt"), self.outdir))
        
        configfile = os.path.join(self.tempdir, "config.txt")
        with file(configfile, 'w') as f:
            f.write(htmlreport_config)
Beispiel #20
0
    def setup(self):
        self.tempdir = tempfile.mkdtemp()
        self.outdir = os.path.join(self.tempdir, 'result')

        htmlreport_config = textwrap.dedent("""
        [data]
        filename = %s

        [result]
        format = html
        outdir = %s
        """ % (testfile("testdata12.txt"), self.outdir))

        configfile = os.path.join(self.tempdir, "config.txt")
        with file(configfile, 'w') as f:
            f.write(htmlreport_config)
Beispiel #21
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata2.txt'))
     self.expected_observations = N.array([[0., 0., 1.25, 0.],
                                           [1., 1., 1.1, 1.],
                                           [1., 2., 0.45, 1.]])
     self.expected_dtype = N.dtype(float)  # because one continuous variable
     self.expected_varnames = ['shh', 'ptchp', 'smo', 'outcome']
     self.expected_interventions = N.array(
         [[True, True, False, False], [False, True, False, False],
          [False, False, False, False]],
         dtype=bool)
     self.expected_missing = N.array(
         [[False, False, False, False], [False, False, False, False],
          [False, False, False, False]],
         dtype=bool)
     self.expected_arities = [2, 3, -1, 2]
Beispiel #22
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5m.txt'))
     self.data.discretize()
     self.expected_original = \
         N.array([[ 1.2,  1.4,  2.1,  2.2,  1.1],
                  [ 2.3,  1.1,  2.1,  3.2,  1.3],
                  [ 3.2,  0. ,  1.2,  2.5,  1.6],
                  [ 4.2,  2.4,  3.2,  2.1,  2.8],
                  [ 2.7,  1.5,  0. ,  1.5,  1.1],
                  [ 1.1,  2.3,  2.1,  1.7,  3.2],
                  [ 2.3,  1.1,  4.3,  2.3,  1.1],
                  [ 3.2,  2.6,  1.9,  1.7,  1.1],
                  [ 2.1,  1.5,  3. ,  1.4,  1.1],
                  [ 0. ,  0. ,  0. ,  0. ,  0. ],
                  [ 0. ,  0. ,  0. ,  0. ,  0. ],
                  [ 0. ,  0. ,  0. ,  0. ,  0. ]])
     self.expected_discretized = \
         N.array([[0, 1, 1, 1, 0],
                 [1, 0, 1, 2, 1],
                 [2, 0, 0, 2, 2],
                 [2, 2, 2, 1, 2],
                 [1, 1, 0, 0, 0],
                 [0, 2, 1, 0, 2],
                 [1, 0, 2, 2, 0],
                 [2, 2, 0, 0, 0],
                 [0, 1, 2, 0, 0],
                 [0, 0, 0, 0, 0],
                 [0, 0, 0, 0, 0],
                 [0, 0, 0, 0, 0]])
     self.expected_arities = [3, 3, 3, 3, 3]
     self.expected_missing = N.array(
         [[False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [False, False, False, False, False],
          [True, True, True, True, True], [True, True, True, True, True],
          [True, True, True, True, True]],
         dtype=bool)
Beispiel #23
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5m.txt'))
     self.data.discretize()
     self.expected_original = \
         N.array([[ 1.2,  1.4,  2.1,  2.2,  1.1],
                  [ 2.3,  1.1,  2.1,  3.2,  1.3],
                  [ 3.2,  0. ,  1.2,  2.5,  1.6],
                  [ 4.2,  2.4,  3.2,  2.1,  2.8],
                  [ 2.7,  1.5,  0. ,  1.5,  1.1],
                  [ 1.1,  2.3,  2.1,  1.7,  3.2],
                  [ 2.3,  1.1,  4.3,  2.3,  1.1],
                  [ 3.2,  2.6,  1.9,  1.7,  1.1],
                  [ 2.1,  1.5,  3. ,  1.4,  1.1],
                  [ 0. ,  0. ,  0. ,  0. ,  0. ],
                  [ 0. ,  0. ,  0. ,  0. ,  0. ],
                  [ 0. ,  0. ,  0. ,  0. ,  0. ]])
     self.expected_discretized = \
         N.array([[0, 1, 1, 1, 0],
                 [1, 0, 1, 2, 1],
                 [2, 0, 0, 2, 2],
                 [2, 2, 2, 1, 2],
                 [1, 1, 0, 0, 0],
                 [0, 2, 1, 0, 2],
                 [1, 0, 2, 2, 0],
                 [2, 2, 0, 0, 0],
                 [0, 1, 2, 0, 0],
                 [0, 0, 0, 0, 0],
                 [0, 0, 0, 0, 0],
                 [0, 0, 0, 0, 0]])
     self.expected_arities = [3,3,3,3,3]
     self.expected_missing = N.array([[False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [False, False, False, False, False],
                                      [True , True , True , True , True ],
                                      [True , True , True , True , True ],
                                      [True , True , True , True , True ]], 
                                     dtype=bool)
Beispiel #24
0
    def test_example1_configfile(self):
        configfile = os.path.join(self.tmpdir, 'config1.txt')
        outdir = os.path.join(self.tmpdir, "example1-result-2")

        configstr = textwrap.dedent("""
        [data]
        filename = %s
        discretize = 3

        [learner]
        type = greedy.GreedyLearner

        [result]
        format = html
        outdir = %s
        """ % (testfile("pebl-tutorial-data1.txt"), outdir))

        with file(configfile, 'w') as f:
            f.write(configstr)

        pebl_script.run(configfile)
        assert os.path.exists(os.path.join(outdir, 'data', 'result.data.js'))
Beispiel #25
0
    def test_example1_configfile(self):
        configfile = os.path.join(self.tmpdir, 'config1.txt')
        outdir = os.path.join(self.tmpdir, "example1-result-2")

        configstr = textwrap.dedent("""
        [data]
        filename = %s
        discretize = 3

        [learner]
        type = greedy.GreedyLearner

        [result]
        format = html
        outdir = %s
        """ % (testfile("pebl-tutorial-data1.txt"), outdir))
        
        with file(configfile, 'w') as f:
            f.write(configstr)

        pebl_script.run(configfile)
        assert os.path.exists(os.path.join(outdir, 'data', 'result.data.js'))
Beispiel #26
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt'))
     self.data.discretize()
     self.expected_original = \
         N.array([[ 1.2,  1.4,  2.1,  2.2,  1.1],
                  [ 2.3,  1.1,  2.1,  3.2,  1.3],
                  [ 3.2,  0. ,  1.2,  2.5,  1.6],
                  [ 4.2,  2.4,  3.2,  2.1,  2.8],
                  [ 2.7,  1.5,  0. ,  1.5,  1.1],
                  [ 1.1,  2.3,  2.1,  1.7,  3.2],
                  [ 2.3,  1.1,  4.3,  2.3,  1.1],
                  [ 3.2,  2.6,  1.9,  1.7,  1.1],
                  [ 2.1,  1.5,  3. ,  1.4,  1.1]])
     self.expected_discretized = \
         N.array([[0, 1, 1, 1, 0],
                 [1, 0, 1, 2, 1],
                 [2, 0, 0, 2, 2],
                 [2, 2, 2, 1, 2],
                 [1, 1, 0, 0, 0],
                 [0, 2, 1, 0, 2],
                 [1, 0, 2, 2, 0],
                 [2, 2, 0, 0, 0],
                 [0, 1, 2, 0, 0]])
     self.expected_arities = [3,3,3,3,3]
Beispiel #27
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt'))
     self.data.discretize()
     self.expected_original = \
         N.array([[ 1.2,  1.4,  2.1,  2.2,  1.1],
                  [ 2.3,  1.1,  2.1,  3.2,  1.3],
                  [ 3.2,  0. ,  1.2,  2.5,  1.6],
                  [ 4.2,  2.4,  3.2,  2.1,  2.8],
                  [ 2.7,  1.5,  0. ,  1.5,  1.1],
                  [ 1.1,  2.3,  2.1,  1.7,  3.2],
                  [ 2.3,  1.1,  4.3,  2.3,  1.1],
                  [ 3.2,  2.6,  1.9,  1.7,  1.1],
                  [ 2.1,  1.5,  3. ,  1.4,  1.1]])
     self.expected_discretized = \
         N.array([[0, 1, 1, 1, 0],
                 [1, 0, 1, 2, 1],
                 [2, 0, 0, 2, 2],
                 [2, 2, 2, 1, 2],
                 [1, 1, 0, 0, 0],
                 [0, 2, 1, 0, 2],
                 [1, 0, 2, 2, 0],
                 [2, 2, 0, 0, 0],
                 [0, 1, 2, 0, 0]])
     self.expected_arities = [3, 3, 3, 3, 3]
Beispiel #28
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt'))
     self.data.discretize(excludevars=[0,1])
     self.expected_original = \
         N.array([[ 1.2,  1.4,  2.1,  2.2,  1.1],
                  [ 2.3,  1.1,  2.1,  3.2,  1.3],
                  [ 3.2,  0. ,  1.2,  2.5,  1.6],
                  [ 4.2,  2.4,  3.2,  2.1,  2.8],
                  [ 2.7,  1.5,  0. ,  1.5,  1.1],
                  [ 1.1,  2.3,  2.1,  1.7,  3.2],
                  [ 2.3,  1.1,  4.3,  2.3,  1.1],
                  [ 3.2,  2.6,  1.9,  1.7,  1.1],
                  [ 2.1,  1.5,  3. ,  1.4,  1.1]])
     self.expected_discretized = \
         N.array([[ 1.2,  1.4,  1. ,  1. ,  0. ],
                 [ 2.3,  1.1,  1. ,  2. ,  1. ],
                 [ 3.2,  0. ,  0. ,  2. ,  2. ],
                 [ 4.2,  2.4,  2. ,  1. ,  2. ],
                 [ 2.7,  1.5,  0. ,  0. ,  0. ],
                 [ 1.1,  2.3,  1. ,  0. ,  2. ],
                 [ 2.3,  1.1,  2. ,  2. ,  0. ],
                 [ 3.2,  2.6,  0. ,  0. ,  0. ],
                 [ 2.1,  1.5,  2. ,  0. ,  0. ]])
     self.expected_arities = [-1,-1,3,3,3]
Beispiel #29
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt'))
     self.data.discretize(excludevars=[0, 1])
     self.expected_original = \
         N.array([[ 1.2,  1.4,  2.1,  2.2,  1.1],
                  [ 2.3,  1.1,  2.1,  3.2,  1.3],
                  [ 3.2,  0. ,  1.2,  2.5,  1.6],
                  [ 4.2,  2.4,  3.2,  2.1,  2.8],
                  [ 2.7,  1.5,  0. ,  1.5,  1.1],
                  [ 1.1,  2.3,  2.1,  1.7,  3.2],
                  [ 2.3,  1.1,  4.3,  2.3,  1.1],
                  [ 3.2,  2.6,  1.9,  1.7,  1.1],
                  [ 2.1,  1.5,  3. ,  1.4,  1.1]])
     self.expected_discretized = \
         N.array([[ 1.2,  1.4,  1. ,  1. ,  0. ],
                 [ 2.3,  1.1,  1. ,  2. ,  1. ],
                 [ 3.2,  0. ,  0. ,  2. ,  2. ],
                 [ 4.2,  2.4,  2. ,  1. ,  2. ],
                 [ 2.7,  1.5,  0. ,  0. ,  0. ],
                 [ 1.1,  2.3,  1. ,  0. ,  2. ],
                 [ 2.3,  1.1,  2. ,  2. ,  0. ],
                 [ 3.2,  2.6,  0. ,  0. ,  0. ],
                 [ 2.1,  1.5,  2. ,  0. ,  0. ]])
     self.expected_arities = [-1, -1, 3, 3, 3]
Beispiel #30
0
 def setUp(self):
     self.data = data.fromfile(testfile("greedytest1-200.txt"))
Beispiel #31
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt'))
     self.data.discretize()
Beispiel #32
0
 def setUp(self):
     d = data.fromfile(testfile("testdata5.txt"))
     d.discretize()
     
     self.tc = self.tctype(*self.args)
     self.tasks = [greedy.GreedyLearner(d, max_iterations=100) for i in xrange(6)]
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt'))
     self.data.discretize()
 def setUp(self):
     self.data = data.fromfile(testfile('testdata10.txt'))
     self.ne = evaluator.SmartNetworkEvaluator(
         self.data,
         network.fromdata(self.data))
Beispiel #35
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata10.txt'))
     self.ne = evaluator.SmartNetworkEvaluator(self.data,
                                               network.fromdata(self.data))
Beispiel #36
0
 def test_config1(self):
     config.read(testfile('config1.txt'))
 def setUp(self):
     self.data = data.fromfile(testfile('testdata10.txt'))
     self.neteval = evaluator.NetworkEvaluator(self.data, network.fromdata(self.data))
     self.neteval.network.edges.add_many([(1,0), (2,0), (3,0)]) # {1,2,3} --> 0
Beispiel #38
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata5.txt')).subset(samples=range(5))
     self.data.discretize()
     self.learner = self.learnertype(self.data)
Beispiel #39
0
 def setUp(self):
     config.set('evaluator.missingdata_evaluator', self.missing_evaluator)
     self.data = data.fromfile(testfile('testdata13.txt'))
     self.learner = self.learnertype(self.data)
 def test_config1(self):
     config.read(testfile('config1.txt'))
Beispiel #41
0
 def setUp(self):
     config.set('evaluator.missingdata_evaluator', 'exact')
     self.data = data.fromfile(
         testfile('testdata13.txt')).subset(samples=range(5))
     self.learner = greedy.GreedyLearner(self.data, max_iterations=10)
Beispiel #42
0
 def setUp(self):
     config.set('evaluator.missingdata_evaluator', self.missing_evaluator)
     self.data = data.fromfile(testfile('testdata13.txt'))
     self.learner = self.learnertype(self.data)
Beispiel #43
0
 def setUp(self):
     self.data = data.fromfile(
         testfile('testdata5.txt')).subset(samples=range(5))
     self.data.discretize()
     self.learner = self.learnertype(self.data)
Beispiel #44
0
from pebl.learner import greedy
from pebl.taskcontroller import ec2
from pebl.test import testfile

help = """Test the EC2 TaskController.

USAGE: test_ec2.py configfile

You need to provide the configfile for use with EC2Controller.

###############################################################################
    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)

d = data.fromfile(testfile("testdata5.txt"))
d.discretize()

tc = ec2.EC2Controller(config=sys.argv[1], min_count=3)
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]
Beispiel #45
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata10.txt'))
     self.neteval = evaluator.NetworkEvaluator(self.data,
                                               network.fromdata(self.data))
     self.neteval.network.edges.add_many([(1, 0), (2, 0),
                                          (3, 0)])  # {1,2,3} --> 0
Beispiel #46
0
 def setUp(self):
     self.data = data.fromfile(testfile("greedytest1-200.txt"))
Beispiel #47
0
 def setUp(self):
     self.data = data.fromfile(testfile('testdata10.txt'))
     self.neteval = evaluator.NetworkEvaluator(
         self.data, network.fromdata(self.data),
         prior.UniformPrior(self.data.variables.size))
     self.neteval.network.edges.add_many([(1, 0), (2, 0), (3, 0)])
Beispiel #48
0
    def setUp(self):
        d = data.fromfile(testfile("testdata5.txt"))
        d.discretize()

        self.proc = subprocess.Popen("ipcluster -n 2 </dev/null 1>&0 2>&0", shell=True)
        time.sleep(5)
Beispiel #49
0
from pebl.taskcontroller import xgrid
from pebl.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]
Beispiel #50
0
 def setUp(self):
     config.set('evaluator.missingdata_evaluator', 'exact')
     self.data = data.fromfile(testfile('testdata13.txt')).subset(samples=range(5))
     self.learner = greedy.GreedyLearner(self.data, max_iterations=10)