BaşlayınÜcretsiz Başlayın

Writing unit tests

In the previous video on inference testing, you learned about the importance of writing test cases for your trained and evaluated model using the Python unittest library. In this exercise, you will put your new skills to the test by writing a test case for the model to check that it is producing binary outputs as expected. Your trained model is imported, as well as the testing portion of the dataset X_test.

Bu egzersiz

End-to-End Machine Learning

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

import unittest
import numpy as np

# Create a class called TestModelInference
class ____(unittest.____):
	def setUp(self):
		self.model = model
Kodu Düzenle ve Çalıştır