November 2018
Intermediate to advanced
556 pages
14h 42m
English
We can now develop a unit test and a regression test to check the quality of our analytics. The following algorithm develops a simple unit test that checks the anomaly detection procedure that we have developed with a predefined dataset:
import unittestfrom my_anomaly_detection import search_anomaliesclass MyTest(unittest.TestCase): def test(self): d=np.array([10, 10, 10, 10, 30, 20, 10, 10]) a=search_anomalies(d,2) a=a['anomalies'] self.assertListEqual(a[1], [4,30])if __name__ == '__main__': unittest.main()
To deploy the analytics on the cloud, we have to decide whether to use a cold-path or a hot-path. The developed algorithm doesn't need a lot of data and should run on the data that we have available. We ...