Accounting for real world phenomena in machine learning and mechanism design