Essays on machine learning for economics and finance