Machine learning functions Troy uses repeatedly.