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