The Neyman–Pearson theory of hypothesis testing can be employed for goodness of fit if the alternative hypothesis H1 is generic enough not to introduce a significant bias while at the same time avoiding overfitting. A practical implementation of this idea (dubbed NPLM) has been developed in the context of high energy physics. After a general introduction to the approach,I will present an implementation based on efficient machine learning methods for the monitoring of particle detectors in real-time.