On Hyperparameter Optimization of Machine Learning Algorithms: Theory and Practice