Optimize machine learning with bias-variance tradeoff