Optimized ensemble learning and its application in agriculture