Machine learning and optimization algorithms and their applications in agriculture