(self)
| 312 | print "pattern.vector.Document.keywords()" |
| 313 | |
| 314 | def test_tf(self): |
| 315 | # Assert Document.term_frequency() (= weights used in Vector for orphaned documents). |
| 316 | v = vector.Document("the cat sat on the mat") |
| 317 | for feature, weight in v.vector.items(): |
| 318 | self.assertEqual(v.term_frequency(feature), weight) |
| 319 | self.assertAlmostEqual(v.term_frequency(feature), 0.33, places=2) |
| 320 | print "pattern.vector.Document.tf()" |
| 321 | |
| 322 | def test_tfidf(self): |
| 323 | # Assert tf-idf for documents not in a model. |
nothing calls this directly
no test coverage detected