Optimization of reliability and speed of the end-of-line quality inspection of electric motors using machine learning