Performance and cost optimization best practices for machine learning