Example #1
0
 def test_tfidf_with_all_datasets(self):
     should_succeed = ["movies"]
     should_fail = ["irisArr", "irisDf", "digits", "housing", "creditG", "drugRev"]
     for name in should_succeed:
         dataset = getattr(self, f"_{name}")
         TfidfVectorizer.validate_schema(**dataset)
     for name in should_fail:
         dataset = getattr(self, f"_{name}")
         with self.assertRaises(ValueError):
             TfidfVectorizer.validate_schema(**dataset)
Example #2
0
 def test_tfidf_with_all_datasets(self):
     should_succeed = ['movies']
     should_fail = ['irisArr', 'irisDf', 'digits', 'housing', 'creditG', 'drugRev']
     for name in should_succeed:
         dataset = getattr(self, f'_{name}')
         TfidfVectorizer.validate_schema(**dataset)
     for name in should_fail:
         dataset = getattr(self, f'_{name}')
         with self.assertRaises(ValueError):
             TfidfVectorizer.validate_schema(**dataset)