Benefits of TDD in machine learning

爷,独闯天下 提交于 2019-12-04 05:05:36

With TDD, you describe the expected behavior in the form of a test and then create the code to satisfy the test. While this can work well for some components of your machine learning model, it usually doesn't work well for the high-level behavior of a machine learning model, because the expected behavior is not precisely known in advance. The process of developing a machine learning model often involves trying different approaches to see which one is most effective. The behavior is likely to be measured in terms of percentages, e,g, recognition is 95% accurate, rather than absolutes.

I think you might be talking about two distinct goals here:

  1. How can I improve my algorithm's performance? This would entail the correctness of labeling for a classification problem for example. But this could also mean a lot of other things such as how many hyper-parameter it requires, what the runtime is and so on. One particular problem in this category for example is tuning your model (lets say a logistic regression model) and that can be done standard mechanism of splitting data into training, validation and test set.

  2. How can I catch bugs in my algorithm? This focuses on finding functional issues. In other words, issues that exist because the code was not written according to the design. Even though the design might be a bad one (which falls in point 1 above), the code should correctly implement it. This is where TDD has most value. Yes, for this to be useful the tester code should have specific parameters to validate and assert.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!