ML algorithm for key functional