Performance modelling and optimization for video-analytic algorithms in a cloud-like environment using machine learning