Adding machine-learning logic