Accelerating 3D printing of pharmaceutical products using machine learning