test_model.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:mycroft 作者: wpm 项目源码 文件源码
def test_bag_of_words_with_validation_data(self):
        model = BagOfWordsClassifier((self.texts, self.labels, self.label_names))
        history = model.train(self.texts, self.labels, epochs=2, batch_size=10,
                              validation_data=(self.texts, self.labels),
                              model_directory=self.model_directory, verbose=0)
        self.assertIsInstance(history, History)
        self.assertTrue(os.path.exists(os.path.join(self.model_directory, "model.hd5")))
        self.assertTrue(os.path.exists(os.path.join(self.model_directory, "classifier.pk")))
        self.assertTrue(os.path.exists(os.path.join(self.model_directory, "description.txt")))
        self.assertTrue(os.path.exists(os.path.join(self.model_directory, "history.json")))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号