Example #1
0
    def testPLR(self):
        data = datasets['dumb2']

        clf = PLR()

        clf.train(data)

        # prediction has to be perfect
        self.failUnless((clf.predict(data.samples) == data.labels).all())
Example #2
0
    def test_plr(self):
        data = datasets['dumb2']

        clf = PLR()

        clf.train(data)

        # prediction has to be perfect
        self.failUnless((clf.predict(data.samples) == data.targets).all())
Example #3
0
    def testPLRState(self):
        data = datasets['dumb2']

        clf = PLR()

        clf.train(data)

        clf.states.enable('values')
        clf.states.enable('predictions')

        p = clf.predict(data.samples)

        self.failUnless((p == clf.predictions).all())
        self.failUnless(N.array(clf.values).shape == N.array(p).shape)
Example #4
0
    def test_plr_state(self):
        data = datasets['dumb2']

        clf = PLR()

        clf.train(data)

        clf.ca.enable('estimates')
        clf.ca.enable('predictions')

        p = clf.predict(data.samples)

        self.failUnless((p == clf.ca.predictions).all())
        self.failUnless(np.array(clf.ca.estimates).shape == np.array(p).shape)