(self)
| 539 | print "pattern.vector.Model.reduce()" |
| 540 | |
| 541 | def test_feature_selection(self): |
| 542 | # Assert information gain feature selection. |
| 543 | v = self.model.feature_selection(top=4, method=vector.IG) |
| 544 | self.assertEqual(sorted(v), ["bark", "howl", "meow", "purr"]) |
| 545 | # Assert Model.filter(). |
| 546 | v = self.model.filter(v) |
| 547 | self.assertTrue("purr" in v.terms) |
| 548 | self.assertTrue("meow" in v.terms) |
| 549 | self.assertTrue("howl" in v.terms) |
| 550 | self.assertTrue("bark" in v.terms) |
| 551 | self.assertTrue("cats" not in v.terms) |
| 552 | self.assertTrue("dogs" not in v.terms) |
| 553 | print "pattern.vector.Model.feature_selection()" |
| 554 | print "pattern.vector.Model.filter()" |
| 555 | |
| 556 | def test_information_gain(self): |
| 557 | # Assert information gain weights. |
nothing calls this directly
no test coverage detected